Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watchguard,firebox-m300 sysupgrade -n does not reset the overlayfs #13980

Closed
1 task done
RussellSenior opened this issue Nov 14, 2023 · 4 comments
Closed
1 task done
Labels
bug issue report with a confirmed bug

Comments

@RussellSenior
Copy link
Contributor

RussellSenior commented Nov 14, 2023

Describe the bug

As of r24368-36b1dd75fd, noticed that sysupgrade -n leaves the old configuration in place after flash, which is not what -n is supposed to do.

OpenWrt version

r24368-36b1dd75fd

OpenWrt target/subtarget

qoriq/generic

Device

WatchGuard Firebox M300

Image kind

Self-built image

Steps to reproduce

Install a fresh build
touch /root/NUKEME
fetch e.g. the same build to /tmp/
sysupgrade -v -n /tmp/openwrt-qoriq-generic-watchguard_firebox-m300-squashfs-sysupgrade.img.gz
ls -l /root/
find NUKEME is still there.

Actual behaviour

sysupgrade -n does not erase/re-initialize the ext4 overlayfs on /dev/loop0 (which comes after the squashfs on /dev/mmcblk0p2.

Expected behaviour

Sysupgrade -n is supposed to clear previous settings and re-initialize the overlayfs.

Additional info

jffs2reset -y && reboot still seems to work (at least, mostly. I noticed that some files might hang around, e.g. /root/.ssh) for nuking the old overlayfs.

Diffconfig

CONFIG_TARGET_qoriq=y
CONFIG_TARGET_qoriq_generic=y
CONFIG_TARGET_qoriq_generic_DEVICE_watchguard_firebox-m300=y
CONFIG_DEVEL=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUILD_LOG=y

Terms

  • I am reporting an issue for OpenWrt, not an unsupported fork.
@RussellSenior RussellSenior added the bug issue report with a confirmed bug label Nov 14, 2023
@RussellSenior
Copy link
Contributor Author

Is this an artifact of package/base-files/files/lib/upgrade/legacy-sdcard.sh @dangowrt ?

@RussellSenior
Copy link
Contributor Author

RussellSenior commented Dec 1, 2023

Also noticed that after installing the sdcard image, the overlayfs is ext4, but if I nuke the ext4, e.g. by "dd if=/dev/zero of=/dev/loop0" on the device and rebooting, the booting system notices no filesystem in /dev/loop0 where the overlayfs is expected, and it creates a f2fs filesystem instead of ext4, which seems weird.

@RussellSenior
Copy link
Contributor Author

This seems to fix it:

diff --git a/target/linux/qoriq/image/Makefile b/target/linux/qoriq/image/Makefile
index ec46e4d543..69fea238b5 100644
--- a/target/linux/qoriq/image/Makefile
+++ b/target/linux/qoriq/image/Makefile
@@ -13,7 +13,7 @@ define Build/sdcard-img
                 $(foreach dtb,$(DEVICE_DTS),$(CP) $(KDIR)/image-$(dtb).dtb $@.boot), \
                 $(CP) $(KDIR)/image-/*.dtb $@.boot)
 
-        $(SCRIPT_DIR)/gen_image_generic.sh \
+        PADDING=1 $(SCRIPT_DIR)/gen_image_generic.sh \
                 $@ \
                 $(CONFIG_TARGET_KERNEL_PARTSIZE) $@.boot \
                 $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \

@RussellSenior
Copy link
Contributor Author

Fixed with: 643a4ad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue report with a confirmed bug
Projects
None yet
Development

No branches or pull requests

1 participant