From nobody Thu Oct 2 19:01:33 2025 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 137631494DB for ; Sat, 13 Sep 2025 00:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757725185; cv=none; b=YkPzhtkJRvuM51M5lVPuFRmt7JI09x9w8y5vD5uRDduo7+LGx/kFrhAW4l7S2u3WSw7F+gzwQyRh0lwDYKMAL0EnJt5mKvehQkui7JJKF8LAF9t8FIVrzkMoRhVjVoOUIFQfg1nVjIG89wc4+A7M/FQ2ToGUZIgC2JyFtaR4BFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757725185; c=relaxed/simple; bh=96PHKpKkduNWBMWlLUmXlhnRkmSl0kWQr4vXMbTyP8M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t9A7bwCCK9207h4IRO8sfo8X1bqepkldQcoAzM/ZXslTmMYbjs540HtZnzoNQbWc/FvgUpBFRmS9+cuhYyuzL9P1p4tmIBEwkLZ2eTMrlC8+zrQ/8GBkNbVZNr6OGlIqLCYx/X74pb0WZ5cMWGowVXdwkiah1ndX5cON3xR5ifw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ci0pMqa8; arc=none smtp.client-ip=209.85.218.53 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.b="ci0pMqa8" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b046fc9f359so374954966b.0 for ; Fri, 12 Sep 2025 17:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757725180; x=1758329980; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6fWPoN959WwxjoYegCw0rDaXLTHmPmQJSliJ+OqkRJY=; b=ci0pMqa8PcrROKjXJdT069LT+w8CTpISWITlbfW/qtYcYwN/E9/DcLWNr/TpFiq3Ad QGOTKU53qwruWOiJs5/ZIzTaYZOVhAin6txhF3hPH2+OOlejQh98VgHulezohlcdDX2m cVt2AZhT8uGbv4Nec92z8dbeQO4pbNjpEB22pjBywRVyKIrHmXfsYMflIYY46yePUVU6 zdaw3mLA+fJrXUrEodmWoWb+jz/WCuthgKwyfcLoSI4ydp/v7D+ibgsafGt0CUUX2ZqN rS12SoggmKIRUIi+KHUDdtLvHiabq8s8eQgov8mHArCKjQL5NIxrYkQXHjJscrZKeMwI odwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757725180; x=1758329980; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6fWPoN959WwxjoYegCw0rDaXLTHmPmQJSliJ+OqkRJY=; b=G/WK1qb0HOaE4PopsyKaLKyc1NNPCr4uw+Vot/FIpnBfbbawW7pATxPnRq/GfqFxp+ bpAa3MXWwjRN8GD9KK0PJu8i+DrQS/uKM3Li/Ym2ggcIA0rmt8/gmz7slZuKGbUb4X5H t0st1h5/A79904R05tOs4gFTQLD4174MTV+AWzDiAsqw2Hs9FN7BVyMs7jxAarIhx9o2 mHaqea9bBspl3V3IxFv+AFefMSqk46yP4ykjJf0JIurFPo9K0FTqK9X2JBE8s9+GiXGT zEPlbWpoQxhYJYroySISW071IqR4b7jZ6guQ/ItmcpR6HZcVgNpahtKMg4z1hPfEF37D 4BGg== X-Forwarded-Encrypted: i=1; AJvYcCXFK6hjN7Kmh9ui3OdbTroqzjxgxGFH7ozDYC81vVJXMy4m9bbYhHNJ9mLqzq/scsPek6FfD21loSGwOHQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwGQ2HA3Ee1t+/JfZvZaGIhm4IFif6V/TLSvKSnLAsIIvg04JqL SOjK95swRXBrwztjOsRkqkpVlRFK/Aw4E1c9wNSVlFGuhvlSQkFmAAMS X-Gm-Gg: ASbGncunDCos+rgelMEUPd7iK2m5p2vWkfgjig7Vw62ta94vNJ6wqGVP6sBit3GRKQx 3NrOgGHHCBGRsXqBZ4RKuuT9oSsXhvf/4ZTFiQ0FF0gxQOC+8g0UOidijdpe9UVNwOQbcFBzdww 1/bD3mRh/bWODiR63ngjpg4ZIM/MC2gsFMRu4+u1ylqr4xhg6WaNG7D1M/TIliRMZlwElc1Yzbd +k5lNcZd2K9NF5ZpQnyNBPvzLQnd1ON/2fMxyPaoUDlyj3tCveBmvwUeQycH1JItEaX2FzkaMce hZanYX+V9RpaIaCg7x+dBd7fK7dufkghDZ+QI/Wnl9Wth9La1/ZxUgwEhoBVF5Cysor5Rh1cQMA g6xCb4RA+uZysKnW6IbU= X-Google-Smtp-Source: AGHT+IGLvsatTRrbnodGqisgzpCsfnT+5kjCyZkQGsCYdRKthq/XXLBOPdic+fyhUVGMnj7YztyCUg== X-Received: by 2002:a17:907:3f1a:b0:b04:ae7c:703e with SMTP id a640c23a62f3a-b07c35bca5fmr458205966b.24.1757725180390; Fri, 12 Sep 2025 17:59:40 -0700 (PDT) Received: from localhost ([212.73.77.104]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-b07b3347a2dsm471368266b.98.2025.09.12.17.59.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Sep 2025 17:59:39 -0700 (PDT) From: Askar Safin To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Torvalds , Greg Kroah-Hartman , Christian Brauner , Al Viro , Jan Kara , Christoph Hellwig , Jens Axboe , Andy Shevchenko , Aleksa Sarai , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Julian Stecklina , Gao Xiang , Art Nikpal , Andrew Morton , Eric Curtin , Alexander Graf , Rob Landley , Lennart Poettering , 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 , 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" , linux-acpi@vger.kernel.org, Michal Simek , devicetree@vger.kernel.org, Luis Chamberlain , Kees Cook , Thorsten Blum , Heiko Carstens , patches@lists.linux.dev Subject: [PATCH RESEND 18/62] doc: modernize Documentation/driver-api/early-userspace/early_userspace_support.rst Date: Sat, 13 Sep 2025 00:37:57 +0000 Message-ID: <20250913003842.41944-19-safinaskar@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250913003842.41944-1-safinaskar@gmail.com> References: <20250913003842.41944-1-safinaskar@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Update it to reflect initrd removal Signed-off-by: Askar Safin --- .../early_userspace_support.rst | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Documentation/driver-api/early-userspace/early_userspace_suppo= rt.rst b/Documentation/driver-api/early-userspace/early_userspace_support.r= st index 61bdeac1bae5..0ca923c1007b 100644 --- a/Documentation/driver-api/early-userspace/early_userspace_support.rst +++ b/Documentation/driver-api/early-userspace/early_userspace_support.rst @@ -127,28 +127,22 @@ mailing list at https://www.zytor.com/mailman/listinf= o/klibc How does it work? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -The kernel has currently 3 ways to mount the root filesystem: +The kernel has currently 2 ways to mount the root filesystem: =20 a) all required device and filesystem drivers compiled into the kernel, no - initrd. init/main.c:init() will call prepare_namespace() to mount the + initramfs. init/main.c:kernel_init_freeable() will call prepare_namesp= ace() to mount the final root filesystem, based on the root=3D option and optional init=3D= to run - some other init binary than listed at the end of init/main.c:init(). + some other init binary than listed at the end of init/main.c:kernel_ini= t(). =20 -b) some device and filesystem drivers built as modules and stored in an - initrd. The initrd must contain a binary '/linuxrc' which is supposed = to - load these driver modules. It is also possible to mount the final root - filesystem via linuxrc and use the pivot_root syscall. The initrd is - mounted and executed via prepare_namespace(). - -c) using initramfs. The call to prepare_namespace() must be skipped. +b) using initramfs. The call to prepare_namespace() must be skipped. This means that a binary must do all the work. Said binary can be stor= ed into initramfs either via modifying usr/gen_init_cpio.c or via the new - initrd format, an cpio archive. It must be called "/init". This binary + initramfs format, an cpio archive. It must be called "/init". This bi= nary is responsible to do all the things prepare_namespace() would do. =20 To maintain backwards compatibility, the /init binary will only run if = it comes via an initramfs cpio archive. If this is not the case, - init/main.c:init() will run prepare_namespace() to mount the final root + init/main.c:kernel_init_freeable() will run prepare_namespace() to moun= t the final root and exec one of the predefined init binaries. =20 Bryan O'Sullivan --=20 2.47.2