aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mvebu
diff options
context:
space:
mode:
authorImre Kaloz <kaloz@openwrt.org>2015-08-19 08:31:23 +0000
committerImre Kaloz <kaloz@openwrt.org>2015-08-19 08:31:23 +0000
commitb6151ba965bff9a3a19da2daf384855211baa53c (patch)
tree94598828284cc07a1439492f4bba866afd431594 /target/linux/mvebu
parent429f42d2d6a94e3b826b267745463e21d01f6333 (diff)
downloadmaster-187ad058-b6151ba965bff9a3a19da2daf384855211baa53c.tar.gz
master-187ad058-b6151ba965bff9a3a19da2daf384855211baa53c.tar.bz2
master-187ad058-b6151ba965bff9a3a19da2daf384855211baa53c.zip
mvebu: add support for the Linksys boot counter
The u-boot boot counter was never reset after a successful boot, which sometimes could make some variables become out of sync. This patch adds support for the boot counter and enables auto_recovery unconditionally. Signed-off-by: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Rob Mosher <nyt-openwrt@countercultured.net> Signed-off-by: Imre Kaloz <kaloz@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46690 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mvebu')
-rwxr-xr-xtarget/linux/mvebu/base-files/etc/init.d/linksys_recovery20
-rwxr-xr-xtarget/linux/mvebu/base-files/etc/init.d/u-boot_env14
2 files changed, 20 insertions, 14 deletions
diff --git a/target/linux/mvebu/base-files/etc/init.d/linksys_recovery b/target/linux/mvebu/base-files/etc/init.d/linksys_recovery
new file mode 100755
index 0000000000..60d7be0636
--- /dev/null
+++ b/target/linux/mvebu/base-files/etc/init.d/linksys_recovery
@@ -0,0 +1,20 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2015 OpenWrt.org
+
+START=97
+boot() {
+. /lib/functions.sh
+. /lib/mvebu.sh
+
+case $(mvebu_board_name) in
+ armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
+ # make sure auto_recovery in uboot is always on
+ AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
+ if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then
+ fw_setenv auto_recovery yes
+ fi
+ # reset the boot counter
+ mtd resetbc s_env
+ ;;
+esac
+}
diff --git a/target/linux/mvebu/base-files/etc/init.d/u-boot_env b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
deleted file mode 100755
index 82f36cb71f..0000000000
--- a/target/linux/mvebu/base-files/etc/init.d/u-boot_env
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2015 OpenWrt.org
-
-START=97
-boot() {
-. /lib/functions.sh
-. /lib/mvebu.sh
-
-case $(mvebu_board_name) in
- armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
- fw_setenv auto_recovery off
- ;;
-esac
-}