public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use initmpfs even if there's root= cmdline
@ 2013-12-12  9:25 Dave Young
  2013-12-12 11:49 ` Dave Young
  2013-12-13  2:38 ` Dave Young
  0 siblings, 2 replies; 7+ messages in thread
From: Dave Young @ 2013-12-12  9:25 UTC (permalink / raw)
  To: akpm, rob, gregkh, grant.likely, sebastian.capella, linux-kernel


Current code use ramfs instead of tmpfs for stub when root= defined.

But for real use case with initramfs, usually there's like cmdline like
root=UUID=$UUID the root dev is the real device. For that case we have
no way to use initmpfs, thus this patch removes the limitation so tmpfs
can benefit more people.

The logic become:
if CONFIG_TMPFS && rootfstype is not ramfs
    use tmpfs
else
    use ramfs

Signed-off-by: Dave Young <dyoung@redhat.com>
---
 init/do_mounts.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/init/do_mounts.c b/init/do_mounts.c
index 8e5addc..6fde471 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -622,8 +622,8 @@ int __init init_rootfs(void)
 	if (err)
 		return err;
 
-	if (IS_ENABLED(CONFIG_TMPFS) && !saved_root_name[0] &&
-		(!root_fs_names || strstr(root_fs_names, "tmpfs"))) {
+	if (IS_ENABLED(CONFIG_TMPFS) &&
+		(root_fs_names && !(strstr(root_fs_names, "ramfs")))) {
 		err = shmem_init();
 		is_tmpfs = true;
 	} else {


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

end of thread, other threads:[~2013-12-23  6:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12  9:25 [PATCH] use initmpfs even if there's root= cmdline Dave Young
2013-12-12 11:49 ` Dave Young
2013-12-13  2:38 ` Dave Young
2013-12-18 17:51   ` Rob Landley
2013-12-19  2:35     ` Dave Young
2013-12-23  4:49       ` Rob Landley
2013-12-23  6:43         ` Dave Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox