some feedback...
The problem of overlay is mainly an issue of the squashfs firmware ! (may be now look at it to find the reason)
There is now problem with the ext4 firmware !
I just get this procedure working with EspressoBinUltra and OpenWrt 21.02.0 EXT4, enhanced with a F2FS overlay...
Here the steps followed :
- Install necessary package after firstboot and flash...
opkg update
opkg install f2fs-tools kmod-fs-f2fs block-mount fdisk e2fsprogs kmod-fs-ext4
- Prepare overlay
fdisk /dev/mmcblk0
mkfs.f2fs -l rootfs_data /dev/mmcblk0p3
- Config overlay
DEVICE="/dev/mmcblk0p3"
eval $(block info ${DEVICE} | grep -o -e "UUID=\S*")
uci -q delete fstab.overlay
uci set fstab.overlay="mount"
uci set fstab.overlay.uuid="${UUID}"
uci set fstab.overlay.target="/overlay"
uci commit fstab
- Unnecessary step (because there is no overlay on ext4 firmware... and it will be auto prepared at firstboot !)
mkdir -p /tmp/cproot
mount --bind /overlay /tmp/cproot
mount ${DEVICE} /mnt
tar -C /tmp/cproot -cvf - . | tar -C /mnt -xf -
umount /tmp/cproot /mnt
sync
- Test
reboot
- Verify
root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 102.4M 14.1M 86.2M 14% /rom
tmpfs 496.7M 52.0K 496.6M 0% /tmp
/dev/mmcblk0p3 7.2G 412.8M 6.8G 6% /overlay
overlayfs:/overlay 7.2G 412.8M 6.8G 6% /
tmpfs 512.0K 0 512.0K 0% /dev
root@OpenWrt:/# mount
/dev/root on /rom type ext4 (rw,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/mmcblk0p3 on /overlay type f2fs (rw,lazytime,relatime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
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)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,noatime,mode=700)
root@OpenWrt:/# ls /overlay/ -hal
drwxr-xr-x 5 root root 4.0K Jan 1 1970 .
drwxr-xr-x 1 root root 3.4K Jan 1 1970 ..
drwxr-xr-x 2 root root 3.4K Jan 1 1970 etc
drwxr-xr-x 2 root root 3.4K Jan 1 1970 upper
drwxr-xr-x 3 root root 3.4K Jan 1 1970 work
root@OpenWrt:/# ls /overlay/etc/ -hal
drwxr-xr-x 2 root root 3.4K Jan 1 1970 .
drwxr-xr-x 5 root root 4.0K Jan 1 1970 ..
-rw-rw-rw- 1 root root 36 Jan 1 1970 .extroot-uuid
Reference : https://openwrt.org/docs/guide-user/additional-software/extroot_configuration