From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.160.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795916474; b=mefdyF9LFkNT2cOVzzgUQGaSGjS6ywlE+Lf5PgO6HOWZRF7f+b/3J9RpWKi3g86x31XF x48lrsRtgGhxpoVInVUhIS2aUtrBLURQaFzCFpcPI3/ny1nZQk6QxMqmgN/cPvrGm6A1i ZhC/izopXx+loJmc4T8zF9QqveP+5xiQ8q/p1RWlT0ap+zUyNgKJT9YCe37mny27TElty 0YtMyStt6a7TEWgJfsKKxJJBf23BhCJZ9vBhBSmKI/SDZ6lp3Q0QdxYetpNzSXe6J3o7l IPQfyFoeUDWZhw3X9wKU84bRPb+8M9TdXbQ/a9gN9xnpFJZAMhifVE4ko2gmoW31e8A== 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=e1LXPNJ+EXIGoL4Rn1FR/eI+LCb+4B4qY3f31N2jfJuQlxm6v1lIFVzPO7iiKo/1WVvH B16zV84OweCvg232AlrtPDJfPMtn333em+QC4k9BBjQZYrXESRu8n+b/g4uGmdtZR34oJ 50S8GImcc4gsXlq7B+/EIrFh+L2f8Y7IWpqiwJaD0ukAzNbTfQXvEX5oZF8cYIotWgWCj qvtOyDZYEy73BW5CRQL/d0KPmaQIdEJJ4jcK/NaroGx3blqCo6ZZDSvZZ1Ga4OxtSYIO8 4saRsAtVNXPxuOkV7sfKP/6jkt5aW0Fnd78jWhWAMkppVLUY727Mu4KD+jdyCB8/GVg== 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.180 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 B8DC5606A326 for ; Sun, 29 Nov 2026 01:41:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B8DC5606A326 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-f180.google.com with SMTP id d75a77b69052e-5363316fa0cso97125021cf.3 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=jwCYtsmKlpopfsvLEeFaV1g9U6RJ+5XulivcQgFsO1FXT4lPHhXoM4/f2LU52kcmh8 LXzikFqx2TSWuRleF2GDaMjrB6oThqo6Gjrtahy4NHCtYsy8vk7sv0gMtPX+HccD3FKS 0eihSkc2DUg5gUvMkNVG6mdjIkv2W4Q1DUjkApL6tQcLRcSyv2x0xwchCGmhGdBWovXc /qj4R+0I0sfDiTz9/byWcc+jEKLux6QWpEN6mVF8dCP1TSS6a8ehNc6i1LjGBzsxxMN2 9bnOn/FMiLJxzwEpuK6Y26FLOVc+kljhAovVIOzYt47BLfFnX/y/ZP2Mt3RMAXRkZuNv q4Jw== X-Forwarded-Encrypted: i=1; AL+hErGpGwhWVqijKf/7+k54zldB1NcyZafM0Qacm3g3LHxkP1/JZbue7lzv8XPdtaKdEtR4v0neWGpScqaifVY=@vger.kernel.org X-Gm-Message-State: APuU4Z/TzZd3QkvSJPVb4ZWDU6r2PPEfSogLFBKcWOCszFHhWuL+3Reo YakYDJ6RqLuQDnRgvnVyxLKgmdApKkrOUvM2HycJvZjuSKRnS9+cd+ARzwf6T7cn/y6Hnw== X-Gm-Gg: AZFdTZc8oDOGeXja/y+LARclTg6IfAHNpVqQHNWDM/dzM8dfYopDjx1VltyV9cLy1x0 5zjyKxhWtB93nqfFk7R36wvGTPhPPBeTtVajSmUVxv3hKcw84wWJtDqZMiOd/TvevVrhhy4Nb7E 9sf+SZ/iMeVwUjhGaXasb4lqA+SGK4BRN72K8FaZtOnQRyUiJUVsqOZ2JCWH1zg3mND9OCzSqgP wDLXbH0bNHSkvKyXQck38wDXcMA6aqbtN6SjMhmo4KLUeE84ZglzXkLGZKs2TMU+nS9l7pVoItQ ywsVJfbznIZiIAJ5kR2Onnqkm2UjstOIc9WBTDY1TE8R46oKFcgP/EuhJ/FP7LyIgqQAK14wj8+ bCFfPCrjNnpJHF3/wql6eA+veCEQXPS/tiETjCMHMq80Kout+yqc8heW83VNIRFSveQLcTX3x9g ywRqnpdRUfUSWVNQ4h/cY00SmvRmo33XFQ+fkmCFzhtHHWWyWLam8QgXtEcyRCDRrblj4O0t/N9 GbZh/Zd6khbXzyUE522LHWVuGmIJ5nfBJPDUo0rglCitw7okGXpRZNxRv0Iwj/ejwiqgx8OGQ4/ Z62liyPfPqpnNYdFE8rZG0N80dvaU7Ht7tlGBqRQOuU90/NAq0wG4E3QDWZTNRtuqLvxFOSz1zw gBNjaBPlWlAuZvUrsJfAGXMhhxA== 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-kernel@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