[OpenWrt-Devel] [PATCH V2] Fix for mvebu (WRT1900AC/WRT1200AC/etc) boot counter
Rob Mosher
nyt-openwrt at countercultured.net
Tue Aug 18 20:29:05 EDT 2015
Auto recovery is enabled when flashing, so if it goes wrong, you can get
back to your previous image. Otherwise, I don't think there's a need
for it as all it does is switch which kernel/root partitions are booted
which shouldn't ever change unless flashing (famous last words?).
root at ZOMGWTFBBQWIFI:/lib/upgrade# cat linksys.sh
#
# Copyright (C) 2014-2015 OpenWrt.org
#
linksys_get_target_firmware() {
cur_boot_part=`/usr/sbin/fw_printenv -n boot_part`
target_firmware=""
if [ "$cur_boot_part" = "1" ]
then
# current primary boot - update alt boot
target_firmware="kernel2"
fw_setenv boot_part 2
fw_setenv bootcmd "run altnandboot"
elif [ "$cur_boot_part" = "2" ]
then
# current alt boot - update primary boot
target_firmware="kernel1"
fw_setenv boot_part 1
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"
}
[...]
On 8/18/2015 8:16 PM, Claudio Leite wrote:
> * Rob Mosher (nyt-openwrt at countercultured.net) wrote:
>> +++ b/target/linux/mvebu/base-files/etc/init.d/u-boot_env
>> @@ -9,6 +9,7 @@ boot() {
>> case $(mvebu_board_name) in
>> armada-385-linksys-caiman|armada-385-linksys-cobra|armada-xp-linksys-mamba)
>> fw_setenv auto_recovery off
> With s_env now properly updated, is there still a reason to turn off
> auto_recovery?
>
> I know it's generally a poor recovery mechanism, but as long as it
> doesn't interfere with booting OpenWrt it might be better than nothing.
>
>> + mtd resetbc s_env
>> ;;
>> esac
>> }
>> --
>> 2.1.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list