From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795916474; b=e1PPhlH07hYabQ6zuHXVWxIv2o/YJyJPqNKtFwLCDgPJHj17mgyUlGqOGp6JZYkbF6gy ot9e5Qh1TmXbknBHdHUKVgeilIqL/S+ARQMYrQ/cor0H2gGZG5yT34Z1aZQqAiR92yOxa 0VHg7Adcs+vaKstOf5369RnypNjSszWQQAOPaCV7sTCKQj9SnWNf2eOOqGtgiMjZYdchp 6qZAYQkIa2mubeINPLZDcOH2sOM41Bh+RCxtTdE7TFEG2K2/QFiHYPCkE9wyIZ/MYh16r R5BVmop545bLSalLH6I6rjRHAWz2ka/MYouJij9bhq9RdbXc09AS6axOR4jY8WvBbyg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795916474; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=E6drDDhgOAU5vDcYe6aG857KUhD97rXkW89i+WtrGfU=; b=xAHrRhke/QENx27GR9YLLYGeMjGifGsBStPwywNCNWj88wXHB5cmtmNYhRPXwKxUUmey gdAAJKjbdXStK2LuZbPyV/p2DDS3OtLjnCaFjOWIGvV9GpFTqkISuOr6272ogMCpC9K6B GZa29HF1g/jzPajYFpqnMC3wbBXoq/tMRhrvzFDdy+je8fddJMtrJXYIkpdvN5KsPQbOb rKSmBTLfL/e8I9WV2i2BC8YH5JJIC4Xov/ukfX/bKLxsDg+huXXXGt6E4pMZI0ZWggpRx rInqsnXcDuj2ahhkyUYVx75lYavU8e3uYZpSXUx92w9iB4TrS6qGSGtcZFIPhwRa7HQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=eOpkwV94; arc=none smtp.remote-ip=209.85.160.178 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5965606A331 for ; Sun, 29 Nov 2026 01:41:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C5965606A331 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=eOpkwV94 Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-55dc111ae86so25411001cf.1 for ; Sat, 28 Nov 2026 17:41:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795916473; x=1796521273; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=E6drDDhgOAU5vDcYe6aG857KUhD97rXkW89i+WtrGfU=; b=eOpkwV9471JgL2Vc510J2XWM8H1LVv5wfin8PMqCWSw+/BvHuqC6TaTGPYVxjmlwVg P2xgsRdRhlnhCLKidQAVbid6o6q79XZQFbPXlhqj28xPrh2hBHPR+lMgQFWrYX++eTn3 GU2NYM9mj9SxtvXidrBztibVZQx4zQ+TSit6UYKBLI18dEkB9DBh7dRz3hKxXiI7QKN8 mVFjCh/aGmjbRk6CroF7l2bbj3jyMvLLonZH8Q9GEBOl9Ncx46xYEvnVOawagfHB+Plh DEJVEHhXgZlYeh6WWGvJAunZzXGfBe35Qkqi85HsBVIN9Q/i9PcIRbWadHe/O8N/hQld KCmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795916473; x=1796521273; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=E6drDDhgOAU5vDcYe6aG857KUhD97rXkW89i+WtrGfU=; b=XYsjiitqmdcZogmESwQTJjyiB1z9S4Bn7pFdGH3KQHW+6BW6LSoCKeOo6J59EE6RZ6 yJ7IstggFmnuPEH1XXUWPeQ6LF7fNOSWzqH1g8rMuCIUNLfZpyA8MtIfg+hBZt8GQ173 L7ng5zfhwee9FF3a82uyQsV3ZoLg8AwtUzgqPwO3dM/BJEKJ2EFlZEdMv4zFEdKQtRzZ J9B37bfbJIQsOsSNnwVEvmf6QScJgd3e2aHi9bZOwb7Ms/0g0sAi2W2E0KEL9HGWje2n AYpX0Cm2U7D7vRDanjigjUPWuaNFy4YhKKM7N1llwvQjQmpYXD4tTpcGcFBchW6L0oE4 IWIA== X-Forwarded-Encrypted: i=1; AL+hErEHZIfQnfuRFD4M1sNIzIMguEYC5zb942EbzT6u/uA/E1zxHqmKE23NvQu6LY1062Bz3P38N7/9sTQ=@vger.kernel.org X-Gm-Message-State: APuU4Z8vBLPhqIEnBtcUNtijDcmYSf1vOqm75lup2+TMPF7hQPQtY/HT aBhgDpbsSSZGtgHv+8OilsB0NWFkQmfZZVlQMn07keCKixmP0Piy3Rzf X-Gm-Gg: AZFdTZf1T3kd48ykIt+oxT8EL5FPEyXyFovRFop7j8BNEFws06z51XC92mXvWrSPIpo RDpI9pwNkRLJff2IS7rQdzg0qfk3+J8R/gc6WiKuizNEua3QvZEzjLux9yQvltsHBxrEaWNtCB0 VNAtrB3JFHAeIvZwF7/KjCqlym8eAgw1LYtErVHSLr3E3JmiyKY44yywqYYyf+7O24fFZspC6Af GHQ3DLwyZ2K9w+zrl459dC3IfXKph9U8PA/nW1XlN9G42V8Csrw8HNl798vQxxm5mBaOWkbAOiT 67pyD+Kpe0bs8NdaWdfHcm14YA/1LAN8L0ir1E9bGKtwzOS8jai76M6zuTVn0Lknf1lxgrsi2SY jNusnfseyrH4l5b0nlMzGc+RoSBv47wkB/c12AKEOFTeaL2UhenbcBRq33NYp2E/E8QcDRQzRhT W4JYPBrT9GI+TxsjFv/M6VrdXLW/4b1ofViLVkmAJfKs0QP5apef4GlyyLVgxM5yYQgEXFm0rqK ONhxbTlSnCXNoeXDksBXpTwaluMu4DRA71i6veOrHQd0+MUp47a1zkGQ2fgZ2rI2qyDFJp5a67m wDlctFyAOJZ9ctNWYqmFllbVcbJ1+e8khu1+IwGa9mQeYgk2T0UfMr378VA7ThfajmPPv+s0C0y Fws332GlzMZ5o8up8fcpXf32Ddw== X-Received: by 2002:a05:622a:1a93:b0:55d:1944:a2b9 with SMTP id d75a77b69052e-55d76a5b308mr576632971cf.51.1795916472591; Sat, 28 Nov 2026 17:41:12 -0800 (PST) Received: from localhost ([138.197.109.108]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-55d7c654585sm239149771cf.5.2026.11.28.17.41.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 17:41:12 -0800 (PST) From: Nikolai Dokutovich To: Jonathan Corbet Cc: Randy Dunlap , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Nikolai Dokutovich Subject: [PATCH] docs: initrd: remove the linuxrc and root change mechanism Date: Sun, 29 Nov 2026 04:41:09 +0300 Message-ID: <20261129014109.57308-1-ndokutovich@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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