diff mbox

[OpenWrt-Devel] mvebu: enable auto recovery all the time

Message ID 1439950402-17527-1-git-send-email-nyt-openwrt@countercultured.net
State Not Applicable
Headers show

Commit Message

nyt-openwrt@countercultured.net Aug. 19, 2015, 2:13 a.m. UTC
This will have the autorecovery mechanism enabled permanently.
This patch depends on patch
  "Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter"

Signed-off-by: Rob Mosher <nyt-openwrt@countercultured.net>
---
 target/linux/mvebu/base-files/etc/init.d/u-boot_env | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox

Patch

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
index bf038b2..d67c0a4 100755
--- a/target/linux/mvebu/base-files/etc/init.d/u-boot_env
+++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
@@ -8,8 +8,14 @@  boot() {
 
 case $(mvebu_board_name) in
 	armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
-		fw_setenv auto_recovery off
+		# make sure auto_recovery in uboot is turned on
+		AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`"
+		if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then
+			fw_setenv auto_recovery yes
+		fi
 		mtd resetbc s_env
+		sync
+
 		;;
 esac
 }