From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qEkpL-0006tz-Ko for mharc-grub-devel@gnu.org; Thu, 29 Jun 2023 02:08:23 -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 1qEkpJ-0006tq-Vd for grub-devel@gnu.org; Thu, 29 Jun 2023 02:08:21 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEkpI-0007FK-0D for grub-devel@gnu.org; Thu, 29 Jun 2023 02:08:21 -0400 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-98934f000a5so37744766b.2 for ; Wed, 28 Jun 2023 23:08:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688018898; x=1690610898; 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=jFFsh7ciR4Wpbykb8Er1KdfSBDVG0silsi04VH03RTQ=; b=Qhf9ZjP2KyqcCUygTMv86VqQn4wmEKcHrDtf2+AOyk9+yC35gaHvUK/hwEbi7kDMWz R2iWJkmR3IMAxRy10OKKYngWAzL37NniH1dFQpa7WMrbNbH4Lmm9379vlIXju0jINR5P Bqt9FSMqHAQ2qi9HJEzM+++8W3R4eeP9UgIP5WQC+N8Vsj2F/5APt5a26wNeenjw86XA /MYhUMgp0kY6oPaZ0gNRwwVPQTVABZvIw8dkK0Sh1q1WePtCSN1EXgpITk4ZEqVmXyvM UG6LBWXZz2jmtn3A9UPiATFQC5I/xIXWIc298lA0wXJPsRvSa+PymgPrBueBsV9E4Zfq 4uPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688018898; x=1690610898; 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=jFFsh7ciR4Wpbykb8Er1KdfSBDVG0silsi04VH03RTQ=; b=KeXCi+qwiJouMpnsk/FkmKJ/Ym8gIZAiFO6MPLYktRV3vqodjt9axVfkGDTFryh2Vs 36bvVM9eQMfdaBpXqSgf+EXfaKgJWMQXo77G9mAbZmEeQYLEBIsode+1xkIMZiX+7LF9 7m/rwh7DVPCzfCfluXkjjr2JHLA7GyJ1lA2xxoCi+zpzV0b4Dp5G3lNj5JrCwhFGIqlj feSvmT66unI22pixQzzkA/bAT5KzCJ7LhskIeY5vBtVATaSvvOoRE5shLU2A1fMBcw0r ZistSdlo4yILLz+L+rFtabIDy5z6Ch+OxEdqgh5aHeKUrI+ZdGHig3kHUgwrmGcQSFHi jUAA== X-Gm-Message-State: AC+VfDzWf/6zk1upfkBUpOIuT9cWU8aSvbw1JFZ2CCigUgqdyXkCIhfr wG0VkPik1X1HdZcfyVjuN2g= X-Google-Smtp-Source: ACHHUZ5k6Xk0Vq0JwcQEPHQnAzdM0+5FWfjZH5qiYChD5dyAuaJ70K4SMJOH5ppgce1Kwn8YHkEg5A== X-Received: by 2002:a17:907:1c2a:b0:98f:3485:9c44 with SMTP id nc42-20020a1709071c2a00b0098f34859c44mr10895568ejc.72.1688018898097; Wed, 28 Jun 2023 23:08:18 -0700 (PDT) Received: from dj3ntoo (140.sub-75-226-201.myvzw.com. [75.226.201.140]) by smtp.gmail.com with ESMTPSA id t23-20020a170906179700b00987f64b84afsm6410612eje.39.2023.06.28.23.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 23:08:17 -0700 (PDT) Date: Thu, 29 Jun 2023 01:08:11 -0500 From: Oskari Pirhonen To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper Subject: Re: [PATCH] docs: Improve initrd documentation Message-ID: Mail-Followup-To: Glenn Washburn , grub-devel@gnu.org, Daniel Kiper References: <20230628101204.570808-1-development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VfL1zk3s6MA/pK9Y" Content-Disposition: inline In-Reply-To: <20230628101204.570808-1-development@efficientek.com> Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=xxc3ncoredxx@gmail.com; helo=mail-ej1-x62b.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: Thu, 29 Jun 2023 06:08:22 -0000 --VfL1zk3s6MA/pK9Y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 28, 2023 at 05:12:04 -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 > --- > docs/grub.texi | 46 ++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 40 insertions(+), 6 deletions(-) >=20 > 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 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 greater than 2.6) containing one file I'd personally say "newer than 2.6", but "greater than 2.6" is still easy enough to understand. > +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 > @@ -4090,9 +4123,10 @@ also @ref{GNU/Linux}. > Load, in order, all initial ramdisks for a Linux kernel image to be boot= ed in Your commit message mentions replacing references to "initial ramdisk" with "initrd" which you did above. Did you mean to do that here too? > 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} > +(@pxref{initrd}) for more details. > =20 I would add "command" after the "@command{initrd}" bit. This is cool stuff. I was not aware of this feature in GRUB. - Oskari > -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 --VfL1zk3s6MA/pK9Y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQfOU+JeXjo4uxN6vCp8he9GGIfEQUCZJ0fxwAKCRCp8he9GGIf ETY7AQC+B6BMqhhnnTRcQ04zk5e9j0VZrz7Gj6b0H2RpLLvI2AD+KvP9949PdrsF gQhCWRXy9D0MWcCqoFZc0PL/rdL7/QE= =bPEa -----END PGP SIGNATURE----- --VfL1zk3s6MA/pK9Y--