mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] docs: initrd: remove the linuxrc and root change mechanism
@ 2026-11-29  1:41 Nikolai Dokutovich
  0 siblings, 0 replies; only message in thread
From: Nikolai Dokutovich @ 2026-11-29  1:41 UTC (permalink / raw)
  To: Jonathan Corbet
  Cc: Randy Dunlap, Shuah Khan, linux-doc, linux-kernel, Nikolai Dokutovich

initrd.rst still tells users to ship /linuxrc and to write the root
device number to /proc/sys/kernel/real-root-dev.  Both are gone: the
linuxrc code path was removed together with handle_initrd() and
change_root(), and the sysctl as well, but this document was not
updated.

Drop the change_root step from the boot description, replace the two
sections that document the mechanism, and drop the "older mechanism"
wording from the boot parameter description.

Fixes: c350a65b566b ("initrd: remove deprecated code path (linuxrc)")
Fixes: e6ce36ccc86f ("init: remove /proc/sys/kernel/real-root-dev")
Signed-off-by: Nikolai Dokutovich <ndokutovich@gmail.com>
---
 Documentation/admin-guide/initrd.rst | 63 +++++-----------------------
 1 file changed, 11 insertions(+), 52 deletions(-)

diff --git a/Documentation/admin-guide/initrd.rst b/Documentation/admin-guide/initrd.rst
index 6c1660a4c5cc..e4b52a64ff5d 100644
--- a/Documentation/admin-guide/initrd.rst
+++ b/Documentation/admin-guide/initrd.rst
@@ -27,9 +27,8 @@ When using initrd, the system typically boots as follows:
   1) the boot loader loads the kernel and the initial RAM disk
   2) the kernel converts initrd into a "normal" RAM disk and
      frees the memory used by initrd
-  3) if the root device is not ``/dev/ram0``, the old (deprecated)
-     change_root procedure is followed. see the "Obsolete root change
-     mechanism" section below.
+  3) if the root device is not ``/dev/ram0``, the initrd image is not
+     used as the root file system.
   4) root device is mounted. if it is ``/dev/ram0``, the initrd image is
      then mounted as root
   5) /sbin/init is executed (this can be any valid executable, including
@@ -176,8 +175,7 @@ can try the experimental newlib environment [#f2]_ to create a small
 initrd.
 
 Finally, you have to boot the kernel and load initrd. Almost all Linux
-boot loaders support initrd. Since the boot process is still compatible
-with an older mechanism, the following boot command line parameters
+boot loaders support initrd. The following boot command line parameters
 have to be given::
 
   root=/dev/ram0 rw
@@ -322,54 +320,15 @@ from the CD-ROM, and loading the RAM disk from CD without need of
 floppies.
 
 
-Obsolete root change mechanism
-------------------------------
+Removed root change mechanism
+-----------------------------
 
-The following mechanism was used before the introduction of pivot_root.
-Current kernels still support it, but you should _not_ rely on its
-continued availability.
-
-It works by mounting the "real" root device (i.e. the one set with rdev
-in the kernel image or with root=... at the boot command line) as the
-root file system when linuxrc exits. The initrd file system is then
-unmounted, or, if it is still busy, moved to a directory ``/initrd``, if
-such a directory exists on the new root file system.
-
-In order to use this mechanism, you do not have to specify the boot
-command options root, init, or rw. (If specified, they will affect
-the real root file system, not the initrd environment.)
-
-If /proc is mounted, the "real" root device can be changed from within
-linuxrc by writing the number of the new root FS device to the special
-file /proc/sys/kernel/real-root-dev, e.g.::
-
-  # echo 0x301 >/proc/sys/kernel/real-root-dev
-
-Note that the mechanism is incompatible with NFS and similar file
-systems.
-
-This old, deprecated mechanism is commonly called ``change_root``, while
-the new, supported mechanism is called ``pivot_root``.
-
-
-Mixed change_root and pivot_root mechanism
-------------------------------------------
-
-In case you did not want to use ``root=/dev/ram0`` to trigger the pivot_root
-mechanism, you may create both ``/linuxrc`` and ``/sbin/init`` in your initrd
-image.
-
-``/linuxrc`` would contain only the following::
-
-	#! /bin/sh
-	mount -n -t proc proc /proc
-	echo 0x0100 >/proc/sys/kernel/real-root-dev
-	umount -n /proc
-
-Once linuxrc exited, the kernel would mount again your initrd as root,
-this time executing ``/sbin/init``. Again, it would be the duty of this init
-to build the right environment (maybe using the ``root= device`` passed on
-the cmdline) before the final execution of the real ``/sbin/init``.
+The ``linuxrc`` mechanism and the ``/proc/sys/kernel/real-root-dev``
+sysctl it used to change the "real" root device were removed.  The
+kernel no longer invokes ``/linuxrc`` as a special initrd stage and
+no longer performs the old handoff from the initrd to the final root
+file system; an initrd is mounted as the root file system only when
+the kernel is told to mount it as such.
 
 
 Resources
-- 
2.43.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-29  1:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-29  1:41 [PATCH] docs: initrd: remove the linuxrc and root change mechanism Nikolai Dokutovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®