linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>
Subject: [PATCH 5/5] fix rootfstype=tmpfs
Date: Tue, 21 Feb 2023 15:04:15 -0600	[thread overview]
Message-ID: <8244c75f-445e-b15b-9dbf-266e7ca666e2@landley.net> (raw)
In-Reply-To: <b455394f-9faa-1f1a-f171-0b9d5e9ada35@landley.net>

Wire up rootfstype=tmpfs to force rootfs to be tmpfs even when you specify root=

Initramfs automatically uses tmpfs (if available) when you DON'T specify a
root= fallback root to mount over initramfs, but some people can't NOT do
that for some reason (old bootloaders), so let rootfstype=tmpfs override it.

My original code tried to do this 10 years ago but got the test wrong,
and nobody's corrected it since, so here you go...

Signed-off-by: Rob Landley <rob@landley.net>

See https://lkml.iu.edu/hypermail/linux/kernel/2207.3/06939.html
---
 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 811e94daf0a8..01d80fb828fd 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -665,7 +665,7 @@ struct file_system_type rootfs_fs_type = {
 
 void __init init_rootfs(void)
 {
-	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 ? !saved_root_name[0] :
+		!!strstr(root_fs_names, "tmpfs")))
 		is_tmpfs = true;
 }

  parent reply	other threads:[~2023-02-21 20:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 20:53 [PATCH 0/5] Patches used to build mkroot Rob Landley
2023-02-21 20:55 ` [PATCH 1/5] try generic compiler name "cc" before falling back to "gcc" Rob Landley
2023-02-23  5:31   ` Masahiro Yamada
2023-02-23 13:50     ` Rob Landley
2023-02-24  0:27       ` Masahiro Yamada
2023-02-21 20:56 ` [PATCH 2/5] X86-64 should not uniquely require a third ELF package to build Rob Landley
2023-02-21 23:12   ` Thomas Gleixner
2023-02-22 18:14     ` Rob Landley
2023-02-22 18:41       ` Thomas Gleixner
2023-02-21 20:57 ` [PATCH 3/5] Wire up CONFIG_DEVTMPFS_MOUNT to initramfs Rob Landley
2023-02-21 21:00 ` [PATCH 4/5] Replace timeconst.bc with mktimeconst.c Rob Landley
2023-02-21 23:53   ` Thomas Gleixner
2023-02-22 22:52     ` Rob Landley
2023-02-21 21:04 ` Rob Landley [this message]
2023-11-01 13:10   ` [PATCH 5/5] fix rootfstype=tmpfs Stefan Berger
2023-11-08 22:05     ` Stefan Berger
2023-11-09 16:42       ` Rob Landley
2023-11-09 16:46         ` Rob Landley
2023-11-09 16:55           ` Rob Landley
2023-02-23 20:35 ` [PATCH 0/5] Patches used to build mkroot Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8244c75f-445e-b15b-9dbf-266e7ca666e2@landley.net \
    --to=rob@landley.net \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).