The check that decides whether the new rootfs is a UBI image passes one argument
where
715634e6d144 now expects two. Without the extraction command the subshell
runs nothing, the magic comes back empty and the check fails. sysupgrade then
falls back to writing the whole image over the firmware partition, which cannot
carry sysupgrade.tgz into the new rootfs_data volume. After the reboot the
settings are gone, as if -n had been passed, and the UBI erase counters go with
them.
Affects bcm53xx NAND devices flashed with a trx based image, from 24.10.0-rc1
onwards.
The fix lives in the firmware doing the flashing, so upgrading from an affected
build loses the config one last time. Every upgrade from a fixed build onwards
keeps it.
Build tested on main with kernel 6.18, Asus RT-N18U, three consecutive
sysupgrades, config preserved every time.
Fixes: 715634e6d144 ("base-files: upgrade: nand: use "cmd" argument for extracting command")
Link: https://github.com/openwrt/openwrt/issues/21024
Link: https://github.com/openwrt/openwrt/issues/21655
Signed-off-by: Semih Baskan <strst.gs@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/24531
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
}
# Firmwares without UBI image should be flashed "normally"
- local root_type=$(identify $dir/root)
+ local root_type=$(identify "$dir/root" "cat")
[ "$root_type" != "ubi" ] && {
echo "Provided firmware doesn't use UBI for rootfs."
return