From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qES9w-0004nU-Ao for mharc-grub-devel@gnu.org; Wed, 28 Jun 2023 06:12:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qES9u-0004mD-Pj for grub-devel@gnu.org; Wed, 28 Jun 2023 06:12:22 -0400 Received: from mail-vk1-xa32.google.com ([2607:f8b0:4864:20::a32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qES9s-0008Rl-UW for grub-devel@gnu.org; Wed, 28 Jun 2023 06:12:22 -0400 Received: by mail-vk1-xa32.google.com with SMTP id 71dfb90a1353d-471b1ba1a7dso2008205e0c.2 for ; Wed, 28 Jun 2023 03:12:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20221208.gappssmtp.com; s=20221208; t=1687947139; x=1690539139; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mC5gfrgBsqZ6Du/qjThwMKK9os8r2lPQ6EJUFO6v2GM=; b=cE+6ZTSEDuHUFEfQSWNg+Y56lxW/FGggE/RZxTmez5i6X7UkjfIpv5OETcU9cwJfoW tu59LTfd/wuLo/UCNguOzLW00/j1pHT8HvEaHEXrxpvVYF0IKRiiK3rdQLgU9Qhbzprr wM1vgkPu+TebXmlZcLzQS+QgTn9cVk+K4qnY8D0n6lDjUKB5n+nCVigNfm/EKathTS9u mnUYVjlvOhzLW6C+zVcQt4cAIugNDTbaH4ZmPLrpaRuCEzkia3NrXr3HHQ3HXTqZKb9T 70KD1JFb7dCHYN+s+BMLIfn3b+X2mtU4VA4iKl16OWM1iHfsNbmW2ACSDxmIGuAXIFjd NEmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687947139; x=1690539139; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=mC5gfrgBsqZ6Du/qjThwMKK9os8r2lPQ6EJUFO6v2GM=; b=EkcR+DDKaY2YvyAIdR110ukfiPkJx0G+RGRWMM+NYGVXR0xJOyeNm4DQYrDQT7zG6H t6tsfmYQTQffkwJseAety/wgNeYbs0b89PPYA8KLCpcXB90CuhmEDEV1oSp03t7XSx9m 8OB7K+SfaBOHofw7yOpaxiy957IhXlF68aQ6rxVvh2IQgpdOlBApqk03sv55z21Ny6ab xMloRipV4qPb7ukdQOiAY7MMhJARQuWq9BHrANSEOfMAlGiVwWLUAdo7U3gSeOwjZImZ a+y/OEI1GVPGvdGL0yT2Qmu/oBpxXpu2WTLrgBIkklsIWB+34wJpF+uB6nJq9rzav1oA Vsiw== X-Gm-Message-State: AC+VfDzfF0eqprmIA4CzxSdWQbx0bIte3uvzItzmDLKHgA1rbTnLMlWf HDaTdIpefubKX6ALYKiGB8pDLPGMJWyyQEkX1+9UDA== X-Google-Smtp-Source: ACHHUZ51cnhOJut6e2IpSN717GDfeSbU17qEI7GGOZAxIZo8Rh8ux0uHNc8Ib+J7bzpPZCw4dbzNAw== X-Received: by 2002:a1f:434b:0:b0:46e:72c6:3369 with SMTP id q72-20020a1f434b000000b0046e72c63369mr16621394vka.11.1687947139400; Wed, 28 Jun 2023 03:12:19 -0700 (PDT) Received: from localhost.localdomain ([37.218.244.249]) by smtp.gmail.com with ESMTPSA id g200-20020a1f9dd1000000b0047cdf4481f4sm1304940vke.26.2023.06.28.03.12.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 03:12:18 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Oskari Pirhonen , Glenn Washburn Subject: [PATCH] docs: Improve initrd documentation Date: Wed, 28 Jun 2023 05:12:04 -0500 Message-Id: <20230628101204.570808-1-development@efficientek.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::a32; envelope-from=development@efficientek.com; helo=mail-vk1-xa32.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jun 2023 10:12:23 -0000 Remove reference to "initial ramdisk" and replace with "initrd". This then covers the case of ramdisk and ramfs, which is the usual method with kernels 2.6 and greater. Add sentence with URL to initrd documentation Linux kernel. Also, add a section documenting how to have the initrd command generate a new-style initrd via a specially crafted argument and include an example. Update initrd16 to refer to the initrd section and make note that initrd16 is only on the pc platform. Signed-off-by: Glenn Washburn --- docs/grub.texi | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index b39b72230c6f..bea86669191b 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -4076,10 +4076,43 @@ load a defective boot loader, such as SCO UnixWare 7.1. @subsection initrd @deffn Command initrd file [file @dots{}] -Load, in order, all initial ramdisks for a Linux kernel image, and set -the appropriate parameters in the Linux setup area in memory. This may only -be used after the @command{linux} command (@pxref{linux}) has been run. See -also @ref{GNU/Linux}. +Load, in order, all initrds for a Linux kernel image, and set the +appropriate parameters in the Linux setup area in memory. This may only +be used after the @command{linux} command (@pxref{linux}) has been run. +See @ref{GNU/Linux} for more info on booting GNU/Linux. For more +information on initrds see the GNU/Linux kernel +@uref{https://docs.kernel.org/filesystems/ramfs-rootfs-initramfs.html, +documentation} on them. + +A new-style initrd (for kernels greater than 2.6) containing one file +with leading path components can also be generated at run time. This +can be done by prefixing an argument with @code{newc:} followed by the +path of the file in the new initrd, a @code{:}, and then the GRUB file +path to the file data to be be included. + +For example: +@example +initrd newc:/etc/ssh/config:(hd0,2)/home/user/.ssh/config \ + newc:/etc/ssh/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key \ + /boot/initrd.gz \ + newc:/init:/home/user/init.fixed +@end example + +This command will generate two new-style initrds on the fly. The first +contains the path @samp{/etc/ssh/config} with the contents of +@samp{(hd0,2)/home/user/.ssh/config} and the path +@samp{/etc/ssh/ssh_host_rsa_key} with the contents of +@samp{/etc/ssh/ssh_host_rsa_key} on the @var{root} device. Parent directory +paths will automatically be generated as needed. This first generated initrd +will then have @samp{/boot/initrd.gz} concatenated after it. Next, another +new-style archive will be generated with the contents of @samp{/home/user/init.fixed} +in the path @samp{/init} and appended to the previous concatenation. Finally, +the result will be sent to the kernel when booted. + +Keep in mind that paths that comes later will take precendence. So in the +example above, the generated path @samp{/init} will overwrite any @samp{/init} +in @samp{/boot/initrd.gz}. This can be useful when changing the main initrd +is undesirable or difficult. @end deffn @@ -4090,9 +4123,10 @@ also @ref{GNU/Linux}. Load, in order, all initial ramdisks for a Linux kernel image to be booted in 16-bit mode, and set the appropriate parameters in the Linux setup area in memory. This may only be used after the @command{linux16} command -(@pxref{linux16}) has been run. See also @ref{GNU/Linux}. +(@pxref{linux16}) has been run. See also @ref{GNU/Linux} and the @command{initrd} +(@pxref{initrd}) for more details. -This command is only available on x86 systems. +This command is only available on the pc platform for x86 systems. @end deffn -- 2.34.1