initramfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Landley <rob@landley.net>
To: Askar Safin <safinaskar@gmail.com>, stefanb@linux.ibm.com
Cc: gregkh@linuxfoundation.org, initramfs@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	zohar@linux.ibm.com
Subject: Re: [PATCH v3] rootfs: Fix support for rootfstype= when root= is given
Date: Thu, 21 Dec 2023 03:30:37 -0600	[thread overview]
Message-ID: <d4b227de-d609-aef2-888b-203dbcf06707@landley.net> (raw)
In-Reply-To: <CAPnZJGDcNwPLbzC99qNQ+bRMwxPU-Z0xe=TD6DWQU=0MNyeftA@mail.gmail.com>

On 12/19/23 20:19, Askar Safin wrote:
> On Sun, Nov 19, 2023 at 08:12:48PM -0500, Stefan Berger wrote:
>> Documentation/filesystems/ramfs-rootfs-initramfs.rst states:
>>
>>   If CONFIG_TMPFS is enabled, rootfs will use tmpfs instead of ramfs by
>>   default.  To force ramfs, add "rootfstype=ramfs" to the kernel command
>>   line.

I wrote that around 2005.

>> This currently does not work when root= is provided since then
>> saved_root_name contains a string and rootfstype= is ignored.

I wrote the code to populate a tmpfs from initramfs in 2013 (8 years later),
because nobody else had bothered to, and I've had a patch to fix the rootfstype=
issue for years, but I long ago lost my touch with linux-kernel proctology:

https://lkml.iu.edu/hypermail/linux/kernel/2302.2/05601.html

Last I heard it was going upstream via somebody else (who tripled the size of
the fix for no obvious reason, but that's modern linux-kernel for you), but I
lost track after the guy who'd said to send it to him instead did multiple
automated bounces from a bot that said "to save this one special guy's time,
we're going to spam linux-kernel with autogenerated content delivered to tens of
thousands of plebian mailboxes":

https://lkml.iu.edu/hypermail/linux/kernel/2311.1/05544.html
https://lkml.iu.edu/hypermail/linux/kernel/2311.1/06448.html

Last I saw the rewrite of the fix had been resubmitted to the Special Guy a
fourth time:

https://lkml.iu.edu/hypermail/linux/kernel/2311.2/02938.html

Maybe it'll show up in a git pull someday? Who knows...

> Therefore,
>> ramfs is currently always chosen when root= is provided.
> 
> Maybe it is a good idea to just fully remove ramfs?

"Let's delete a 20 year old filesystem that's been built into every system that
whole time, this can't POSSIBLY have any side effects."

We've already discussed this, more than once:

https://lkml.iu.edu/hypermail/linux/kernel/2311.0/00435.html

Can you build tmpfs on a nommu system? Last I checked the plumbing expects swap,
but it's been a while...

> initramfs will
> always be tmpfs. And tmpfs will always be enabled.
> 
> As well as I understand, ramfs was originally introduced, because
> tmpfs seemed too big.

No, ramfs came first, tmpfs was created later. Not just what initramfs uses, but
the order in which the filesystems were written.

I believe modern ramfs more or less dates to Al Viro factoring out "libfs":

https://lwn.net/Articles/57369/

Although the memory grows a bit hazy. (I vaguely remember what happened, but
exactly when it was, and what came before what... git log in my unified history
tree is showing fs/ramfs originating from 2.3.99pre4 in 2000 but it may be
confused by a rename. I remember somebody, I thought Linus, saying that ramfs
was an example user of the libfs code...)

> Here are my configs (x86_64). Just enough to run busybox in "qemu -serial stdio"

Back when I maintained busybox there were people in that space who cared about
14k, and that's not measuring runtime overhead.

There was a lovely ELC talk in 2015 about booting Linux in 256 kilobytes of SRAM
(everything else being XIP out of ROM-alikes), but alas the entire year's videos
got wiped by the Linux Foundation. The PDF is still online though:

https://elinux.org/images/9/90/Linux_for_Microcontrollers-_From_Marginal_to_Mainstream.pdf

Alas, XIP got replaced with DAX which I've never managed to get to work...

Rob

  reply	other threads:[~2023-12-21  9:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-20  2:19 [PATCH v3] rootfs: Fix support for rootfstype= when root= is given Askar Safin
2023-12-21  9:30 ` Rob Landley [this message]
2023-12-21 22:58   ` Askar Safin
2023-12-29 16:39     ` Stefan Berger
2023-12-29 18:35       ` Rob Landley
2023-12-29 19:14         ` Stefan Berger
2023-12-30 17:08           ` Rob Landley
2023-12-31  0:46             ` Askar Safin
2024-01-01 17:48               ` Rob Landley
2024-01-03  6:18                 ` Askar Safin
2023-12-31 16:03             ` Stefan Berger
2024-01-01  1:15               ` Askar Safin
2024-01-01 18:50               ` Rob Landley
2024-01-02 13:03                 ` Stefan Berger
2024-01-04  6:06             ` Askar Safin
2024-01-04 16:38               ` Rob Landley
2023-12-30  2:10         ` Askar Safin
  -- strict thread matches above, loose matches on Subject: below --
2023-11-20  1:12 Stefan Berger
2023-11-28  9:54 ` Greg KH
2023-11-28 12:18   ` Mimi Zohar

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=d4b227de-d609-aef2-888b-203dbcf06707@landley.net \
    --to=rob@landley.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=initramfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=safinaskar@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=stefanb@linux.ibm.com \
    --cc=zohar@linux.ibm.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 read-only IMAP folder(s) and NNTP newsgroup(s).