From: Rob Landley <rob@landley.net>
To: Askar Safin <safinaskar@gmail.com>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Christian Brauner" <brauner@kernel.org>,
"Al Viro" <viro@zeniv.linux.org.uk>, "Jan Kara" <jack@suse.cz>,
"Christoph Hellwig" <hch@lst.de>, "Jens Axboe" <axboe@kernel.dk>,
"Andy Shevchenko" <andy.shevchenko@gmail.com>,
"Aleksa Sarai" <cyphar@cyphar.com>,
"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>,
"Julian Stecklina" <julian.stecklina@cyberus-technology.de>,
"Gao Xiang" <hsiangkao@linux.alibaba.com>,
"Art Nikpal" <email2tema@gmail.com>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Eric Curtin" <ecurtin@redhat.com>,
"Alexander Graf" <graf@amazon.com>,
"Lennart Poettering" <mzxreary@0pointer.de>,
linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org,
linux-snps-arc@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org,
linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev,
linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org,
linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org,
linux-s390@vger.kernel.org, linux-sh@vger.kernel.org,
sparclinux@vger.kernel.org, linux-um@lists.infradead.org,
x86@kernel.org, "Ingo Molnar" <mingo@redhat.com>,
linux-block@vger.kernel.org, initramfs@vger.kernel.org,
linux-api@vger.kernel.org, linux-doc@vger.kernel.org,
linux-efi@vger.kernel.org, linux-ext4@vger.kernel.org,
"Theodore Y . Ts'o" <tytso@mit.edu>,
linux-acpi@vger.kernel.org, "Michal Simek" <monstr@monstr.eu>,
devicetree@vger.kernel.org,
"Luis Chamberlain" <mcgrof@kernel.org>,
"Kees Cook" <kees@kernel.org>,
"Thorsten Blum" <thorsten.blum@linux.dev>,
"Heiko Carstens" <hca@linux.ibm.com>,
patches@lists.linux.dev
Subject: Re: [PATCH RESEND 17/62] doc: modernize Documentation/filesystems/ramfs-rootfs-initramfs.rst
Date: Mon, 15 Sep 2025 16:05:14 -0500 [thread overview]
Message-ID: <8f595eec-e85e-4c1f-acb0-5069a01c1012@landley.net> (raw)
In-Reply-To: <20250913003842.41944-18-safinaskar@gmail.com>
On 9/12/25 19:37, Askar Safin wrote:
> Update it to reflect initrd removal.
>
> Also I specified that error reports should
> go to linux-doc@vger.kernel.org , because
> Rob Landley said that he keeps getting
> reports about this document and is unable
> to fix them
Do you think emailing a list I could forward stuff to will improve matters?
I find the community an elaborate bureaucracy unresponsive to hobbyists.
Documentation/process/submitting-patches.rst being a 934 line document
with a bibliography, plus a 24 step checklist not counting the a) b) c)
subsections are just symptoms. The real problem is following those is
not sufficient to navigate said bureaucracy.
> What is ramfs?
> --------------
>
> @@ -101,9 +103,9 @@ archive is extracted into it, the kernel will fall through to the older code
> to locate and mount a root partition, then exec some variant of /sbin/init
> out of that.
>
> -All this differs from the old initrd in several ways:
> +All this differs from the old initrd (removed in 2025) in several ways:
Why keep the section when you removed the old mechanism? You took away
their choices, you don't need to sell them on it.
(Unless you're trying to sell them on using a current linux kernel
rather than 2.6 or bsd or qnx or something. But if they _do_ remove 32
bit support, or stick a rust dependency in the base build, I suspect
that ship has sailed...)
> - - The old initrd was always a separate file, while the initramfs archive is
> + - The old initrd was always a separate file, while the initramfs archive can be
> linked into the linux kernel image. (The directory ``linux-*/usr`` is
> devoted to generating this archive during the build.)
>
> @@ -137,7 +139,7 @@ Populating initramfs:
>
> The 2.6 kernel build process always creates a gzipped cpio format initramfs
> archive and links it into the resulting kernel binary. By default, this
> -archive is empty (consuming 134 bytes on x86).
> +archive is nearly empty (consuming 134 bytes on x86).
Those two lines you just touched contradict each other.
For historical reference, commit c33df4eaaf41 in 2007 added a second
codepath to special case NOT having an initramfs, for some reason.
That's how static linked cpio in the kernel image and external initrd=
loaded cpio from the bootloader wound up having different behavior.
The init/noinitramfs.c file does init/mkdir("/dev") and
init_mknod("/dev/console") because calling the syscall_blah() functions
directly was considered icky so they created gratuitous wrappers to do
it for you instead, because that's cleaner somehow. (Presumably the same
logic as C++ having get and set methods that perform a simple assignment
and return a value. Because YOU can't be trusted to touch MY code.)
Note that ONLY init/noinitramfs.c creates /dev/console. You'd THINK the
logical thing to do would be to detect failure of the filp_open() in
console_on_rootfs() and do the mkdir/mknod there and retry (since that's
__init code too), but no...
My VERY vague recollection from back in the dark ages is if you didn't
specify any INITRAMFS_SOURCE in kconfig then gen_init_cpio got called
with no arguments and spit out a "usage" section that got interpreted as
scripts/gen_initramfs_list.sh output, back when the plumbing ignored
lines it didn't understand but there was an "example: a simple
initramfs" section in the usage with "dir /dev" and "nod /dev/console"
lines that created a cpio archive with /dev/console in it which would
get statically linked in as a "default", and code reached out and used
this because it was there without understanding WHY it was there. So it
initially worked by coincidence, and rather than make it explicit they
went "two codepaths, half the testing!" and thus...
Anyway, that's why the 130+ byte archive was there. It wasn't actually
empty, even when initramfs was disabled.
One of the "cleanups that didn't actually fix it" was
https://github.com/mpe/linux-fullhistory/commit/2bd3a997befc if you want
to dig into the history yourself. I wrote my docs in 2005 and that was
2010 so "somewhere in there"...
> -If the kernel has initrd support enabled, an external cpio.gz archive can also
> -be passed into a 2.6 kernel in place of an initrd. In this case, the kernel
> -will autodetect the type (initramfs, not initrd) and extract the external cpio
> +If the kernel has CONFIG_BLK_DEV_INITRD enabled, an external cpio.gz archive can also
You renamed that symbol, then even you use the old name here.
> +be passed into a 2.6 kernel. In this case, the kernel will extract the external cpio
> archive into rootfs before trying to run /init.
>
> -This has the memory efficiency advantages of initramfs (no ramdisk block
> -device) but the separate packaging of initrd (which is nice if you have
> +This is nice if you have
> non-GPL code you'd like to run from initramfs, without conflating it with
> -the GPL licensed Linux kernel binary).
> +the GPL licensed Linux kernel binary.
IANAL: Whether or not this qualifies as "mere aggregation" had yet to go
to court last I heard.
Which is basically why
https://hackmd.io/@starnight/Load_Firmware_Files_Later_in_Linux_Kernel
was so screwed up in the first place: the logical thing to do would be
put the firmware in a static initramfs and have the module
initialization happen after initramfs was populated... BUT LICENSING! We
must have a much more complicated implementation because license. I
believe I suggested passing said initramfs in via the initrd mechanism
so it remains a separate file until boot time, and was ignored. *shrug*
The usual...
> It can also be used to supplement the kernel's built-in initramfs image. The
> files in the external archive will overwrite any conflicting files in
> @@ -278,7 +278,7 @@ User Mode Linux, like so::
> EOF
> gcc -static hello.c -o init
> echo init | cpio -o -H newc | gzip > test.cpio.gz
> - # Testing external initramfs using the initrd loading mechanism.
> + # Testing external initramfs.
Does grub not still call it "initrd"?
> qemu -kernel /boot/vmlinuz -initrd test.cpio.gz /dev/zero
A) they added -hda so you don't have to give it a dummy /dev/zero anymore.
B) there's no longer a "qemu" defaulting to the current architecture,
you have to explicitly specify qemu-system-blah unless you create the
symlink yourself by hand. This was considered an "improvement" by IBM
bureaucrats. (Not a regression, a "feature". Oh well...)
C) to be honest I'd just point people at mkroot for examples these days,
but I'm biased. (It smells like me.)
Rob
next prev parent reply other threads:[~2025-09-15 21:16 UTC|newest]
Thread overview: 103+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-13 0:37 [PATCH RESEND 00/62] initrd: remove classic initrd support Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 01/62] init: remove deprecated "load_ramdisk" command line parameter, which does nothing Askar Safin
2025-09-15 11:17 ` Christophe Leroy
2025-09-13 0:37 ` [PATCH RESEND 02/62] init: remove deprecated "prompt_ramdisk" " Askar Safin
2025-09-15 11:16 ` Christophe Leroy
2025-10-10 3:17 ` Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 03/62] init: sh, sparc, x86: remove unused constants RAMDISK_PROMPT_FLAG and RAMDISK_LOAD_FLAG Askar Safin
2025-09-15 11:19 ` Christophe Leroy
2025-09-13 0:37 ` [PATCH RESEND 04/62] init: x86, arm, sh, sparc: remove variable rd_image_start, which controls starting block number of initrd Askar Safin
2025-09-15 11:43 ` Christophe Leroy
2025-09-13 0:37 ` [PATCH RESEND 05/62] init: remove "ramdisk_start" command line parameter, " Askar Safin
2025-09-15 11:48 ` Christophe Leroy
2025-09-13 0:37 ` [PATCH RESEND 06/62] arm: init: remove special logic for setting brd.rd_size Askar Safin
2025-09-15 11:53 ` Christophe Leroy
2025-09-15 11:57 ` Christophe Leroy
2025-09-13 0:37 ` [PATCH RESEND 07/62] arm: init: remove ATAG_RAMDISK Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 08/62] arm: init: remove FLAG_RDLOAD and FLAG_RDPROMPT Askar Safin
2025-09-15 11:54 ` Christophe Leroy
2025-09-13 0:37 ` [PATCH RESEND 09/62] arm: init: document rd_start (in param_struct) as obsolete Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 10/62] initrd: remove initrd (initial RAM disk) support Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 11/62] init, efi: remove "noinitrd" command line parameter Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 12/62] init: remove /proc/sys/kernel/real-root-dev Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 13/62] ext2: remove ext2_image_size and associated code Askar Safin
2025-09-15 9:19 ` Jan Kara
2025-09-13 0:37 ` [PATCH RESEND 14/62] init: m68k, mips, powerpc, s390, sh: remove Root_RAM0 Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 15/62] doc: modernize Documentation/admin-guide/blockdev/ramdisk.rst Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 16/62] brd: remove "ramdisk_size" command line parameter Askar Safin
2025-09-15 11:48 ` Christophe Leroy
2025-09-13 0:37 ` [PATCH RESEND 17/62] doc: modernize Documentation/filesystems/ramfs-rootfs-initramfs.rst Askar Safin
2025-09-15 21:05 ` Rob Landley [this message]
2025-09-13 0:37 ` [PATCH RESEND 18/62] doc: modernize Documentation/driver-api/early-userspace/early_userspace_support.rst Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 19/62] init: remove mentions of "ramdisk=" command line parameter Askar Safin
2025-09-13 0:37 ` [PATCH RESEND 20/62] doc: remove Documentation/power/swsusp-dmcrypt.rst Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 21/62] init: remove all mentions of root=/dev/ram* Askar Safin
2025-09-14 10:06 ` Krzysztof Kozlowski
2025-09-14 20:13 ` Andrew Morton
2025-09-15 4:41 ` Krzysztof Kozlowski
2025-10-10 2:48 ` Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 22/62] doc: remove obsolete mentions of pivot_root Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 23/62] init: rename __initramfs_{start,size} to __builtin_initramfs_{start,size} Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 24/62] init: remove wrong comment Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 25/62] init: rename phys_initrd_{start,size} to phys_external_initramfs_{start,size} Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 26/62] init: move phys_external_initramfs_{start,size} to init/initramfs.c Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 27/62] init: alpha: remove "extern unsigned long initrd_start, initrd_end" Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 28/62] init: alpha, arc, arm, arm64, csky, m68k, microblaze, mips, nios2, openrisc, parisc, powerpc, s390, sh, sparc, um, x86, xtensa: rename initrd_{start,end} to virt_external_initramfs_{start,end} Askar Safin
2025-09-13 5:48 ` Borislav Petkov
2025-09-13 5:59 ` Borislav Petkov
2025-10-09 11:19 ` Askar Safin
2025-09-16 3:09 ` Rob Herring
2025-10-10 4:07 ` Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 29/62] init: move virt_external_initramfs_{start,end} to init/initramfs.c Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 30/62] doc: remove documentation for block device 4 0 Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 31/62] init: rename initrd_below_start_ok to initramfs_below_start_ok Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 32/62] init: move initramfs_below_start_ok to init/initramfs.c Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 33/62] init: remove init/do_mounts_initrd.c Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 34/62] init: inline create_dev into the only caller Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 35/62] init: make mount_root_generic static Askar Safin
2025-09-13 0:38 ` [PATCH RESEND 36/62] init: make mount_root static Askar Safin
2025-09-13 8:58 ` [PATCH RESEND 00/62] initrd: remove classic initrd support Julian Stecklina
2025-09-14 3:43 ` [PATCH RESEND 37/62] init: remove root_mountflags from init/do_mounts.h Askar Safin
2025-09-14 3:50 ` [PATCH RESEND 38/62] init: remove most headers " Askar Safin
2025-09-14 3:51 ` [PATCH RESEND 39/62] init: make console_on_rootfs static Askar Safin
2025-09-14 3:51 ` [PATCH RESEND 40/62] init: rename free_initrd_mem to free_initramfs_mem Askar Safin
2025-09-14 3:52 ` [PATCH RESEND 41/62] init: rename reserve_initrd_mem to reserve_initramfs_mem Askar Safin
2025-09-14 3:52 ` [PATCH RESEND 42/62] init: rename <linux/initrd.h> to <linux/initramfs.h> Askar Safin
2025-09-14 3:53 ` [PATCH RESEND 43/62] setsid: inline ksys_setsid into the only caller Askar Safin
2025-09-14 3:54 ` [PATCH RESEND 44/62] doc: kernel-parameters: remove [RAM] from reserve_mem= Askar Safin
2025-09-14 3:54 ` [PATCH RESEND 45/62] doc: kernel-parameters: replace [RAM] with [INITRAMFS] Askar Safin
2025-09-14 3:55 ` [PATCH RESEND 46/62] init: edit docs for initramfs-related configs Askar Safin
2025-09-14 3:55 ` [PATCH RESEND 47/62] init: fix typo: virtul => virtual Askar Safin
2025-09-14 3:56 ` [PATCH RESEND 48/62] init: fix comment Askar Safin
2025-09-14 3:57 ` [PATCH RESEND 49/62] init: rename ramdisk_execute_command to initramfs_execute_command Askar Safin
2025-09-14 3:57 ` [PATCH RESEND 50/62] init: rename ramdisk_command_access to initramfs_command_access Askar Safin
2025-09-14 3:58 ` [PATCH RESEND 51/62] init: rename get_boot_config_from_initrd to get_boot_config_from_initramfs Askar Safin
2025-09-14 3:58 ` [PATCH RESEND 52/62] init: rename do_retain_initrd to retain_initramfs Askar Safin
2025-09-14 3:59 ` [PATCH RESEND 53/62] init: rename kexec_free_initrd to kexec_free_initramfs Askar Safin
2025-09-14 4:00 ` [PATCH RESEND 54/62] init: arm, x86: deal with some references to initrd Askar Safin
2025-09-14 4:00 ` [PATCH RESEND 55/62] init: rename CONFIG_BLK_DEV_INITRD to CONFIG_INITRAMFS Askar Safin
2025-09-14 4:01 ` [PATCH RESEND 56/62] init: rename CONFIG_RD_GZIP to CONFIG_INITRAMFS_DECOMPRESS_GZIP Askar Safin
2025-09-14 4:01 ` [PATCH RESEND 57/62] init: rename CONFIG_RD_BZIP2 to CONFIG_INITRAMFS_DECOMPRESS_BZIP2 Askar Safin
2025-09-14 4:02 ` [PATCH RESEND 58/62] init: rename CONFIG_RD_LZMA to CONFIG_INITRAMFS_DECOMPRESS_LZMA Askar Safin
2025-09-14 4:03 ` [PATCH RESEND 59/62] init: rename CONFIG_RD_XZ to CONFIG_INITRAMFS_DECOMPRESS_XZ Askar Safin
2025-09-14 4:03 ` [PATCH RESEND 60/62] init: rename CONFIG_RD_LZO to CONFIG_INITRAMFS_DECOMPRESS_LZO Askar Safin
2025-09-14 4:04 ` [PATCH RESEND 61/62] init: rename CONFIG_RD_LZ4 to CONFIG_INITRAMFS_DECOMPRESS_LZ4 Askar Safin
2025-09-14 4:04 ` [PATCH RESEND 62/62] init: rename CONFIG_RD_ZSTD to CONFIG_INITRAMFS_DECOMPRESS_ZSTD Askar Safin
2025-09-14 4:19 ` [PATCH RESEND 00/62] initrd: remove classic initrd support Askar Safin
2025-09-14 10:08 ` Krzysztof Kozlowski
2025-09-15 13:34 ` Christian Brauner
2025-09-16 1:04 ` Askar Safin
2025-09-16 17:08 ` Jessica Clarke
2025-10-10 4:09 ` Askar Safin
2025-09-18 15:28 ` Nicolas Schichan
2025-09-18 19:58 ` Askar Safin
2025-09-19 15:24 ` Nicolas Schichan
2025-09-20 3:54 ` Askar Safin
2025-09-22 14:28 ` Nicolas Schichan
2025-09-25 13:10 ` [PATCH-RFC] init: simplify initrd code (was Re: [PATCH RESEND 00/62] initrd: remove classic initrd support) nschichan
2025-09-29 9:13 ` David Disseldorp
2025-10-10 4:57 ` Askar Safin
2025-10-09 8:42 ` [PATCH RESEND 00/62] initrd: remove classic initrd support Askar Safin
2025-09-23 12:04 ` Christophe Leroy
2025-09-24 16:17 ` Alexander Patrakov
2025-09-24 19:20 ` Rob Landley
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=8f595eec-e85e-4c1f-acb0-5069a01c1012@landley.net \
--to=rob@landley.net \
--cc=akpm@linux-foundation.org \
--cc=andy.shevchenko@gmail.com \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=cyphar@cyphar.com \
--cc=devicetree@vger.kernel.org \
--cc=ecurtin@redhat.com \
--cc=email2tema@gmail.com \
--cc=graf@amazon.com \
--cc=gregkh@linuxfoundation.org \
--cc=hca@linux.ibm.com \
--cc=hch@lst.de \
--cc=hsiangkao@linux.alibaba.com \
--cc=initramfs@vger.kernel.org \
--cc=jack@suse.cz \
--cc=julian.stecklina@cyberus-technology.de \
--cc=kees@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-csky@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-hexagon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-openrisc@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-snps-arc@lists.infradead.org \
--cc=linux-um@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=loongarch@lists.linux.dev \
--cc=mcgrof@kernel.org \
--cc=mingo@redhat.com \
--cc=monstr@monstr.eu \
--cc=mzxreary@0pointer.de \
--cc=patches@lists.linux.dev \
--cc=safinaskar@gmail.com \
--cc=sparclinux@vger.kernel.org \
--cc=thomas.weissschuh@linutronix.de \
--cc=thorsten.blum@linux.dev \
--cc=torvalds@linux-foundation.org \
--cc=tytso@mit.edu \
--cc=viro@zeniv.linux.org.uk \
--cc=x86@kernel.org \
/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