From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id IKLrFSjun2Xu8wAAkFu2QA (envelope-from ) for ; Thu, 11 Jan 2024 14:33:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 4HwWDyjun2UlaAEAqHPOHw (envelope-from ) for ; Thu, 11 Jan 2024 14:33:28 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Z2FuyQYP; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Z2FuyQYP; dmarc=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1704980008; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=Mumc4FKoi6+Dut7fFS0HEXc6qntOEXdT1LU52T2a53M=; b=L1p1O5LFaZhtACIDcdKwQjxmO1hK9KsNQpr4r39I2b+MDx0MzF0jPtkAxxowX2oE0m9Fdv 3dXLFfERtskAVfhUw9Amv7XJuv9pPEbOK6P2oYjGn8adax2dPMkVi0x8axGC9PVzO83/jO fyKyu5QD6VCNhs4wWXvY7sr6ma8McUZDnQOc2izcdnlhl1aKQPYjCte8ZAY7acOuTx0aDI TrmiLVqy7w0kcbidGnXxMTDAN6ltTYE/1HIOSvxI3Ok6aZHrM8B+18Nkw8jgPEpygTZnsK ZnqzYTAe1eHnsKszCzA88xavmweeipRQYoZL2IShLXSh2sIJMzTDr1jhN3DehQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Z2FuyQYP; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Z2FuyQYP; dmarc=fail reason="SPF not aligned (relaxed)" header.from=wolfsden.cz (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1704980008; a=rsa-sha256; cv=none; b=NgXPRFq799Z07KIGCEMacWV6HkD98nkWgH7+rZLlih1oDbGb2IqiR93kOuMoSav7CGeM6Q 4SOpUyrRooy9IzJAE0Q7GygNH56T+9O3kTUw3dIllBgcMUsSzotfsP6g0fOXajIiPJwPuK FT0d8OmclZrb4LrAjfbQnlETLH+xZuAds5zgljQLB6rG+1FAVooqzZqS9FBPjemOspDrXz BOBrPTq3e5ax+2nZGEoIxZntvJfGqaOnLwqwBkqy6QQiGZ0B6DCeJsYIQyotB/ZUL1m5jA gGkRM2QJkGYvlRKE2Cvl4FlT1F5FXqrWD2l9W2GTgS/IpIV2rqKck+Q6sbEdEg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D866163C41 for ; Thu, 11 Jan 2024 14:33:27 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNvBH-0005cP-KJ; Thu, 11 Jan 2024 08:33:11 -0500 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 1rNvBE-0005a3-KK for guix-patches@gnu.org; Thu, 11 Jan 2024 08:33:09 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNvBA-0003Cq-Pg for guix-patches@gnu.org; Thu, 11 Jan 2024 08:33:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNvB8-00080d-49 for guix-patches@gnu.org; Thu, 11 Jan 2024 08:33:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#65002] [PATCH v2 2/2] gnu: bootloader: grub: Add support for loading an additional initrd Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Jan 2024 13:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65002 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 65002@debbugs.gnu.org Received: via spool by 65002-submit@debbugs.gnu.org id=B65002.170497995130735 (code B ref 65002); Thu, 11 Jan 2024 13:33:02 +0000 Received: (at 65002) by debbugs.gnu.org; 11 Jan 2024 13:32:31 +0000 Received: from localhost ([127.0.0.1]:59060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNvAc-0007zf-Kx for submit@debbugs.gnu.org; Thu, 11 Jan 2024 08:32:31 -0500 Received: from wolfsden.cz ([37.205.8.62]:55168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1rNvAY-0007zS-Dm for 65002@debbugs.gnu.org; Thu, 11 Jan 2024 08:32:29 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 6DDF0250746; Thu, 11 Jan 2024 13:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1704979947; bh=mCKcRpwZ3kR3rJiVGADgbvuBjroWF19Hy12zm39qukg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Z2FuyQYPV2TANwn9klZUdDL3ocKq4PQpvl4wOITA0xG88jAH0fSy1GbDnh9JAl1V5 4oQLZL06yE5LVk3MrEv8gtBot63htXzD8Ohb4v2fBVnSLMIUkaCLnR6uu/a1LF0UNr At6IQ+CW7ZlnTN+jSREtDCKGZgrH9oGmTIOc1ywK7bk5zVj7AeMowqbDAMAb9W8n+M 1Z89VaGD1oKl0YkMH7mi2BsL2Dpr/hbXVHbz+rBQMUN7TI2BbBlMfcGHoQP7Fb7te8 JAYXc1fdbbdw4yyBBTQOFVlY7CMbjCF4iuv+kA5YftW2V00S+fqB/MnzEmULKrqzd5 wYnAU1jAbj0MRVOo/dDTYE6iQHp3YRi3tvP7pD5vlx5TrGYBVOQ8qh7J3jcOcjybvy 8SsQu/YBV9eHipazYXyf/Qpo5/B9WEOywQijFBQlxh3sA2iRXqFp7XPH2jJBpm4RFx vcbFG3mzYeswiJUosFV98mfdhTcc3G3uobeio2xcbtQIxSGdnKLp3gf6RJM4qleLzG nAZvg/BGQfnm0eqzcK7QwBAcVOlr465FCI57RiETpiYF1LhOSps5izrmGfvZWaOrzT XgqNKlJh3qJ5tpclPI5nBhMzHquCOA9FjhC02xHW2jJjJEyIrbawtTLZFDSulPACon MjiCpX7WWcfD0J1aGCKVWKeU= Received: from localhost (unknown [193.32.127.158]) by wolfsden.cz (Postfix) with ESMTPSA id 017EC2504BC; Thu, 11 Jan 2024 13:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1704979947; bh=mCKcRpwZ3kR3rJiVGADgbvuBjroWF19Hy12zm39qukg=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=Z2FuyQYPV2TANwn9klZUdDL3ocKq4PQpvl4wOITA0xG88jAH0fSy1GbDnh9JAl1V5 4oQLZL06yE5LVk3MrEv8gtBot63htXzD8Ohb4v2fBVnSLMIUkaCLnR6uu/a1LF0UNr At6IQ+CW7ZlnTN+jSREtDCKGZgrH9oGmTIOc1ywK7bk5zVj7AeMowqbDAMAb9W8n+M 1Z89VaGD1oKl0YkMH7mi2BsL2Dpr/hbXVHbz+rBQMUN7TI2BbBlMfcGHoQP7Fb7te8 JAYXc1fdbbdw4yyBBTQOFVlY7CMbjCF4iuv+kA5YftW2V00S+fqB/MnzEmULKrqzd5 wYnAU1jAbj0MRVOo/dDTYE6iQHp3YRi3tvP7pD5vlx5TrGYBVOQ8qh7J3jcOcjybvy 8SsQu/YBV9eHipazYXyf/Qpo5/B9WEOywQijFBQlxh3sA2iRXqFp7XPH2jJBpm4RFx vcbFG3mzYeswiJUosFV98mfdhTcc3G3uobeio2xcbtQIxSGdnKLp3gf6RJM4qleLzG nAZvg/BGQfnm0eqzcK7QwBAcVOlr465FCI57RiETpiYF1LhOSps5izrmGfvZWaOrzT XgqNKlJh3qJ5tpclPI5nBhMzHquCOA9FjhC02xHW2jJjJEyIrbawtTLZFDSulPACon MjiCpX7WWcfD0J1aGCKVWKeU= Date: Thu, 11 Jan 2024 14:32:26 +0100 From: Tomas Volf <~@wolfsden.cz> Message-ID: References: <058b41c5060e1811048fe44c20278c64fdfc3ece.1690981365.git.wolf@wolfsden.cz> <87edeqw0h9.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8/Cu42ot2EpkfQJY" Content-Disposition: inline In-Reply-To: <87edeqw0h9.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Queue-Id: D866163C41 X-Migadu-Spam-Score: -6.81 X-Spam-Score: -6.81 X-TUID: GhEPMCnXs+kh --8/Cu42ot2EpkfQJY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-01-10 00:28:18 +0100, Ludovic Court=C3=A8s wrote: > Tomas Volf skribis: >=20 > > In order to be able to provide decryption keys for the LUKS device, the= y need > > to be available in the initial ram disk. However they cannot be stored= inside > > the usual initrd, since it is stored in the store and being a > > world-readable (as files in the store are) is not a desired property fo= r a > > initrd containing decryption keys. >=20 > This explanation should go in the manual IMO (it=E2=80=99s already partly= there). Done. >=20 > > This commit adds an option to load additional initrd during the boot, > > one that is not stored inside the store and therefore can contain > > secrets. > > > > Since only grub supports encrypted /boot, only grub is modified to use = the > > extra-initrd. There is no use case for the other bootloaders. > > > > * doc/guix.texi (Bootloader Configuration): Describe the new extra-init= rd > > field. > > * gnu/bootloader.scm: Add extra-initrd field to bootloader-configuration > > * gnu/bootloader/grub.scm: Use the new extra-initrd field >=20 > It=E2=80=99d be great if you could specify the entities changes in each f= ile > (which variable/procedure is changed, what is added/removed). A > committer can do it on your behalf later if you=E2=80=99re unsure. Done, this was one of my first patches and I was quite unsure about the com= mit message format. These days I am still unsure, but a little less so. ^_^ >=20 > > +@item @code{extra-initrd} (default: @code{#f}) > > +Path to an additional initrd to load. Should not point to a file in t= he >=20 > s/Path/File name/ (by convention) >=20 > Please make full sentences. =E2=80=9CShould not=E2=80=9D is probably too= strong; > perhaps: =E2=80=9CIt may or may not point to a file in the store, but the= main > use case is for out-of-store files containing secrets.=E2=80=9D For content that can be present in the store, the regular `initrd' should be used instead I think. However I adjusted the wording. >=20 > > +store. Typical use case is making keys to unlock LUKS device available >=20 > Add a line break after =E2=80=9Cstore.=E2=80=9D to distinguish the refere= nce from the > discussion of one possible use case. >=20 > > +during the boot process. For any use case not involving secrets, you > > +should use regular initrd (@pxref{operating-system Reference, > > +@code{initrd}}) instead. > > + > > +Suitable image can be created for example like this: > > + > > +@example > > +echo /key-file.bin | cpio -oH newc >/key-file.cpio > > +chmod 0000 /key-file.cpio > > +@end example > > + > > +Be careful when using this option, since pointing to a file that is not > > +readable by the grub while booting will cause the boot to fail and > > +require a manual edit of the initrd line in the grub menu. > > + > > +Currently only supported by grub. >=20 > s/grub/GRUB/ >=20 > Would be great if you could include also a short config example here, or > add a cross-reference to the example for > =E2=80=98luks-device-mapping-with-options=E2=80=99 if that covers both. I added an example illustrating how these two work together. >=20 > > + (extra-initrd bootloader-configuration-extra-initrd > > + (default #f)) ;string | #f > > + ) >=20 > No lonely paren please. :-) Well I moved the paren, but now the comment (string | #f) looks like it is = for the whole top-level sexp, not just for the extra-initrd field. >=20 > Otherwise LGTM. >=20 > Could you send updated patches with these minor changes? I will soon, just want spent a bit of time trying to make the system test f= or this. >=20 > Thanks! And thank you again for the review. Tomas --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --8/Cu42ot2EpkfQJY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmWf7eoACgkQL7/ufbZ/ wamGaw/8DLbzvyuojyQGST+WL1+EuQb4pmd0+gWOS/n+S6C0TDZzra6VRGvI6o+B VrJb72ZRudt2/+kTJmIfA3Xso4FhfiUSeno4h8YttnIu4tEt+OO7kZ4pg1B78evg CfTSi1BT1z2TTI2mhw7CcNEQ4m0RbDGRmaWnlHXPuJkX1ZJ5nukae5HZVQDL1GAY BE1LvVSXmxY8uY9VXj1m01BpryqDM0muHNtp0uVghkQula6w4ryHrV+/wFtyA9gG +xTg3qW7VavFO9BhGe2mpoMf/zcTU5BaTHytv7ie/sjxbsG/Xh/+JNDb1Io/gLP7 2guPt+kL8V5b+QHKV6oad7jddSuhZQpDR/KBvJ/HHKIYGPuOBzPSV98gqf0W13yn zyz3bhBilQtejSyx49vxpODnmZIRQ5Xjc4ocjQ8Bo/KTBCFTDttHKwqZS0i+XOzn pPxd/7cigEmSyd0sufU0aK4VrBiOPXJZnb/HtUeGkFILmRY1FzEFG94iqAk02ryd 1Ve9NY8qztE8KN9S6NgCINroPSr6tFybkuLxrUV8jS2dbbjKjtN0Q7YK5+pKUD1D TXwgGGdbJWft6pih5F+tEkrMyEBr/ek1opsWKDxx8fMtRa543SmBUJ3uESzePlGu zNI0Q3OcI4/eDQrKWXIGjERPh8zt32sVjN4A8lVPBibN3/l91m8= =VCJY -----END PGP SIGNATURE----- --8/Cu42ot2EpkfQJY--