lkml.org 
[lkml]   [2013]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] use initmpfs even if there's root= cmdline

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 {


\
 
 \ /
  Last update: 2013-12-12 10:41    [W:0.074 / U:3.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site