diff options
author | Luka Perkov <luka@openwrt.org> | 2015-11-10 00:16:37 +0000 |
---|---|---|
committer | Luka Perkov <luka@openwrt.org> | 2015-11-10 00:16:37 +0000 |
commit | 9a28a84b8154e48243ddd1663c297d5806521d19 (patch) | |
tree | 6e34f5863b3d0676b7d44a848b5b7bf5030c2168 /target/linux | |
parent | 313cacaf9a572d3e75f2f45d5d1dcdd271e6db9f (diff) | |
download | master-187ad058-9a28a84b8154e48243ddd1663c297d5806521d19.tar.gz master-187ad058-9a28a84b8154e48243ddd1663c297d5806521d19.tar.bz2 master-187ad058-9a28a84b8154e48243ddd1663c297d5806521d19.zip |
kirkwood: support Linksys boot counter on EA[34]500
This is done with existing code from the WRT1900AC port.
It makes sure the "auto_recovery" bootloader option is set,
and resets the s_env boot counter after a successful boot.
This gives users without a serial console connection some
measure of safety.
Signed-off-by: Claudio Leite <leitec@staticky.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47433 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rwxr-xr-x | target/linux/kirkwood/base-files/etc/init.d/linksys_recovery | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery b/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery new file mode 100755 index 0000000000..3f1b7626bb --- /dev/null +++ b/target/linux/kirkwood/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/kirkwood.sh + +case $(kirkwood_board_name) in + linksys-audi|linksys-viper) + # 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 +} |