[PATCH 1/3] init: fall back on mounting raw root

From: Alex Xu (Hello71)
Date: Mon Dec 07 2020 - 13:50:09 EST


9p/virtio, virtiofs, and others can be mounted with no block device or
userspace helpers.

Signed-off-by: Alex Xu (Hello71) <alex_y_xu@xxxxxxxx>
---
init/do_mounts.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index b5f9604d0c98..8aa38ec0bfec 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -568,7 +568,7 @@ void __init mount_root(void)
}
#endif
#ifdef CONFIG_BLOCK
- {
+ if (ROOT_DEV != 0) {
int err = create_dev("/dev/root", ROOT_DEV);

if (err < 0)
@@ -576,6 +576,7 @@ void __init mount_root(void)
mount_block_root("/dev/root", root_mountflags);
}
#endif
+ mount_block_root(saved_root_name, root_mountflags);
}

/*
--
2.29.2