Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qGWb7-00080j-Mr for mharc-grub-devel@gnu.org; Mon, 03 Jul 2023 23:21:01 -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 1qGWb5-00080P-Qj for grub-devel@gnu.org; Mon, 03 Jul 2023 23:20:59 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qGWb0-0008Iy-Qw for grub-devel@gnu.org; Mon, 03 Jul 2023 23:20:56 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3143ccb0f75so789188f8f.0 for ; Mon, 03 Jul 2023 20:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688440853; x=1691032853; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=4HP+6uk7rUyJeN6Y0aUtFwu62O7ZxOsQRtp6OTQhMg8=; b=YNnvvXXf3gIFnxSSeghbrnC+nroo6rfuSrmM4zMswUcTyqYpfenGe5FIMWA4GmEaSE emuaNkRhVCTqWDe0UgsIGdEWO2jzgmJUDaXtCpPH1MLCfMnMvp2t9bLyR+gX590RacK9 0XTMa7k3kM8vxX04HbMdqktT/ARXJjAG0MVxmEkaiPatakiJawKgVRgdcV1aQAxE2nGZ KAdjnK2ohCn8Of56X7RTn3qbqBYtqj/87QdPIHuxL7Gsqnsmgdo3lNREAoEvp0N3NCKr IGZ8TaPZ2ep+x8zvnBauWc4fZLHpauxh9OTizUip2VrdXM8wJ8+KUzBgRR28LUV3kjjK tsBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688440853; x=1691032853; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4HP+6uk7rUyJeN6Y0aUtFwu62O7ZxOsQRtp6OTQhMg8=; b=Rla9s5Kq3SOYqrKWRj9CudrtYl/b17m4xcPQAk0KWh3xudhZPSYs3jruPGSueM/yvC fEg99fPcxVGfbsiP/xefAvj7JW8qrFEgsLJwVwy8fA/RpQACoD6GHQ8bzPkf/rAWBhoi ctoRsNPVOrg7HupvseGwH2RK3H1lu1IAMBGFdLzVoEw+HaPHVZFBXRlLQYQzxTqERo6O XskMGk0iALDGzCKq0ctx6qsCRqF01CK5n77jBIIDRBjPXWr7lAzSK+Cubo5wHYEuoxg8 lVXnRTh9y+FtNmef7/0pSyIWPRfnpTBBWgG/FD4Mitf7Z+SBBsbPgb46P0SRowlQy3wU XNnw== X-Gm-Message-State: ABy/qLZgCVTsmxONHkBQR56yP73KAmuC4NsVfB6b1h1qJnS5shqm/+HE ysfztiLdKyG8CW6JE+Cazin/1pK6B7A= X-Google-Smtp-Source: APBJJlHAhdKSLpWr4VBHGpa08bMngrwGtippXPeMG4ifE5cjS9Wfqk91KOKoMLMMLI7Fy9Ces9xl+Q== X-Received: by 2002:a5d:4f08:0:b0:313:dfa3:4f7b with SMTP id c8-20020a5d4f08000000b00313dfa34f7bmr15128186wru.20.1688440853053; Mon, 03 Jul 2023 20:20:53 -0700 (PDT) Received: from dj3ntoo (140.sub-75-226-201.myvzw.com. [75.226.201.140]) by smtp.gmail.com with ESMTPSA id a11-20020a056000050b00b003110dc7f408sm27209606wrf.41.2023.07.03.20.20.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 20:20:52 -0700 (PDT) Date: Mon, 3 Jul 2023 22:20:47 -0500 From: Oskari Pirhonen To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH v2] docs: Improve initrd documentation Message-ID: Mail-Followup-To: Glenn Washburn , grub-devel@gnu.org, Daniel Kiper References: <20230704011817.1232356-1-development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="CXgyIOJTscb8hejq" Content-Disposition: inline In-Reply-To: <20230704011817.1232356-1-development@efficientek.com> Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=xxc3ncoredxx@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, 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: Tue, 04 Jul 2023 03:21:00 -0000 --CXgyIOJTscb8hejq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 03, 2023 at 20:18:17 -0500, Glenn Washburn wrote: > Remove reference to "initial ramdisk" and replace with "initrd". This then > covers the case of ramdisk and ramfs, which is the usual method with kern= els > 2.6 and greater. Add sentence with URL to initrd documentation Linux kern= el. > 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. >=20 > Update initrd16 to refer to the initrd section and make note that initrd16 > is only on the pc platform. >=20 > Signed-off-by: Glenn Washburn Reviewed-by: Oskari Pirhonen - Oskari > --- > 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.ht= ml, > +documentation} on them. > + > -+A new-style initrd (for kernels greater than 2.6) containing one fi= le > ++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 f= ile > @@ docs/grub.texi: load a defective boot loader, such as SCO UnixWare= 7.1. > =20 > =20 > @@ docs/grub.texi: also @ref{GNU/Linux}. > - Load, in order, all initial ramdisks for a Linux kernel image to be= booted in > + @subsection initrd16 > +=20 > + @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. > =20 > -This command is only available on x86 systems. > +This command is only available on the pc platform for x86 systems. >=20 > docs/grub.texi | 48 +++++++++++++++++++++++++++++++++++++++++------- > 1 file changed, 41 insertions(+), 7 deletions(-) >=20 > 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 UnixWar= e 7.1. > @subsection initrd > =20 > @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 direct= ory > +paths will automatically be generated as needed. This first generated in= itrd > +will then have @samp{/boot/initrd.gz} concatenated after it. Next, anoth= er > +new-style archive will be generated with the contents of @samp{/home/use= r/init.fixed} > +in the path @samp{/init} and appended to the previous concatenation. Fin= ally, > +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 ini= trd > +is undesirable or difficult. > @end deffn > =20 > =20 > @@ -4087,12 +4120,13 @@ also @ref{GNU/Linux}. > @subsection initrd16 > =20 > @deffn Command initrd16 file [file @dots{}] > -Load, in order, all initial ramdisks for a Linux kernel image to be boot= ed 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 @comma= nd{initrd} > +command (@pxref{initrd}) for more details on arguments. > =20 > -This command is only available on x86 systems. > +This command is only available on the pc platform for x86 systems. > @end deffn > =20 > =20 > --=20 > 2.34.1 >=20 --CXgyIOJTscb8hejq Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQfOU+JeXjo4uxN6vCp8he9GGIfEQUCZKOQBQAKCRCp8he9GGIf EXGWAP930eWHk3eUkftbSQIhvYFGyt5kfapuBHzhVxeWQqBQSgEAg2A4Jjg+lPxF DNQKmwY8mMcT7Lb68orGolPsElgbkwg= =UwZY -----END PGP SIGNATURE----- --CXgyIOJTscb8hejq--