Caveats on sysupgrading snapshot after moving to extroot?

System upgrade

This section applies to OpenWrt snapshot, but not to OpenWrt releases, as the kernel-related packages (and the packages requiring them) in releases will only receive fixes and security patches.

DO NOT try to do upgrades using opkg upgrade. You will likely end up with an inconsistent state and soft-bricked router that way:

  • The main reason is that the uClibc ABI (Application Binary Interface) is unstable and changes from revision to revision, so binaries for one version of uClibc may be incompatible with versions from another.

  • Another problem that can arise is if you try to upgrade the kernel packages, then flash and reboot, but your operation is interrupted in any way, then you will have a kernel and module mismatch and likely a brick.

  • Finally, if you upgrade all packages but the kernel and the kernel modules, some packages like iptables will be broken.

I took the last section from the extroot config guide to mean: I should be fine as long as I don't run "opkg update; opkg upgrade [any kmod pkg]" (which is a no-no without extroot anyway, as I found out the hard way, and even posted in the forum before.)

So I did "sysupgrade openwrt-snapshot-sysupgrade.bin" after migrating to a USB Ext4 extroot, and the optional step of moving /var/opkg-lists to /usr/lib/opkg/lists.

After the snapshot sysupgrade, I did not get a soft brick. Rather, the router came back, without mounting the extroot, even though fstab remains intact. So I lost access to opkg and most of the binaries on the extroot.

I already recovered from that, but the route I took might not be the most optimal. I'm wondering what I could have done differently, to recover from that disappearing extroot following sysupgrade of a snapshot more efficiently. Or, is it not advisable to try to sysupgrade a snapshot once it's on extroot at all?

are you referring to a traditional extroot@overlay?

I have no idea. Whatever type of extroot that's described in that guide. Is there a newer kind of extroot?

yes, it's probably extroot-overlay...

all the guides and common workflow require the 'overlay' filesystem to be recreated per-release / install...

otherwise you will run into package inconsistencies at best... and kernel crashes at worst when your 'new' kernel tries to load 'old' modules...

use the forum search feature to track down various approaches to overlay recreation / migration...

1 Like

Is there a guide on what those additional steps are? I don't think that guide nor the one on covers such safeguards for sysupgrade.

Is there any other extroot than extroot-overlay?

for the purposes you describe, not really...

many guides on the internet refer to 'extroot' when they mean 'usb' ... many times the mountpoint of which is / ( I call this 'pure-extroot' )... if your mountpoint is /overlay then it's extroot-overlay... an extroot-overlay filesystem can contain only a few folders and files you wish to take precedence... a pure-extroot would contain a full copy of the flash rootfs... totally different beasts... but for most purposes extroot-overlay is advised...

similar situation.... filesystem is tied to each 'install'...

( fyi, the guide you reference is quite old ( edit: the quoted parts )... although the steps are likely almost identical... uClibc had not been in use for quite a while )... opkg upgrade has little to nothing to do with what you are really talking about here...

1 Like

same steps... you just have to do them each install... ( what you need to track down is how you can recover/backup prior to upgrade and then restore once the extroot has been recreated fresh, for the most part it is comprehending the 'order/workflow' more than any specific step... )

search for 'extroot @eduperez' ... should find you most of the best posts...

For as long as I used to have extroot on my Carambola2, I was upgrading to a newer version normally, as if there was no extroot. After the upgrade was completed, I would run again the opkg commands to add the packages needed for extroot, then configure the extroot, and finally installing the extra packages.


Well, in my case, opkg was hosed. Was it entirely because of moving /var/opkg-lists to /usr/lib/opkg/lists? If that's the case, I'd just forego that optional step, and it'd make life much easier doing sysupgrade once I try to experiment with extroot-overlay again.

Yep, the only optional difference is that you can skip mkfs, moving files from previous installation to backup and restoring them selectively afterwards:

mount /dev/sda1 /mnt
rm -f -R /mnt/etc
mkdir -p /mnt/bak
mv -f /mnt/upper/* /mnt/bak
cp -f -a /overlay/. /mnt
umount /mnt

I never did that. However in snapshots the opkg feeds are slightly different, so be careful what you carry over.
If you don't need the space saved in ram you can skip this step anyway.

that step in the guide is merely as it says 'to leverage a current less volatile filesystem media, and prevent have to do OPKG UPDATE every boot'...

it has nothing to do with make anything persistent during the sysupgrade process...