openwrt/package/base-files/files/lib/upgrade
Rodrigo Balerdi 7d02fc0951 base-files: fix sysupgrade for kernel-out-of-UBI
Commit ecbcc0b595 bricks devices on which the raw kernel and UBI mtd
partitions overlap.

This is the case of the ZyXEL NR7101 for example. Its OEM bootloader has
no UBI support. OpenWrt splits the stock kernel mtd partition into a raw
kernel part used by the bootloader and a UBI part used to store rootfs
and rootfs_data. Running mtd erase on the complete partition during
sysupgrade erases the UBI part and results in a soft brick.

Arguably the best solution would be to fix the partition layouts so that
kernel and UBI partitions do not overlap, also including a stock_kernel
partition to help reverting to stock firmware. This would have the added
benefit of protecting UBI from kernel images that are excessively large.

Fixes: ecbcc0b595 ("base-files: safer sysupgrade.tar for kernel-out-of-UBI")
Reported-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Rodrigo Balerdi <lanchon@gmail.com>
2022-05-02 12:42:15 +01:00
..
keep.d base-files: Add /etc/shinit for non-login shell init 2020-03-01 21:35:59 +01:00
common.sh ipq40xx: Support Chromium OS image-type creation 2022-03-25 18:14:13 +01:00
do_stage2 treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup 2019-09-11 09:05:35 +02:00
emmc.sh base-files: Align rootfs_data upgrades to 64KiB on eMMC 2022-03-16 17:50:06 +01:00
fwtool.sh base-files: change logging for upgrade on fwtool 2021-05-17 01:00:14 +02:00
legacy-sdcard.sh base-files: rename 'sdcard' to 'legacy-sdcard' 2021-08-16 12:22:17 +01:00
nand.sh base-files: fix sysupgrade for kernel-out-of-UBI 2022-05-02 12:42:15 +01:00
stage2 base-files: make sure tools are present in sysupgrade ramdisk 2022-02-22 19:16:03 +00:00