diff options
author | Bjørn Mork <bjorn@mork.no> | 2015-04-16 00:37:43 +0200 |
---|---|---|
committer | Bjørn Mork <bjorn@mork.no> | 2015-04-16 00:37:43 +0200 |
commit | 4a9f40eceb4fd38ca4a37b74cce92a957e270976 (patch) | |
tree | e1a4f84f1018502926bdd9e94e3f83af690819f4 | |
parent | 67d1ed10ff85433b68f80dbd83874d90a0ce4cb4 (diff) |
covery: adding boot script
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | covery/Makefile | 3 | ||||
-rw-r--r-- | covery/files/etc/init.d/bootcount | 12 |
3 files changed, 15 insertions, 1 deletions
@@ -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 +} |