diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2015-08-19 08:35:41 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2015-08-19 08:35:41 +0000 |
commit | 9f8042dd1f611cb0226c0e13cc26d6879f137d6a (patch) | |
tree | d50eb70e9fbb78619a069820f3eb8427bcfa4acf /target/linux/mvebu/base-files/etc/init.d/linksys_recovery | |
parent | f9ccf89b13ac00aac7d741c62bca19beaa588951 (diff) | |
download | upstream-9f8042dd1f611cb0226c0e13cc26d6879f137d6a.tar.gz upstream-9f8042dd1f611cb0226c0e13cc26d6879f137d6a.tar.bz2 upstream-9f8042dd1f611cb0226c0e13cc26d6879f137d6a.zip |
mvebu: add support for the Linksys boot counter (backport of r46690)
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/branches/chaos_calmer@46691 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mvebu/base-files/etc/init.d/linksys_recovery')
-rwxr-xr-x | target/linux/mvebu/base-files/etc/init.d/linksys_recovery | 20 |
1 files changed, 20 insertions, 0 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 +} |