Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1qR3P4-0003Yu-GX for mharc-grub-devel@gnu.org; Wed, 02 Aug 2023 00:24:06 -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 1qR3P2-0003Yd-LQ for grub-devel@gnu.org; Wed, 02 Aug 2023 00:24:04 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qR3P0-0007tg-I4 for grub-devel@gnu.org; Wed, 02 Aug 2023 00:24:04 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-317715ec496so6537139f8f.3 for ; Tue, 01 Aug 2023 21:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690950240; x=1691555040; 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=FYlyr+E5XKCMrCwWnAM7hznUiRXUVPYeKomiGyV8TD0=; b=gXytQ8wH8Z4ZfS+nroGkoNuJqY331BE09g8NXjnXyB5iB/mI6gpfD0efjArF/6nczS fB0iXYLSPlmiYaDaoO+4bOPCJOsMNaa6yhu2LW6Yak1IeT3lB4PTIovUjG6i+jH6Xpm0 Q3uWIDQzYPFbNZzYUMngWnFLy+nYjQFjc9fEB1YeUsol2u91a8mhd67apRVvnqoC+509 HV2DnJkbDHAiP9o2dJwco0A6xWM4eVLOG6N3Cgp+4Ws2cd6VWoaxx2VtpXTCTCToDeD5 ENBRHDkBZt7Qm+DiSmZ/iTGaGO9N6uNofiT2/OjS93HpBBD2U77S1Jj89muUY/5Jn25h 7OHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690950240; x=1691555040; 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=FYlyr+E5XKCMrCwWnAM7hznUiRXUVPYeKomiGyV8TD0=; b=Cn2/RxtsyzIv0QPIKCAbmMu2TtoqnUIjI1Ys503KWBKr01My+VJgW65IONu6TdY/n/ 5vGbBMPw2K7UsrwflybPtZUkv5OuMfLKm0Ns1zf6XqRafkvLcR2xs+V4nPLxmVCAV7hS y++LG/sqevd27p4sTNzJszydOxT2nA+qZjyfGPplmeMmPNIwGlyTu4ReiPG+F0IgxUUp +/m1KsW66nT9k9kaa4uyEqeD6YvmrnVFzLpvhz5hxYNHujWqxMwAM0zaN7h7KMjKLVoQ oX/zKjaita66pcfOsU5tPdtJ4R2IiFDBNfJ/PIch7apzVwcav4VePwB7qle+hY58sX6V u9sg== X-Gm-Message-State: ABy/qLZfZb396X79S8Wgrk3VkFeBqbiTeyD+aVdFHz+Zx1Buw4TxuiY1 1JTb+8XfDtjlhm0CNf2+EFum78NeuHI= X-Google-Smtp-Source: APBJJlHpgojYmdiSzdKdtZNhriaR+2h1kPz80TxjZl0eeSGAPMPrFXZ/tB78DB/q1OFHRzjHHVJUkQ== X-Received: by 2002:a05:6000:109:b0:314:4a15:e557 with SMTP id o9-20020a056000010900b003144a15e557mr3970777wrx.5.1690950240226; Tue, 01 Aug 2023 21:24:00 -0700 (PDT) Received: from dj3ntoo (140.sub-75-226-201.myvzw.com. [75.226.201.140]) by smtp.gmail.com with ESMTPSA id t18-20020adfdc12000000b003143c9beeaesm17762754wri.44.2023.08.01.21.23.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 21:23:59 -0700 (PDT) Date: Tue, 1 Aug 2023 23:23:54 -0500 From: Oskari Pirhonen To: Glenn Washburn Cc: grub-devel@gnu.org, Daniel Kiper , Paul Menzel Subject: Re: [PATCH v3] docs: Improve initrd documentation Message-ID: Mail-Followup-To: Glenn Washburn , grub-devel@gnu.org, Daniel Kiper , Paul Menzel References: <20230802005851.2256674-1-development@efficientek.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NpBKTLK9ZFuhSRSy" Content-Disposition: inline In-Reply-To: <20230802005851.2256674-1-development@efficientek.com> Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=xxc3ncoredxx@gmail.com; helo=mail-wr1-x434.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: Wed, 02 Aug 2023 04:24:05 -0000 --NpBKTLK9ZFuhSRSy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 01, 2023 at 19:58:51 -0500, Glenn Washburn wrote: > A list of improvements: > * 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 newer. > * Add sentence with URL to initrd documentation Linux kernel. > * Add a section documenting how to have the initrd command generate a > new-style initrd via a specially crafted argument and include an examp= le. > * 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 > Reviewed-by: Paul Menzel LGTM - Oskari > --- > Range-diff against v2: > 1: 28cda0c394d6 ! 1: d6ca60159b40 docs: Improve initrd documentation > @@ Metadata > ## Commit message ## > docs: Improve initrd documentation > =20 > - 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 L= inux kernel. > - Also, add a section documenting how to have the initrd command g= enerate a > - new-style initrd via a specially crafted argument and include an= example. > + A list of improvements: > + * Remove reference to "initial ramdisk" and replace with "initr= d". This > + then covers the case of ramdisk and ramfs, which is the usual= method > + with kernels 2.6 and newer. > + * Add sentence with URL to initrd documentation Linux kernel. > + * Add a section documenting how to have the initrd command gene= rate 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. > =20 > - Update initrd16 to refer to the initrd section and make note tha= t initrd16 > - is only on the pc platform. > + Signed-off-by: Glenn Washburn > + Reviewed-by: Oskari Pirhonen > + Reviewed-by: Paul Menzel > =20 > ## docs/grub.texi ## > @@ docs/grub.texi: load a defective boot loader, such as SCO UnixWar= e 7.1. > @@ docs/grub.texi: load a defective boot loader, such as SCO UnixWare= 7.1. > +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.ht= ml, > -+documentation} on them. > ++documentation}. > + > +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 > @@ docs/grub.texi: load a defective boot loader, such as SCO UnixWare= 7.1. > +in the path @samp{/init} and appended to the previous concatenation= =2E 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 > ++Keep in mind that paths that come later will take precedence. 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 mai= n initrd > +is undesirable or difficult. >=20 > docs/grub.texi | 48 +++++++++++++++++++++++++++++++++++++++++------- > 1 file changed, 41 insertions(+), 7 deletions(-) >=20 > diff --git a/docs/grub.texi b/docs/grub.texi > index 730e8c8d75a4..1d2f0a3d04fe 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}. > + > +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 come later will take precedence. 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 --NpBKTLK9ZFuhSRSy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQfOU+JeXjo4uxN6vCp8he9GGIfEQUCZMnaUgAKCRCp8he9GGIf EWmWAP9AReM7on9FcPlL/HzrtRh975RI3H1/sQ+hquJT855+EgD+NBiuJiHELxf6 j9WslUqI1jzYfocwoA7ZFF82jvSs+gk= =cWIs -----END PGP SIGNATURE----- --NpBKTLK9ZFuhSRSy--