You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test device: ath79 mikrotik wap-g on snapshot r15165-66d12ce667
Reproduce
sysupgrade
change settings
sysupgrade: settings lost
without CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
settings are found and restored on sysupgrade (after the initial 4K_SECTORS=y to 4K_SECTORS=n upgrade)
lose write access for routerboot soft_config (which explicitly requires CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y, as Openwrt partial erase target/linux/generic/pending-5.4/411-mtd-partial_eraseblock_write.patch had a merge error which was rendering devices unbootable at the time.)
target/linux/generic/pending-5.4/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch stopped functioning with linux 4.19
Now all partitions have a 4K erase block if CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
This causes mount_root to fail to find upgrade settings where the image is expecting 64K blocksize.
grep --binary-files=text -E 'overlay|upgrade|reboot|mount' ath79_mikrotik_wap-g_sysupgrade_loses_settings
[ 8.892059] mount_root: switching to jffs2 overlay
[ 8.899647] overlayfs: upper fs does not support tmpfile.
Mon Dec 7 13:25:31 UTC 2020 upgrade: Sending TERM to remaining processes ... logd hostapd wpa_supplicant netifd odhcpd ntpd dnsmasq ubusd askfirst urngd
Mon Dec 7 13:25:34 UTC 2020 upgrade: Sending KILL to remaining processes ...
Mon Dec 7 13:25:35 UTC 2020 upgrade: Switching to ramdisk...
Mon Dec 7 13:25:38 UTC 2020 upgrade: Performing system upgrade...
Appending jffs2 data from /tmp/sysupgrade.tgz to firmware..
Mon Dec 7 13:26:21 UTC 2020 upgrade: Upgrade completed
Mon Dec 7 13:26:22 UTC 2020 upgrade: Rebooting system...
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
[ 175.677595] reboot: Restarting system
[ 8.611437] mount_root: no usable overlay filesystem found, using tmpfs overlay
[ 117.356605] overlayfs: upper fs does not support tmpfile.
Maybe one of these workarounds could be applied for while/if there is no fix for the 4K blocksize problem:
Make soft_config read-only on all the devices, and unset CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
Tweak mount_root so that it can find the sysupgrade settings
Each ones comes at a price. With the first one, soft_config will not be modifiable from the userspace. With the second one, writing to SPI will remain very slow although, most likely, this should only be noticeable when sysupgrading, I guess not for single-file editions.
Any ideas on how to implement the second idea, if even possible?
Tweak mount_root so that it can find the sysupgrade settings
Any ideas on how to implement the second idea, if even possible?
I can answer myself: //using "BLOCKSIZE = 4k" instead of the default 64k when generating the image//. Either on each device entry, or for all the //mikrotik_nor//-type devices. In common-mikrotik.mk:
johnth:
Test device: ath79 mikrotik wap-g on snapshot r15165-66d12ce667
Reproduce
without CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
#3094 (comment)
#3037 (comment)
target/linux/generic/pending-5.4/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch stopped functioning with linux 4.19
Now all partitions have a 4K erase block if CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
This causes mount_root to fail to find upgrade settings where the image is expecting 64K blocksize.
grep --binary-files=text -E 'overlay|upgrade|reboot|mount' ath79_mikrotik_wap-g_sysupgrade_loses_settings [ 8.892059] mount_root: switching to jffs2 overlay [ 8.899647] overlayfs: upper fs does not support tmpfile. Mon Dec 7 13:25:31 UTC 2020 upgrade: Sending TERM to remaining processes ... logd hostapd wpa_supplicant netifd odhcpd ntpd dnsmasq ubusd askfirst urngd Mon Dec 7 13:25:34 UTC 2020 upgrade: Sending KILL to remaining processes ... Mon Dec 7 13:25:35 UTC 2020 upgrade: Switching to ramdisk... Mon Dec 7 13:25:38 UTC 2020 upgrade: Performing system upgrade... Appending jffs2 data from /tmp/sysupgrade.tgz to firmware.. Mon Dec 7 13:26:21 UTC 2020 upgrade: Upgrade completed Mon Dec 7 13:26:22 UTC 2020 upgrade: Rebooting system... umount: can't unmount /dev: Resource busy umount: can't unmount /tmp: Resource busy [ 175.677595] reboot: Restarting system [ 8.611437] mount_root: no usable overlay filesystem found, using tmpfs overlay [ 117.356605] overlayfs: upper fs does not support tmpfile.
./package/base-files/files/lib/preinit/80_mount_root:do_mount_root() {
do_mount_root() { mount_root boot_run_hook preinit_mount_root [ -f /sysupgrade.tgz ] && { echo "- config restore -" cp /etc/passwd /etc/group /etc/shadow /tmp cd / tar xzf /sysupgrade.tgz missing_lines /tmp/passwd /etc/passwd >> /etc/passwd missing_lines /tmp/group /etc/group >> /etc/group missing_lines /tmp/shadow /etc/shadow >> /etc/shadow rm /tmp/passwd /tmp/group /tmp/shadow # Prevent configuration corruption on a power loss sync } }
https://git.openwrt.org/?p=project/fstools.git;a=blob;f=mount_root.c;
61 case FS_NONE:
62 ULOG_WARN("no usable overlay filesystem found, using tmpfs overlay\n");
63 return ramoverlay();
The text was updated successfully, but these errors were encountered: