From 20fac016e432cf384289b3fefadf3f4909924faf Mon Sep 17 00:00:00 2001 From: Imre Kaloz Date: Wed, 19 Aug 2015 08:31:23 +0000 Subject: 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 Signed-off-by: Rob Mosher Signed-off-by: Imre Kaloz SVN-Revision: 46690 --- .../mvebu/base-files/etc/init.d/linksys_recovery | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 target/linux/mvebu/base-files/etc/init.d/linksys_recovery (limited to 'target/linux/mvebu/base-files/etc/init.d/linksys_recovery') 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 0000000..60d7be0 --- /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 +} -- cgit v1.1