From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qGUgf-0007X2-8M for mharc-grub-devel@gnu.org; Mon, 03 Jul 2023 21:18:37 -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 1qGUgd-0007Wo-G4 for grub-devel@gnu.org; Mon, 03 Jul 2023 21:18:35 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGUgb-000231-AZ for grub-devel@gnu.org; Mon, 03 Jul 2023 21:18:35 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1b0249f1322so4191384fac.3 for ; Mon, 03 Jul 2023 18:18:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20221208.gappssmtp.com; s=20221208; t=1688433511; x=1691025511; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3f+N43fpl1hyqEl5OXEic0pizOWpkLvodHPtKylK9O0=; b=asjOH/sXnyLjt0sjVhJat5ac1JCTZiLQdfxIagy2ObVAcZinyTLREEpt+0dc+RD/cB MVAQUk6NF2b1/1BkSJKH2Vwi/YHf84IbAgS6dq5r4V8r6pkgoMPs0KtHzSg9dvC0dE5E e8Mfy4jgCUJn9l19HeO35BeepHqzELIk8H8MQQETbFtSQc7UwOkD5OA839ll443Arz1t 8EQlYOoFD44fSVsR3aZ00CQIZAeHiRCliJ2wjDN/FX295yhb7R8tAAlM+YANdg6qBIs9 YMgjMvTbQ6PmrC+hTpJLvjxNd7MUAICaFc5veOChRqEbjHSX889l94n5JZL9ka51NJyZ 2q0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688433511; x=1691025511; 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=3f+N43fpl1hyqEl5OXEic0pizOWpkLvodHPtKylK9O0=; b=Etd0xDdPgLwqQzmILV0jaQ+2fi/bXcCta0+RRSAHTMnswpqkWo3P9B1YCR5sGX7Fho sJ6N9mbKIhtteHSU2Mm5CwYKhcx8IFpnYDzyu5O2vJcNK7qOHwebBln/LoJ5YwTN0i/D 4yO1CeXtGltKsUT7briqSBz21kSOpgy75lYBbxvP9FYBF83c5cDxfHqTlYqVxMtrfbsb RoRK5c+hIx93BLVkkPAhtvsUlltiV29UZPH0ryytRvC5uw1Tgg2XBMWpHslWYYZvBHRG dr2KyVpSw0ZKo2mQZ7v+QcB41uFYj/nRQPrMUmtNibvAMuCqIQQtniH5lcuUJa4fvw8N EGUA== X-Gm-Message-State: ABy/qLalFMATaZi80s8ds189zpBDZG/xkW8JEHSVrj+4WRqSkr32M27I i65CVN/dZlwwoBFMk/Rv/vjrUMeJMWz8rzVHz2g= X-Google-Smtp-Source: APBJJlEq+29sTzQ6bft10mnUeE8cPm3h5kVq5u+vj7M+M8w/7rztLBLOkTLCLaiUY/bzkPp/XzZCGQ== X-Received: by 2002:a05:6870:e40c:b0:1b0:2491:40fc with SMTP id n12-20020a056870e40c00b001b0249140fcmr12308287oag.44.1688433511345; Mon, 03 Jul 2023 18:18:31 -0700 (PDT) Received: from localhost.localdomain ([185.220.103.12]) by smtp.gmail.com with ESMTPSA id b19-20020a056830105300b006b88bf91651sm4707754otp.75.2023.07.03.18.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 18:18:30 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Oskari Pirhonen , Glenn Washburn Subject: [PATCH v2] docs: Improve initrd documentation Date: Mon, 3 Jul 2023 20:18:17 -0500 Message-Id: <20230704011817.1232356-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=2001:4860:4864:20::2a; envelope-from=development@efficientek.com; helo=mail-oa1-x2a.google.com X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: Tue, 04 Jul 2023 01:18:35 -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 --- Range-diff against v1: 1: a32e624ba41b ! 1: 28cda0c394d6 docs: Improve initrd documentation @@ docs/grub.texi: load a defective boot loader, such as SCO UnixWare 7.1. +@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 ++A new-style initrd (for kernels newer 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 @@ docs/grub.texi: load a defective boot loader, such as SCO UnixWare 7.1. @@ docs/grub.texi: also @ref{GNU/Linux}. - Load, in order, all initial ramdisks for a Linux kernel image to be booted in + @subsection initrd16 + + @deffn Command initrd16 file [file @dots{}] +-Load, in order, all initial ramdisks for a Linux kernel image to be booted in ++Load, in order, all initrds 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. ++command (@pxref{initrd}) for more details on arguments. -This command is only available on x86 systems. +This command is only available on the pc platform for x86 systems. docs/grub.texi | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/docs/grub.texi b/docs/grub.texi index b39b72230c6f..0a665ee7825f 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 newer 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 @@ -4087,12 +4120,13 @@ also @ref{GNU/Linux}. @subsection initrd16 @deffn Command initrd16 file [file @dots{}] -Load, in order, all initial ramdisks for a Linux kernel image to be booted in +Load, in order, all initrds 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} +command (@pxref{initrd}) for more details on arguments. -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