[PATCH fstools RFC] mount_root: use RAM overlay if "rootfs_data" is missing

Rafał Miłecki zajec5 at gmail.com
Thu Oct 28 07:55:40 PDT 2021


From: Rafał Miłecki <rafal at milecki.pl>

This results in at least bootable system if something goes wrong and
"rootfs_data" isn't available.

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
I noticed this problem on my UBI based system without "rootfs_data".
This allows me to at least access my device.

Can this break any setups?
---
 mount_root.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mount_root.c b/mount_root.c
index dffb0a6..df65c89 100644
--- a/mount_root.c
+++ b/mount_root.c
@@ -58,6 +58,10 @@ start(int argc, char *argv[1])
 	/* There isn't extroot, so just try to mount "rootfs_data" */
 	volume_init(data);
 	switch (volume_identify(data)) {
+	default:
+		ULOG_ERR("failed to find / identify \"rootfs_data\" volume\n");
+		/* fall-through */
+
 	case FS_NONE:
 		ULOG_WARN("no usable overlay filesystem found, using tmpfs overlay\n");
 		return ramoverlay();
-- 
2.31.1




More information about the openwrt-devel mailing list