base-files: safer sysupgrade for kernel-in-UBI devices
authorRodrigo Balerdi <lanchon@gmail.com>
Fri, 15 Apr 2022 03:59:49 +0000 (00:59 -0300)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 19 Apr 2022 15:28:25 +0000 (16:28 +0100)
commit073dc450b5ca91cfffd9097f0e3900dd390be399
tree1bdd5517c84279172ce41ef2d0fd7ea60dd06508
parent1e191adb20abe428d5feb128ce28f1457ae5110b
base-files: safer sysupgrade for kernel-in-UBI devices

Ensure that the kernel CRC is invalidated while rootfs is being updated.
This allows the bootloader to detect an interrupted sysupgrade and fall
back to an alternate booting method, instead of just going ahead with
normal boot and effectively bricking the device.

Possible fallbacks include a recovery initramfs partition or UBI volume
and TFTP. See here for an example U-Boot configuration with fallbacks:
https://shorturl.at/befsA (https://github.com/Lanchon/openwrt-tr4400-v2/
blob/e7d707d6bd7839fbd0b8d0bd180fce451df77e47/install-recovery.sh#L52-L63)

Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
package/base-files/files/lib/upgrade/nand.sh