Upgrade problem x86 with resized rootfs

Hi

I'am using OpenWrt 22.03.5 on a x86 system, extended the root filesystem as stated in the documentation (https://openwrt.org/docs/guide-user/installation/openwrt_x86#expanding_root_partition_and_filesystem) and can't upgrade now to 22.03.x nor 23.x

I tried to document my problem in this Github Bug report (https://github.com/openwrt/asu/issues/778#issuecomment-2365372457), but there are no more answers sadly :frowning:

As there has been a quite severe security issue with dropbear, I would really like to upgrade sooner rather than later...

Any ideas what to do?
When I start from scratch and install OpenWrt via flashing the openwrt-22.03.7-x86-64-generic-ext4-combined.img in Luci (via "Flash new firmware image") is it gonna reset my extended root filesystem or is it going to keep the size and I am going to have the same problem with the next update?

thanks in advance for your help

Yes, re-flashing overwrites the partition table with the one in the image, so you need to do the resize all over again. If you want to avoid this, you may want to consider https://openwrt.org/docs/guide-user/additional-software/extroot_configuration (or set up an imagebuilder locally and create your own images with make image ROOTFS_PARTSIZE="<size>").

1 Like

thanks for this answer

I just tried to freshly install my router and still do get this error, every time I am trying to start the upgrade:

user.info upgrade: Image metadata not present
user.info upgrade: Unable to determine upgrade device

Then I have to force upgrade and no matter if I try it via luci or cli, the router reboots and starts in the old firmware/version... after the reboot all logs are gone, so I can't tell what happened

I already tried several versions (squashfs/ext4) and every time it reboots into the old firmware... so I am still stuck :frowning:

any ideas?

That first info is benign, the second one appears to mean that sysupgrade can't find the boot device. See /lib/upgrade/platform.sh at line 15, see if that means anything to you.

  3 platform_check_image() {
...
 15         export_bootdevice && export_partdevice diskdev 0 || {
 16                 v "Unable to determine upgrade device"
 17                 return 1
 18         }
 19

Try hacking some echos into that export_bootdevice function and see why it fails, probably can't parse the rootpart or something like that. It's in /lib/upgrade/common.sh at line 168.

thanks for that hint, I tried to get some debugging/echo out of it, but I lack the programming skills to do that.

I know the root issue is my expanded root filesystem, but I thought forcing an openwrt upgrade will skip all sanity checks and reset my partition... but that's also not working :confused:

You can always temp boot Openwrt of a flashdrive, copy the kernel binary to the /boot dir of partition 1, zcat the rootfs image to partition 2, then resize2fs it.

Not very automatic, but at least it should work.