Sysupgrade on squashfs raspberry pi 4 doesn't clear overlay

I tried to do a sysupgrade on my RaspberryPi 4 using the current rpi-4-squashfs-sysupgrade.img.gz file.

While it seems to work fine (kernel and base images are upgraded), the overlay itself isn't cleared as one would expect. E.g. opkg doesn't realize base packages have been upgraded due to the sysupgrade:

root@RouterPi:~# opkg info base-files
Package: base-files
Version: 205-r11117-b2c55d50f8
Depends: libc, netifd, procd, jsonfilter, usign, openwrt-keyring, fstools, fwtool
Status: unknown ok not-installed
Section: base
Architecture: aarch64_cortex-a72
Size: 41821
Filename: base-files_205-r11117-b2c55d50f8_aarch64_cortex-a72.ipk
Description: This package contains a base filesystem and system scripts for OpenWrt.

Package: base-files
Version: 205-r11001-ce6311d301
Depends: libc, netifd, procd, jsonfilter, usign, openwrt-keyring, fstools, fwtool
Status: install user installed
Architecture: aarch64_cortex-a72
Conffiles:
 /etc/ethers 56bda09b0aa3d1e88107bfa8a1c6e4449d5c1f47245dc1c4037ff9b5db163b7c
 /etc/group 45e8cab268d4a2254d48ccb1f889630047e81758de54a614cad5449fdbebe19c
 /etc/hosts c1a978d90673437b35fa9494e0a54294062c152bb653d490b718052ab88447fd
 /etc/inittab 36673a9fd8fdbaaef8bf773b7bdf0ac207cf39e91bcbb75d7cf5d6cb9aab0564
 /etc/iproute2/rt_protos a0712b1771c8d5f3e0dcf9a6314880e71aa3498ea1ae873535bdfcf70d814061
 /etc/iproute2/rt_tables f771e2b81741f70e3faf658dc504f0dc048672fc8caaadea15e46c35da3de8f8
 /etc/passwd 6a451aa33393f47ade89b8bce4d9711818c2630394c3967265ffed276bb25a55
 /etc/profile 9e36315e247bae64a6027c973cb421ff6fd76b8eae5adbac824cc8ad63f5a996
 /etc/protocols 7d551355d5540b07b9d86e623cbbc4abecbb94d2a662b3afcc917940eb0e3d52
 /etc/rc.local 515018aa94eb4937dade12dc0d69890b352af35a5ab5fb8203f9ed10990ac06f
 /etc/services 754ccc71ca347bc79ac4c45139d416b7cf1e65a919dad1db15613a216cd6b9cc
 /etc/shadow ccbbfeee2dd560403fea13f7f431ebd21d9bb4b3d41e48e892013fa451f91cc4
 /etc/shells 8b35ce73c18161a7d7ed16fa244410993bd031515260e3e0c11749047df48d0a
 /etc/sysctl.conf c02fe88dc055a1eaee9e7cb631760a3a5a9cea55610b42aa45196838c6f1a55e
 /etc/sysupgrade.conf 9e87b05fe2f12c84d1c465b396322748479f64bc40e5bab061887f0bd95020a6
Installed-Time: 1568320674

/etc/os-release (part of base-files) proves that the sysupgrade itself upgraded the package:

root@RouterPi:~# cat /etc/os-release
NAME="OpenWrt"
VERSION="SNAPSHOT"
ID="openwrt"
ID_LIKE="lede openwrt"
PRETTY_NAME="OpenWrt SNAPSHOT"
VERSION_ID="snapshot"
HOME_URL="https://openwrt.org/"
BUG_URL="https://bugs.openwrt.org/"
SUPPORT_URL="https://forum.openwrt.org/"
BUILD_ID="r11117-b2c55d50f8"
OPENWRT_BOARD="brcm2708/bcm2711"
OPENWRT_ARCH="aarch64_cortex-a72"
OPENWRT_TAINTS=""
OPENWRT_DEVICE_MANUFACTURER="OpenWrt"
OPENWRT_DEVICE_MANUFACTURER_URL="https://openwrt.org/"
OPENWRT_DEVICE_PRODUCT="Generic"
OPENWRT_DEVICE_REVISION="v0"
OPENWRT_RELEASE="OpenWrt SNAPSHOT r11117-b2c55d50f8"

Even running firstboot or jffs2reset doesn't change anything.

For good measure I tested this with todays snapshot images and another Raspberry Pi 3 that I had on hand… doing a sysupgrade on the ext4 image resets everything as expected, but a sysupgrade on the squashfs image doesn't clear the overlay.

Since this seems to be an issue in all raspberrypi squashfs images I assume I stumbled over a bug… how can I help getting this resolved?

please show output of

mount

I just updated the original post, since this is clearly an issue of the overlay not getting reset on a sysupgrade.

mount output:

/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup on /sys/fs/cgroup type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,cpu,cpuacct,blkio,memory,devices,freezer,net_cls,pids)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/loop0 on /overlay type f2fs (rw,lazytime,noatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,fsync_mode=posix)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
/dev/mmcblk0p1 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

f2fs??

I don’t know if that’s standard config.

If that’s correct, that’s where I’d start looking. If non-standard and you want to stick with f2fs, you likely need a custom stage2 for sysupgrade

I'm using the default brcm2708 images, there is some more information on this here:
https://patchwork.ozlabs.org/patch/891758/

What would be the recommended way to run OpenWRT on RaspberryPi then? Should I just use the ext4 images?

Since I already experienced broken ext4 partitions on long-running Pis I hoped that using the squashfs images would be more reliable, but reading the linked thread makes me question the reliability of f2fs and the squashfs images for RaspberryPi in general.

you didn't by any chance flash a squash sysupgrade over an ext4 .img?

Not as far as I remember… I did make sure to have a clean install on my Raspberry Pi 3 test. There I first nulled the whole micro sd card, then flashed the squashfs factory image and then did a sysupgrade with the squashfs sysupgrade image. Same problem there, overlay didn't get cleaned.

1 Like