summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2015-04-16 00:37:43 +0200
committerBjørn Mork <bjorn@mork.no>2015-04-16 00:37:43 +0200
commit4a9f40eceb4fd38ca4a37b74cce92a957e270976 (patch)
treee1a4f84f1018502926bdd9e94e3f83af690819f4
parent67d1ed10ff85433b68f80dbd83874d90a0ce4cb4 (diff)
covery: adding boot script
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r--.gitignore1
-rw-r--r--covery/Makefile3
-rw-r--r--covery/files/etc/init.d/bootcount12
3 files changed, 15 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 847af40..ec0c648 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
#*#
*.a
-*.d
*.ko
*.la
*.lo
diff --git a/covery/Makefile b/covery/Makefile
index 8060453..0d8fc05 100644
--- a/covery/Makefile
+++ b/covery/Makefile
@@ -8,6 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=covery
+PKG_VERSION:=0.00
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
@@ -39,6 +40,8 @@ endef
define Package/covery/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/covery $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/etc/init.d/bootcount $(1)/etc/init.d/bootcount
endef
$(eval $(call BuildPackage,covery))
diff --git a/covery/files/etc/init.d/bootcount b/covery/files/etc/init.d/bootcount
new file mode 100644
index 0000000..681ea7d
--- /dev/null
+++ b/covery/files/etc/init.d/bootcount
@@ -0,0 +1,12 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 Bjørn Mork <bjorn@mork.no>
+
+START=99
+boot() {
+ auto_recovery=`/usr/sbin/fw_printenv -n auto_recovery`
+ if [ "$auto_recovery" = "yes" ] && [ -x /usr/sbin/covery ]
+ then
+ # reset last bootcount to 0
+ /usr/sbin/covery -c
+ fi
+}