From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (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 1635914B977 for ; Sat, 13 Sep 2025 00:59:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757725185; cv=none; b=U0ti52tubic3OzjnSLnDhpOEYQR2VsBIVYwvdIbmdg0febTD7HtPbK1sQGEK8KurVFcvvSQ68l30aWQ6wQRwZahJdvhCuOzZXp5NS3p/TR1pTtBD2+3cXmNHTaN44l7zHD1K/xsU/sZIhSEczq5FiemY65PahV+o5jINU2XCA70= 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=ihUDCM40; arc=none smtp.client-ip=209.85.218.46 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="ihUDCM40" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-b046fc9f359so374956166b.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=lists.linux.dev; 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=ihUDCM40LDVx4GeLFp8XgdnJDIRbUsMxnZ07jWTvowKdf+yvc6NplKmUTgBTXyU5Hy CkW0FMAOqOzp0L/VhTuxJG4D1z5t09e9Fk+/CI6g57X/D0HJQkNMnW4xeza+WqrnXCG+ zNKgAXJXCtp/uhbFN3pBAOnzwfBehOgLsnWLf1vyWsWsISskCw+mb3nYYXOgriHveZoS mIJs8I2jKD8RLcHd6LrD3aqdm3lb/7YgGY4olEysc6PUrUqxYqxmOxtKq9OQmxI7sFO6 ch1YUXUNlwtoOQW7ZBCzM6e0fhXw1CHaTe+YjD/uh2899WaYUdeRR0MtvL+QUAQPGZjw RMgQ== 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=PIrwwcvKzvxGY4XNvEwxzz/zm+ZEPB0pksOQScyupghUphSMkGdAXMd/yrkKAnIBRx dtPdEtjhJr6D6nm7bOApxyb4YrAmTzCUJNdDFN3E1gyjpG8bwgfks0RFXzJbrZ6iQSnb jaXHG9eM5QZ3XMxShDtzYB9E2G+wEpUZKGZhmsYXCw0NSOrRJDnPdQyYeBqMAQAUe/LE BC7ySd0xsCNjKPjD/+YOI2CJyWXV7m3jBsFbwFnEH0zw0hk5fUkkDa6+d+r5lOZqbBs6 J4wwaJXAVm8NXO5II5CnSanKOnhV2kc29z2FoN/pakI8Nwm3LcWgg12GjvqhfH/yR9Ws Yq1w== X-Forwarded-Encrypted: i=1; AJvYcCWeoFZTq+7D7g9FWdhdWAj7fBj02hF69BBzft4DjBFjTAhrS/9hDOfs3RAyVANl7q98atQ8fOg8@lists.linux.dev X-Gm-Message-State: AOJu0YwmnrkdFazfeIPZOnW20re7dV92aVKzjbDQsVoOLIDVvo+9k2ZU W8teUkFh5YKiQfsuIqKcP2J9Y+D3Eq9PEvEs4y6SoOn4XWnk8NdFLgtc X-Gm-Gg: ASbGncv/flWLPw4suZoozfTOOBNjP/jg8ZY3kUQGGOvklIvrmggNzZDiOLablRcUNBt Rm0G+gp2k+Ehuby8fxNoZuypfva2pw39yJlZLRLZKU12OSQOr46UsRkB5O4HfgLHor5U+OA8gdN X1U4kVqF0ssiSj6CO6s9DdyFsGgS5ZsdrrnfiF7lI6lo2wi+zIXdyW0zR46pVL8lRlKn7/dnTT/ hb5kx9GF3r314ri4hOcUN9GtqRmLeL9I7KXgHhK+OPqRoUx+DMTluOaTDIFhFFiyBY0jQM6NwGS yqk6t6OIwU8Gnq39aa4babmx+xNxuHCawQxPTLBCg9iEAK7wCz8FBm9Jp5Emu+zkvH7859IluDw Wc4DRjpt9OAEA9ToEfy0= 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: patches@lists.linux.dev 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