linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] init: fall back on mounting raw root
       [not found] <20201207184835.63538-1-alex_y_xu.ref@yahoo.ca>
@ 2020-12-07 18:48 ` Alex Xu (Hello71)
  2020-12-07 18:48   ` [PATCH 2/3] init: remove special-case for mtd/ubi Alex Xu (Hello71)
  2020-12-07 18:48   ` [PATCH 3/3] init: remove root_device_name Alex Xu (Hello71)
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Xu (Hello71) @ 2020-12-07 18:48 UTC (permalink / raw)
  To: Alex Xu (Hello71),
	Dominik Brodowski, Song Liu, Theodore Ts'o, Jens Axboe,
	linux-kernel

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

Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/3] init: remove special-case for mtd/ubi
  2020-12-07 18:48 ` [PATCH 1/3] init: fall back on mounting raw root Alex Xu (Hello71)
@ 2020-12-07 18:48   ` Alex Xu (Hello71)
  2020-12-07 18:48   ` [PATCH 3/3] init: remove root_device_name Alex Xu (Hello71)
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Xu (Hello71) @ 2020-12-07 18:48 UTC (permalink / raw)
  To: Alex Xu (Hello71),
	Dominik Brodowski, Song Liu, Theodore Ts'o, Jens Axboe,
	linux-kernel

This should be handled by the fallback after trying to resolve it.

Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
---
 init/do_mounts.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 8aa38ec0bfec..a2a273b9866f 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -603,11 +603,6 @@ void __init prepare_namespace(void)
 
 	if (saved_root_name[0]) {
 		root_device_name = saved_root_name;
-		if (!strncmp(root_device_name, "mtd", 3) ||
-		    !strncmp(root_device_name, "ubi", 3)) {
-			mount_block_root(root_device_name, root_mountflags);
-			goto out;
-		}
 		ROOT_DEV = name_to_dev_t(root_device_name);
 		if (strncmp(root_device_name, "/dev/", 5) == 0)
 			root_device_name += 5;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 3/3] init: remove root_device_name
  2020-12-07 18:48 ` [PATCH 1/3] init: fall back on mounting raw root Alex Xu (Hello71)
  2020-12-07 18:48   ` [PATCH 2/3] init: remove special-case for mtd/ubi Alex Xu (Hello71)
@ 2020-12-07 18:48   ` Alex Xu (Hello71)
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Xu (Hello71) @ 2020-12-07 18:48 UTC (permalink / raw)
  To: Alex Xu (Hello71),
	Dominik Brodowski, Song Liu, Theodore Ts'o, Jens Axboe,
	linux-kernel

root_device_name has gone through many iterations, but is now solely
used for removing a /dev/ prefix off root= parameter. It's time for it
to be removed.

Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
---
 init/do_mounts.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index a2a273b9866f..544614279281 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -29,7 +29,6 @@
 #include "do_mounts.h"
 
 int root_mountflags = MS_RDONLY | MS_SILENT;
-static char * __initdata root_device_name;
 static char __initdata saved_root_name[64];
 static int root_wait;
 
@@ -449,7 +448,7 @@ void __init mount_block_root(char *name, int flags)
 		 * and give them a list of the available devices
 		 */
 		printk("VFS: Cannot open root device \"%s\" or %s: error %d\n",
-				root_device_name, b, err);
+				saved_root_name, b, err);
 		printk("Please append a correct \"root=\" boot option; here are the available partitions:\n");
 
 		printk_all_partitions();
@@ -602,10 +601,7 @@ void __init prepare_namespace(void)
 	md_run_setup();
 
 	if (saved_root_name[0]) {
-		root_device_name = saved_root_name;
-		ROOT_DEV = name_to_dev_t(root_device_name);
-		if (strncmp(root_device_name, "/dev/", 5) == 0)
-			root_device_name += 5;
+		ROOT_DEV = name_to_dev_t(saved_root_name);
 	}
 
 	if (initrd_load())
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-07 18:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201207184835.63538-1-alex_y_xu.ref@yahoo.ca>
2020-12-07 18:48 ` [PATCH 1/3] init: fall back on mounting raw root Alex Xu (Hello71)
2020-12-07 18:48   ` [PATCH 2/3] init: remove special-case for mtd/ubi Alex Xu (Hello71)
2020-12-07 18:48   ` [PATCH 3/3] init: remove root_device_name Alex Xu (Hello71)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).