From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (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 0F4CA13C695 for ; Sat, 13 Sep 2025 00:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757725184; cv=none; b=QpucUdzGnpAcN/iQ/yGBA/2y7seXDMUsruEWSzwDfnd6jdX+aA/wAqmGwmABF7UuRtwQ5YfuZSa40ziRjXPhvSLgf7gtuTvP7y6R0BqJyP9OzkyXCz/rRz8T1WW4wNpYa6egdnsnR1S/ROTqSJlugFWVTy72zK1U++E9jw0vFAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757725184; c=relaxed/simple; bh=96PHKpKkduNWBMWlLUmXlhnRkmSl0kWQr4vXMbTyP8M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lK9Ypd3P+3AsZJBQpRg7xjDEzQ96fFkSalEScJ9AUVf0h8NkoNJQ9/uWVFDb+hFg3S2WZe0XIS15dW9pDWtqIewHgQxNQZ9eEiCtRsiM4OjAXu3IEpxrjyLaNzMbXLLwf/BdmNvM66Vzl105kGJ9nw5ryVprRrf8fhOTutGlT/8= 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.43 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-f43.google.com with SMTP id a640c23a62f3a-b07e081d852so68051166b.2 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=m0KEY0wZUpGDE4gRkuEm+qXx6zeaa3ISeVCSzJjF5nDNjU9Elqc9tQfJeWhGNifFZF CvbS57FU9ySpfJPkbQYYOqUrbdq4na62/KpG2BtZAapcoHnzTaGkvZOsuMtOBB3Ois0e WjaKgSSTqsynI2PNdyO4vMB7TqCWTFcC57hlYcAzM0Bf6F3wyqhCBA4nBekfugeLmF8W gLT2yhlaAYZDOLu+ngvsygjhK39tcYgrYNybrSJpXWbV510kXPLj4qzUhj8IyMCE0WgQ JeHsy2z3SgweIN5yLAfD2AJkdAQxWKFySR6OGx7kol4Z5qQ04GQtgKkCQp6GdRUnyfJ3 elEw== X-Forwarded-Encrypted: i=1; AJvYcCVN4M1eEksN7sklfCdellYVwMjLCHJ90xitgoY3bEoB7hMQycH1J3ZWQmw6y77CnZc/cQT6LNo1zXs=@vger.kernel.org X-Gm-Message-State: AOJu0YwkMpLDXcyvojPoFOeKqcQZtEeyeDOcGj6T3G0YdLDyByD9wZTG wOswpRNtxt9E1stl3aZS7QiTo9CsplRfkTDXZ+8sH0CVdWDiofEI6BPJ X-Gm-Gg: ASbGncs2boJeZ4g4/k5Gm6ld6nkmYzoPpfI3xHEw2sePWLjKipA6tNoFjR8o9Sm3sRx FpMzsEO6S5l1grPsi5ClpYuKZmU2NtrY8e8qUAo/J2E/dTNIyBx9om8ru/U5mtqKpgqauNs6lCK lJRWTUNhCIDIuFSQJo2NOLHRxmKF0IW3CtmYu2uvOkVM1rOZVKIAwmts2PhO3cgC3Jvtn2VxXhQ lZh9q7QDIFVQ6Bec4IyWwbENH1wmi2q/z87mSeUtpSLkng8RAZizDaHlWPa4hrR7UjT5tjaCKuv zeyBtAZtnLKeGyGpYoejloo55DJn6zKQEG33YzvpbY/9zgJ38MEzx/UN15qsOkvSkasspB2sgT4 6y+Yv+OWykyb/ZMX+Udk= 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-api@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_support.rst b/Documentation/driver-api/early-userspace/early_userspace_support.rst 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/listinfo/klibc How does it work? ================= -The kernel has currently 3 ways to mount the root filesystem: +The kernel has currently 2 ways to mount the root filesystem: 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_namespace() to mount the final root filesystem, based on the root= option and optional init= 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_init(). -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 stored 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 binary is responsible to do all the things prepare_namespace() would do. 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 mount the final root and exec one of the predefined init binaries. Bryan O'Sullivan -- 2.47.2