Managing Dual-Boot Firmware
The U-Boot environment variable boot_part
is what primarily determines which of the two firmware sections will be used for boot.
boot_part 1
kernel
(mtd 11)firmware
boot_part 2
alt_kernel
(mtd 13)alt_firmware
When sysupgrade
(either over the command line or LuCI) or the OEM firmware flashes a new image, it flashes the "other" one and changes boot_part
to boot from the new image next.
After three "failed" boots, U-Boot will try the "other" one from what it was without user action.
This is one way to switch firmware, especially from a box that is hanging before a console is responding. Powering-off the EA8300 before the LINKSYS light goes on solid white (will usually work even before the "failsafe" flashing starts) will almost always go against the "three, bad boots" counter.
With SSH access to the device, fw_setenv boot_part 1
or the like can be used.
cat /sys/devices/virtual/ubi/ubi0/mtd_num
shows which MTD partition is associated with /dev/ubi0, which should be kernel
or alt_kernel
There is a LuCI module for switching, but at this time it does not support the EA8300.
It might be a good "first project" to add the EA8300 to
luci/applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua
See also