From 120f74fe66549654269e95a86e48b073b976aeef Mon Sep 17 00:00:00 2001 From: Nuno Goncalves Date: Mon, 15 Sep 2014 23:14:04 +0000 Subject: [PATCH] restorefactory: move to github (obsolete) Signed-off-by: Nuno Goncalves SVN-Revision: 42559 --- utils/restorefactory/Makefile | 39 ------------------- .../files/hotplug_restorefactory | 31 --------------- .../files/uci_defaults_restorefactory | 10 ----- 3 files changed, 80 deletions(-) delete mode 100644 utils/restorefactory/Makefile delete mode 100755 utils/restorefactory/files/hotplug_restorefactory delete mode 100755 utils/restorefactory/files/uci_defaults_restorefactory diff --git a/utils/restorefactory/Makefile b/utils/restorefactory/Makefile deleted file mode 100644 index ab62c44f6..000000000 --- a/utils/restorefactory/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (C) 2010 segal.di.ubi.pt -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=restorefactory -PKG_VERSION:=1 -PKG_RELEASE:=6 - -PKG_MAINTAINER:=Nuno Goncalves - -include $(INCLUDE_DIR)/package.mk - -define Package/restorefactory - SECTION:=utils - CATEGORY:=Utilities - TITLE:=Mimic original functionality of the reset button -endef - -define Package/restorefactory/description -RestoreFactory handles the reset button event and issues a "firstboot" command. -Button and wait time can be configured with a UCI file. -endef - -define Build/Compile -endef - -define Package/restorefactory/install - $(INSTALL_DIR) $(1)/etc/hotplug.d/button - $(INSTALL_BIN) ./files/hotplug_restorefactory $(1)/etc/hotplug.d/button/50-restorefactory - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_BIN) ./files/uci_defaults_restorefactory $(1)/etc/uci-defaults/50-restorefactory -endef - -$(eval $(call BuildPackage,restorefactory)) diff --git a/utils/restorefactory/files/hotplug_restorefactory b/utils/restorefactory/files/hotplug_restorefactory deleted file mode 100755 index 527349968..000000000 --- a/utils/restorefactory/files/hotplug_restorefactory +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -system_config() { - config_get button "$1" button "reset" - config_get action "$1" action "pressed" - config_get timeout "$1" timeout "5" -} - -config_load system -config_foreach system_config restorefactory - -[ "$BUTTON" = "$button" ] && { - - [ -f /tmp/run/restorefactory.pid ] && read PID < /tmp/run/restorefactory.pid && kill $PID && rm /tmp/run/restorefactory.pid && logger -p user.info -t "restorefactory" "restore to factory defaults aborted" - - [ "$ACTION" = "$action" ] && { - - if [ "$timeout" -gt 0 ] - then - sleep "$timeout" && firstboot && reboot & - echo $! > /tmp/run/restorefactory.pid - logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds" - elif [ "$timeout" -eq 0 ] - then - firstboot && reboot & - else - logger -p user.info -t "restorefactory" "invalid timeout value ($timeout)" - fi - } -} - diff --git a/utils/restorefactory/files/uci_defaults_restorefactory b/utils/restorefactory/files/uci_defaults_restorefactory deleted file mode 100755 index 1af088eb8..000000000 --- a/utils/restorefactory/files/uci_defaults_restorefactory +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -uci -q show system.@restorefactory[0] || { - uci add system restorefactory - uci set system.@restorefactory[0].button=reset - uci set system.@restorefactory[0].action=pressed - uci set system.@restorefactory[0].timeout=5 - uci commit -} - -- 2.30.2