From: Imre Kaloz Date: Wed, 27 May 2015 19:03:22 +0000 (+0000) Subject: mvebu: make flashing more safe X-Git-Tag: reboot~2958 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9fb062cf9332658e2c2b1e0decf6f56088d42024;p=openwrt%2Fstaging%2Fxback.git mvebu: make flashing more safe Turn on the auto recovery feature when flashing and turn it off on successful bootup. Signed-off-by: Imre Kaloz SVN-Revision: 45792 --- 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 new file mode 100755 index 0000000000..82f36cb71f --- /dev/null +++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env @@ -0,0 +1,14 @@ +#!/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 +} diff --git a/target/linux/mvebu/base-files/lib/upgrade/linksys.sh b/target/linux/mvebu/base-files/lib/upgrade/linksys.sh index f37831ba75..fc403332bd 100644 --- a/target/linux/mvebu/base-files/lib/upgrade/linksys.sh +++ b/target/linux/mvebu/base-files/lib/upgrade/linksys.sh @@ -1,5 +1,5 @@ # -# Copyright (C) 2014 OpenWrt.org +# Copyright (C) 2014-2015 OpenWrt.org # linksys_get_target_firmware() { @@ -19,6 +19,9 @@ linksys_get_target_firmware() { fw_setenv bootcmd "run nandboot" fi + # re-enable recovery so we get back if the new firmware is broken + fw_setenv auto_recovery yes + echo "$target_firmware" }