summaryrefslogtreecommitdiff
path: root/Documentation/admin-guide
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-11-25 10:40:50 +0100
committerChristian Brauner <brauner@kernel.org>2026-01-12 17:22:27 +0100
commitef12d0573a7f5e7a495e81d773ae5f3e98230cd4 (patch)
tree2c8593faa049918b777df5be40a560ffaa053b2d /Documentation/admin-guide
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff)
parente6ce36ccc86f6d447808a6e620f56d440d74aa19 (diff)
Merge patch series "initrd: remove half of classic initrd support"
Askar Safin <safinaskar@gmail.com> says: This patchset will not affect anyone, who showed up in these lists. See [5] for details. Intro ==== This patchset removes half of classic initrd (initial RAM disk) support, i. e. linuxrc code path, which was deprecated in 2020. Initramfs still stays, RAM disk itself (brd) still stays. And other half of initrd stays, too. init/do_mounts* are listed in VFS entry in MAINTAINERS, so I think this patchset should go through VFS tree. I tested the patchset on 8 (!!!) archs in Qemu (see details below). If you still use initrd, see below for workaround. In 2020 deprecation notice was put to linuxrc initrd code path. In v1 I tried to remove initrd fully, but Nicolas Schichan reported that he still uses other code path (root=/dev/ram0 one) on million devices [4]. root=/dev/ram0 code path did not contain deprecation notice. So, in this version of patchset I remove deprecated code path, i. e. linuxrc one, while keeping other, i. e. root=/dev/ram0 one. Also I put deprecation notice to remaining code path, i. e. to root=/dev/ram0 one. I plan to send patches for full removal of initrd after one year, i. e. in January 2027 (of course, initramfs will still work). Also, I tried to make this patchset small to make sure it can be reverted easily. I plan to send cleanups later. Details ==== Other user-visible changes: - Removed kernel command line parameters "load_ramdisk" and "prompt_ramdisk", which did nothing and were deprecated - Removed /proc/sys/kernel/real-root-dev . It was used for initrd only - Command line parameters "noinitrd" and "ramdisk_start=" are deprecated Testing ==== I tested my patchset on many architectures in Qemu using my Rust program, heavily based on mkroot [1]. I used the following cross-compilers: aarch64-linux-musleabi armv4l-linux-musleabihf armv5l-linux-musleabihf armv7l-linux-musleabihf i486-linux-musl i686-linux-musl mips-linux-musl mips64-linux-musl mipsel-linux-musl powerpc-linux-musl powerpc64-linux-musl powerpc64le-linux-musl riscv32-linux-musl riscv64-linux-musl s390x-linux-musl sh4-linux-musl sh4eb-linux-musl x86_64-linux-musl taken from this directory [2]. So, as you can see, there are 18 triplets, which correspond to 8 subdirs in arch/. For every triplet I tested that: - Initramfs still works (both builtin and external) - Direct boot from disk still works - Remaining initrd code path (root=/dev/ram0) still works Workaround ==== If "retain_initrd" is passed to kernel, then initramfs/initrd, passed by bootloader, is retained and becomes available after boot as read-only magic file /sys/firmware/initrd [3]. No copies are involved. I. e. /sys/firmware/initrd is simply a reference to original blob passed by bootloader. This works even if initrd/initramfs is not recognized by kernel in any way, i. e. even if it is not valid cpio archive, nor a fs image supported by classic initrd. This works both with my patchset and without it. This means that you can emulate classic initrd so: link builtin initramfs to kernel; in /init in this initramfs copy /sys/firmware/initrd to some file in / and loop-mount it. This is even better than classic initrd, because: - You can use fs not supported by classic initrd, for example erofs - One copy is involved (from /sys/firmware/initrd to some file in /) as opposed to two when using classic initrd Still, I don't recommend using this workaround, because I want everyone to migrate to proper modern initramfs. But still you can use this workaround if you want. Also: it is not possible to directly loop-mount /sys/firmware/initrd . Theoretically kernel can be changed to allow this (and/or to make it writable), but I think nobody needs this. And I don't want to implement this. On Qemu's -initrd and GRUB's initrd ==== Don't panic, this patchset doesn't remove initramfs (which is used by nearly all Linux distros). And I don't have plans to remove it. Qemu's -initrd option and GRUB's initrd command refer to initrd bootloader mechanism, which is used to load both initrd and (external) initramfs. So, if you use Qemu's -initrd or GRUB's initrd, then you likely use them to pass initramfs, and thus you are safe. v1: https://lore.kernel.org/lkml/20250913003842.41944-1-safinaskar@gmail.com/ v1 -> v2 changes: - A lot. I removed most patches, see cover letter for details v2: https://lore.kernel.org/lkml/20251010094047.3111495-1-safinaskar@gmail.com/ v2 -> v3 changes: - Commit messages - Expanded docs for "noinitrd" - Added link to /sys/firmware/initrd workaround to pr_warn v3: https://lore.kernel.org/lkml/20251017060956.1151347-1-safinaskar@gmail.com/ v3 -> v4 changes: - Changed "September 2026" to "January 2027" (i. e. after 2026 LTS release) [1] https://github.com/landley/toybox/tree/master/mkroot [2] https://landley.net/toybox/downloads/binaries/toolchains/latest [3] https://lore.kernel.org/all/20231207235654.16622-1-graf@amazon.com/ [4] https://lore.kernel.org/lkml/20250918152830.438554-1-nschichan@freebox.fr/ [5] https://lore.kernel.org/lkml/20251022082604.25437-1-safinaskar@gmail.com/ * patches from https://patch.msgid.link/20251119222407.3333257-1-safinaskar@gmail.com: init: remove /proc/sys/kernel/real-root-dev initrd: remove deprecated code path (linuxrc) init: remove deprecated "load_ramdisk" and "prompt_ramdisk" command line parameters Link: https://patch.msgid.link/20251119222407.3333257-1-safinaskar@gmail.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'Documentation/admin-guide')
-rw-r--r--Documentation/admin-guide/kernel-parameters.txt12
-rw-r--r--Documentation/admin-guide/sysctl/kernel.rst6
2 files changed, 5 insertions, 13 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index a8d0afde7f85..f67591615a6a 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3437,8 +3437,6 @@ Kernel parameters
If there are multiple matching configurations changing
the same attribute, the last one is used.
- load_ramdisk= [RAM] [Deprecated]
-
lockd.nlm_grace_period=P [NFS] Assign grace period.
Format: <integer>
@@ -4444,8 +4442,10 @@ Kernel parameters
Note that this argument takes precedence over
the CONFIG_RCU_NOCB_CPU_DEFAULT_ALL option.
- noinitrd [RAM] Tells the kernel not to load any configured
- initial RAM disk.
+ noinitrd [Deprecated,RAM] Tells the kernel not to load any configured
+ initial RAM disk. Currently this parameter applies to
+ initrd only, not to initramfs. But it applies to both
+ in EFI mode.
nointremap [X86-64,Intel-IOMMU,EARLY] Do not enable interrupt
remapping.
@@ -5402,8 +5402,6 @@ Kernel parameters
Param: <number> - step/bucket size as a power of 2 for
statistical time based profiling.
- prompt_ramdisk= [RAM] [Deprecated]
-
prot_virt= [S390] enable hosting protected virtual machines
isolated from the hypervisor (if hardware supports
that). If enabled, the default kernel base address
@@ -5460,7 +5458,7 @@ Kernel parameters
ramdisk_size= [RAM] Sizes of RAM disks in kilobytes
See Documentation/admin-guide/blockdev/ramdisk.rst.
- ramdisk_start= [RAM] RAM disk image start address
+ ramdisk_start= [Deprecated,RAM] RAM disk image start address
random.trust_cpu=off
[KNL,EARLY] Disable trusting the use of the CPU's
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
index 239da22c4e28..bb577fac76a0 100644
--- a/Documentation/admin-guide/sysctl/kernel.rst
+++ b/Documentation/admin-guide/sysctl/kernel.rst
@@ -1235,12 +1235,6 @@ that support this feature.
== ===========================================================================
-real-root-dev
-=============
-
-See Documentation/admin-guide/initrd.rst.
-
-
reboot-cmd (SPARC only)
=======================