base-files: upgrade: fix initramfs detection
authorRobert Marko <robimarko@gmail.com>
Sun, 20 Dec 2020 17:02:53 +0000 (18:02 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Sun, 20 Dec 2020 17:14:56 +0000 (17:14 +0000)
Commit "initramfs: switch to tmpfs to fix ujail" switched initramfs to
now use tmpfs, it causes $(rootfs_type) to now return tmpfs when
running initramfs image instead of being empty.

This broke initramfs detection which prevents config files from
being saved as it does not work from initramfs.

So, lets test for $(rootfs_type) returning "tmpfs" instead.

Fixes: 7fd3c68 ("initramfs: switch to tmpfs to fix ujail)
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/base-files/Makefile
package/base-files/files/sbin/sysupgrade

index fbcb6945920183656961db30b039f7c381d3cd2c..fb1267ea5b37ee973289a625b2edb7cba3759010 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=240
+PKG_RELEASE:=241
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
index ca2eb298dccdb8053d0b69e7068691027005b976..3300d8e1ea559c5e2e696876c5f500a89c4f97e7 100755 (executable)
@@ -216,7 +216,7 @@ include /lib/upgrade
 do_save_conffiles() {
        local conf_tar="$1"
 
-       [ -z "$(rootfs_type)" ] && {
+       [ "$(rootfs_type)" = "tmpfs" ] && {
                echo "Cannot save config while running from ramdisk." >&2
                ask_bool 0 "Abort" && exit
                rm -f "$conf_tar"