GNU bug report logs - #55631
[PATCH] gnu: grub: add removable grub-efi bootloader option

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Karl Hallsby <karl@HIDDEN>; Keywords: patch; dated Wed, 25 May 2022 14:04:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 55631 <at> debbugs.gnu.org:


Received: (at 55631) by debbugs.gnu.org; 5 Jun 2022 14:22:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jun 05 10:22:32 2022
Received: from localhost ([127.0.0.1]:33191 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nxr9D-0002Oq-S3
	for submit <at> debbugs.gnu.org; Sun, 05 Jun 2022 10:22:32 -0400
Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:47369)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <tom@HIDDEN>) id 1nxr9A-0002OU-8T
 for 55631 <at> debbugs.gnu.org; Sun, 05 Jun 2022 10:22:29 -0400
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailout.west.internal (Postfix) with ESMTP id 353523200915;
 Sun,  5 Jun 2022 10:22:22 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute3.internal (MEProxy); Sun, 05 Jun 2022 10:22:22 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 tom-fitzhenry.me.uk; h=cc:cc:content-type:date:date:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:sender:subject:subject:to:to; s=fm1; t=1654438941; x=
 1654525341; bh=18eopLn+oRdDozUytvdtYOKS/bh9eAlP21HVttuVoRM=; b=b
 3EFQNZV9kPG7mwKwttgeEe/3IphBz3n1DtGk/rzscvbE9upBYiXHoEIjV+yWBPQ6
 Tao/ETFf+vdzWHt8eQGhg9OuGELF5WNAIDf493TZzDj1pyH7pyFZibdJWFhO7cbJ
 y2Nm4o7UPssqtUg1TMY6zaTu0I0Ub3CaYWJdXoljPVk2bBpaUdnvS4uF4WbLyzHl
 k9j7J+8jb6Kei/kscmnCBvGYkTPbkVb5MgSt5ANv+VZNYwCgibnYEymDLU7iljA5
 DjbYx8VAsFAtG5+AlRRwa/p/u8yZz1J3Gy6cmAUXMWv3nQHpDB5l7zO5WvaH84qB
 K9D04X/zdbOxS1KL/l7+A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:date:date:feedback-id
 :feedback-id:from:from:in-reply-to:in-reply-to:message-id
 :mime-version:references:reply-to:sender:subject:subject:to:to
 :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; t=1654438941; x=1654525341; bh=18eopLn+oRdDozUytvdtYOKS/bh9
 eAlP21HVttuVoRM=; b=kfSEeDo2xiUYm87wn3Z3Axluf8BVppr0JuDA3TF5BZ3A
 MRGUIqkyu24E4tRhOA7J5WL2u05L36RGH6C9dhAZ3zXQdz/PwGCkWvgg9OnUZiud
 P4+93SxsplW4xUPEWyJpYMmuQDiN+yCUzedmZWH/VgC7dQLN4nAon/jMBgDi2FP7
 w3QD441w4zOPF7U9lr+o+qmXZ99Py9QnkkmNT2KwoaTkefD+ddqsOwRdwBuT9sa9
 ewu5fNhVKkA0GJZoj45XEqDAaIiRLG3f9cf1vhj45MGrBiBZHlmTjdpoqiTy0gXB
 Zg2v4ieJkQD106k9U2THbA/NUbd/f+YD+ZwXEMGRLg==
X-ME-Sender: <xms:HbycYnFcCVCCieD5g7jX-KN4wiyU6_64XAhujEh52QnmZfwZE0HO1w>
 <xme:HbycYkX-K_sECX4iDoGHiDMwvtXvBLo55JatPamp1rpqdDL5ms7PScXxVsCsOFJLm
 F6gz5hKMSqEFkK8GA>
X-ME-Received: <xmr:HbycYpKZKa0Bf__IimEMKYTBqUOXpqDXO5Jok9orp04ESalLhtCg4M9ucqSzzemVriAdnRU7AIAZCdUx1GoS3Zk>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddttddgjeeiucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvvefufhffjgfkfgggtgesthdtredttdertdenucfhrhhomhepvfhomhcu
 hfhithiihhgvnhhrhicuoehtohhmsehtohhmqdhfihhtiihhvghnrhihrdhmvgdruhhkqe
 enucggtffrrghtthgvrhhnpeekfeelteduleekkeehfeejkeduueduhfeugfehtdelgeev
 veduhfefhfejleekieenucffohhmrghinhepghhnuhdrohhrghenucevlhhushhtvghruf
 hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehtohhmsehtohhmqdhfihhtiihh
 vghnrhihrdhmvgdruhhk
X-ME-Proxy: <xmx:HbycYlH7Ko4i0wHd3z9w6mNl-RxxnCWHqnC1ZXDOPe9j_Ri81O1H2g>
 <xmx:HbycYtWLB08BppNcatMtuy5SEfazUTpQu2vnkmArTPF0EMu3NIIhTw>
 <xmx:HbycYgOEGo1l4McRR-C6UInP243s7piRGh26HfkaIVQEyD10U5RZvw>
 <xmx:HbycYjx0r1GB6_BIe7X6WT3PjYyLyu2ejQij_CQSshNJzq2oJC0S9A>
Feedback-ID: iefc945ae:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun,
 5 Jun 2022 10:22:20 -0400 (EDT)
From: Tom Fitzhenry <tom@HIDDEN>
To: Karl Hallsby <karl@HIDDEN>
Subject: Re: [bug#55631] [PATCH] gnu: grub: add removable grub-efi
 bootloader option
References: <20220525043254.62715-1-karl@HIDDEN>
Date: Sun, 05 Jun 2022 16:22:15 +0200
In-Reply-To: <20220525043254.62715-1-karl@HIDDEN> (Karl Hallsby's message
 of "Tue, 24 May 2022 23:32:54 -0500")
Message-ID: <875ylfdwbs.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 55631
Cc: 55631 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

I have tested this on my Pine64 RockPro64 running Tow Boot, which is an
amnesiac UEFI.

This works for me, and allows me to avoid needing Guix to provide a
 custom u-boot for this board, as discussed in
 https://lists.gnu.org/archive/html/guix-devel/2022-05/msg00073.html .

Thanks!




Information forwarded to guix-patches@HIDDEN:
bug#55631; Package guix-patches. Full text available.

Message received at 55631 <at> debbugs.gnu.org:


Received: (at 55631) by debbugs.gnu.org; 4 Jun 2022 04:30:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 04 00:30:31 2022
Received: from localhost ([127.0.0.1]:57387 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nxLQl-0000Mb-8z
	for submit <at> debbugs.gnu.org; Sat, 04 Jun 2022 00:30:31 -0400
Received: from mail-qk1-f181.google.com ([209.85.222.181]:39653)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <karl@HIDDEN>) id 1nxLQi-0000MK-P8
 for 55631 <at> debbugs.gnu.org; Sat, 04 Jun 2022 00:30:29 -0400
Received: by mail-qk1-f181.google.com with SMTP id 15so2269910qki.6
 for <55631 <at> debbugs.gnu.org>; Fri, 03 Jun 2022 21:30:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hallsby-com.20210112.gappssmtp.com; s=20210112;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=q6D1xVtiCk7uFSnYvtQX4cfSqtpIt3VU6tABNUEykbE=;
 b=21QwMF/Xiy2Q7QV0ulN82XXZkVQ3ga7EZDtaPLgcQ7dgokbF9WoGRcy4se7dw8CeCo
 akZv5BoY9jYRlKtdAvpIYdGA4Se6EqTY6nmOSTvdiA6bfl6b7wEH/Gg8RGiggRV3x9LA
 KRbGorfKXCXNJtWL44X7aycZ7HSYMGGUmbfAmRhMJ2YBsoXUEMCVpvanO5/4FDBcAzoX
 GDEWw92tI2c0jN+PVwxKJH3nYzCXU/jroEPlg4zVyq0R9XuYtVHMVh0rx5ZWzt7O756T
 YkC2V65ynJKk9b9H32QXenmFVzpljXOJxIV3SwCPQoytPmeKrWRMO52Qifl1kuzNMJL+
 3Fng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=q6D1xVtiCk7uFSnYvtQX4cfSqtpIt3VU6tABNUEykbE=;
 b=SqYC3ZIAP9czqV9BqvbTPUTBeDkTPr804ED2lGFhiFCy3ec20wNfuCa8uWZehGoy4m
 EsVbMEldHpnUbMBgGyVSPwN+xgeotMLXg3s9trPXNpKfhSBVwnzXlF6gtbh42nqeUkVJ
 freha+bvY2QCedq1el0I1Er+rQFHxkbJvzCLGV4VKPMnL7IKqtETW6Tj4suYEl5HAQH1
 Soi1PTLR2zSU2d3uN8qcrjP7GOIdppnbU3GolIpC5xMXUB9npX6vBkoIeMBMsw5sa0vu
 E9h/d02mNVenOPSiE/zbQSZNvkWHS6m1dBY4pM2gNh9hSOA2kRhldmvyvgfV/fz/gRfC
 YMOA==
X-Gm-Message-State: AOAM531c47sbk4DGHSI8/N82NgsOIA/4rjhuBPVKjv102hU+95ZVItX8
 JFto+gZsqdcHsPQTYmf8CuHhzLLAoa+8AA==
X-Google-Smtp-Source: ABdhPJxdn2hYocgh+lyyd4jzaGaJ4rcVvwuPYKuO2rUZPDIrGEKYuraZMPoSA4nfatgMyR/jwZGWsw==
X-Received: by 2002:a37:42d2:0:b0:6a6:7b44:e150 with SMTP id
 p201-20020a3742d2000000b006a67b44e150mr7666945qka.773.1654317022878; 
 Fri, 03 Jun 2022 21:30:22 -0700 (PDT)
Received: from localhost.localdomain (dhcp68.ssv1.iit.edu. [198.37.24.68])
 by smtp.gmail.com with ESMTPSA id
 s126-20020a375e84000000b0069fcc501851sm6231418qkb.78.2022.06.03.21.30.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 03 Jun 2022 21:30:22 -0700 (PDT)
From: Karl Hallsby <karl@HIDDEN>
To: 55631 <at> debbugs.gnu.org
Subject: [PATCH] gnu: grub: add documentation for new
 grub-efi-removable-bootloader
Date: Fri,  3 Jun 2022 23:29:31 -0500
Message-Id: <071e680e8bb2c56e7bf7ee4b8a7cb7e2c3e8c3fa.1654316798.git.karl@HIDDEN>
X-Mailer: git-send-email 2.36.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 55631
Cc: Karl Hallsby <karl@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

---
 doc/guix.texi | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 184206bec8..fdfd024a7a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -103,6 +103,7 @@ Copyright @copyright{} 2021 Josselin Poiret@*
 Copyright @copyright{} 2022 Remco van 't Veer@*
 Copyright @copyright{} 2022 Aleksandr Vityazev@*
 Copyright @copyright{} 2022 Philip M@sup{c}Grath@*
+Copyright @copyright{} 2022 Karl Hallsby@*

 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -36282,8 +36283,8 @@ The type of a bootloader configuration declaration.
 @cindex BIOS, bootloader
 The bootloader to use, as a @code{bootloader} object.  For now
 @code{grub-bootloader}, @code{grub-efi-bootloader},
-@code{grub-efi-netboot-bootloader}, @code{extlinux-bootloader} and
-@code{u-boot-bootloader} are supported.
+@code{grub-efi-netboot-bootloader}, @code{grub-efi-removable-bootloader},
+@code{extlinux-bootloader} and @code{u-boot-bootloader} are supported.

 @cindex ARM, bootloaders
 @cindex AArch64, bootloaders
@@ -36352,6 +36353,20 @@ NFS servers, you also need a properly configured DHCP server to make the booting
 over netboot possible.  For all this we can currently only recommend you to look
 for instructions about @acronym{PXE, Preboot eXecution Environment}.

+@vindex grub-efi-removable-bootloader
+@code{grub-efi-removable-bootloader} allows you to boot your system from
+removable media by writing the GRUB file to the UEFI-specification location of
+@file{/EFI/BOOT/BOOTX64.efi} of the boot directory, usually @file{/boot/efi}.
+This is also useful for some UEFI firmwares that ``forget'' their configuration
+from their non-volatile storage. Like @code{grub-efi-bootloader}, this can only
+be used if the @file{/sys/firmware/efi} directory is available.
+
+@quotation Note
+This @emph{will} overwrite the GRUB file from any other operating systems that
+also place their GRUB file in the UEFI-specification location; making them
+unbootable.
+@end quotation
+
 @item @code{targets}
 This is a list of strings denoting the targets onto which to install the
 bootloader.
@@ -36360,7 +36375,8 @@ The interpretation of targets depends on the bootloader in question.
 For @code{grub-bootloader}, for example, they should be device names
 understood by the bootloader @command{installer} command, such as
 @code{/dev/sda} or @code{(hd0)} (@pxref{Invoking grub-install,,, grub,
-GNU GRUB Manual}).  For @code{grub-efi-bootloader}, they should be mount
+GNU GRUB Manual}).  For @code{grub-efi-bootloader} and
+@code{grub-efi-removable-bootloader} they should be mount
 points of the EFI file system, usually @file{/boot/efi}.  For
 @code{grub-efi-netboot-bootloader}, @code{targets} should be the mount
 points corresponding to TFTP root directories served by your TFTP

base-commit: f47dce686a57e5eb793003e37101df63b5eb37ae
--
2.36.1




Information forwarded to guix-patches@HIDDEN:
bug#55631; Package guix-patches. Full text available.

Message received at 55631 <at> debbugs.gnu.org:


Received: (at 55631) by debbugs.gnu.org; 3 Jun 2022 21:27:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jun 03 17:27:26 2022
Received: from localhost ([127.0.0.1]:57133 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nxEpK-0006YJ-Ot
	for submit <at> debbugs.gnu.org; Fri, 03 Jun 2022 17:27:26 -0400
Received: from eggs.gnu.org ([209.51.188.92]:60960)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1nxEpJ-0006Y0-B4
 for 55631 <at> debbugs.gnu.org; Fri, 03 Jun 2022 17:27:25 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:34396)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1nxEpD-0000Mm-Tb; Fri, 03 Jun 2022 17:27:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To:
 From; bh=WxqwErJF1I2pXaCTAh2qm4h7ACHb2wF7kwG3Z3PKUuk=; b=Og8Bt9NUPSrz84eSzXGt
 oEpA49j2VisB0OaUbvIvUT+nAp75ytoINoVPkMF1FvAXXMXDKO07lfMCvegLk+RKm1U1TbdWl/ti/
 9lJJ6G6kZ6e8AfURIIXtYQ8VQ5dRKbxTDHBJilsVLBAxtOnJBv+u8b8KAbgLTsMXLfgxsqIvc9JNy
 4WWA+EPWDysnvOS+NXi+NJIIG9Deb1S8V+gjSZDFJB1C/5rxYJUZicjRLH7VcaeKPIPDv80BtadMn
 EuliIrz115Y+YoAY7+LOjpXLWfwScSj/SBQ829v5Ql9DBT1nPnQ4TfePF616h60YvE9e3PmfR+scE
 I4YSyvmy3P97oA==;
Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:55226
 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1nxEpD-00008z-Gw; Fri, 03 Jun 2022 17:27:19 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Karl Hallsby <karl@HIDDEN>
Subject: Re: bug#55631: [PATCH] gnu: grub: add removable grub-efi bootloader
 option
References: <20220525043254.62715-1-karl@HIDDEN>
Date: Fri, 03 Jun 2022 23:27:17 +0200
In-Reply-To: <20220525043254.62715-1-karl@HIDDEN> (Karl Hallsby's message
 of "Tue, 24 May 2022 23:32:54 -0500")
Message-ID: <87tu91h1ze.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 55631
Cc: 55631 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

Karl Hallsby <karl@HIDDEN> skribis:

> For single-disk installs (external USBs) and for amnesiac UEFIs, Guix is =
not
> found using its default Grub EFI bootloader location of
> /boot/efi/EFI/Guix/grubx64.efi means the Guix install will not be found.
>
> To handle this, we can place the bootloader file in the UEFI specification
> location, overwriting any other OS that may have placed a file there. This
> location is namely /boot/efi/EFI/BOOT/BOOTX64.efi. Grub has explicit supp=
ort
> for this location/situation with the `--removable` flag.

Interesting.  The patch LGTM; one last thing: could you add a couple of
lines in doc/guix.texi, under =E2=80=9CBootloader Configuration=E2=80=9D (n=
ext to where
=E2=80=98grub-efi-netboot-bootloader=E2=80=99 is described) describing
=E2=80=98grub-efi-removable-bootloader=E2=80=99?

With that in place, we should be all set.

Thanks in advance,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#55631; Package guix-patches. Full text available.

Message received at 55631 <at> debbugs.gnu.org:


Received: (at 55631) by debbugs.gnu.org; 26 May 2022 20:14:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 26 16:14:40 2022
Received: from localhost ([127.0.0.1]:60088 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1nuJsW-0002ej-CX
	for submit <at> debbugs.gnu.org; Thu, 26 May 2022 16:14:40 -0400
Received: from mail-yb1-f178.google.com ([209.85.219.178]:46844)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <karl@HIDDEN>) id 1nuJsU-0002eU-LX
 for 55631 <at> debbugs.gnu.org; Thu, 26 May 2022 16:14:39 -0400
Received: by mail-yb1-f178.google.com with SMTP id y141so4617632ybe.13
 for <55631 <at> debbugs.gnu.org>; Thu, 26 May 2022 13:14:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hallsby-com.20210112.gappssmtp.com; s=20210112;
 h=mime-version:from:date:message-id:subject:to;
 bh=6fRbhasCUqiLcL6ZmHeaLWFN+dHHWtCldRRcFwmPkEQ=;
 b=3wNXM6Sk3tIqaHoKucYcGLSPruphSOmLXnSbHZEQD81JGxmOjoMmuyAxlrIBRMQ/Rb
 icYyErSB25GBfhYbh5ZLUp4hcQDXIercevpH2aeW+AD1ebafpUKUNzed6wUMiq031uPb
 RGV+wGTPsGv1kVEcuBM1lIDHZLLz+Hj9WJDc585v8gIq3F4mKTAC8qoUHuBOKEiGBSXu
 lAdB1rtEbU6kHw4f3WAj068pctpE6GBVd+TFnaNueXxvjtmB9UGShrgV1jShQ6RTwCIn
 K7vL6EZpv3bPlA8ZWa5vCxVkP82G27ZliQH5lFmJn9WcecU7iUjT+urm90/N3mn+TOJu
 7qgQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=6fRbhasCUqiLcL6ZmHeaLWFN+dHHWtCldRRcFwmPkEQ=;
 b=Jph0W4q8ZzFD0e2i+IR34iMiVtNWwgA4wRG5ZtRss8adfETCoTbuc80Z/Cbwt6KwF6
 CFA4nUkvmxcOp9pV2USwwKaRgyfaHwFh+tdQ0h/bgzhccZ0aJKcqCXxUtID1iJChJF27
 bxCnaFPbGHnpBrNIYnqGurpq2aDymOFgV8v9cqkc+1G6E42eo6ZLjtcGTqQx0P7WcTsy
 EsazqHdKn+q4fjkVK5AYbTInZvoL1UxwC4edlzGJ/3JMZQT4svMPmMMr4xV+ilQM7NTA
 iCqwEDG8AovVUyYGt0GuDGYayjPhpaQN0RdNOLrWZOkuTLgLNKJJR1aOk7R76TjT7TbW
 UsqA==
X-Gm-Message-State: AOAM533vi6dMBwXoGEKGaWYSU8xjbKxBocBMyDACCYJ4G/+0hdw6zX9r
 Te3Tn4krXQPIXCF1gTQ6b/f01MErcCe/ImP22D82/iNQkP0=
X-Google-Smtp-Source: ABdhPJzDk2ibHu3hyFM0vaxUDM0kU74Wpog5ozFgao9wcpOAeg9d2a6YWCeTfprzUlVIsx0js2C86cJqKFXfvcELiuQ=
X-Received: by 2002:a25:9291:0:b0:64f:6ea6:af6c with SMTP id
 y17-20020a259291000000b0064f6ea6af6cmr28008526ybl.53.1653596073035; Thu, 26
 May 2022 13:14:33 -0700 (PDT)
MIME-Version: 1.0
From: Karl Hallsby <karl@HIDDEN>
Date: Thu, 26 May 2022 15:14:22 -0500
Message-ID: <CAE15YfsqsEGgqdaVbkOTf1HJYjYcaL3ZQWk_o3i4Qxr6zev8cg@HIDDEN>
Subject: 
To: 55631 <at> debbugs.gnu.org
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 2.0 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: This was only tested in virtual machines or on disk images.
 But this has been running on my actual hardware for the past few days, and
 has been working fine, including when unplugging and replugging t [...] 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 SPF_NONE               SPF: sender does not publish an SPF Record
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.219.178 listed in list.dnswl.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.219.178 listed in wl.mailspike.net]
 2.0 BLANK_SUBJECT          Subject is present but empty
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 55631
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

This was only tested in virtual machines or on disk images. But this
has been running on my actual hardware for the past few days, and has
been working fine, including when unplugging and replugging the
device. The BIOS/UEFI properly picks up the drive/boot file and load
Guix.




Information forwarded to guix-patches@HIDDEN:
bug#55631; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 May 2022 14:03:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 25 10:03:34 2022
Received: from localhost ([127.0.0.1]:56135 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ntrbm-0008J4-Ov
	for submit <at> debbugs.gnu.org; Wed, 25 May 2022 10:03:34 -0400
Received: from lists.gnu.org ([209.51.188.17]:59668)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <karl@HIDDEN>) id 1ntihu-0006yy-1U
 for submit <at> debbugs.gnu.org; Wed, 25 May 2022 00:33:15 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42528)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <karl@HIDDEN>) id 1ntiht-0000Ol-LZ
 for guix-patches@HIDDEN; Wed, 25 May 2022 00:33:13 -0400
Received: from mail-qv1-xf2c.google.com ([2607:f8b0:4864:20::f2c]:46719)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <karl@HIDDEN>) id 1ntihr-0002o7-0s
 for guix-patches@HIDDEN; Wed, 25 May 2022 00:33:13 -0400
Received: by mail-qv1-xf2c.google.com with SMTP id a5so22983qvt.13
 for <guix-patches@HIDDEN>; Tue, 24 May 2022 21:33:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=hallsby-com.20210112.gappssmtp.com; s=20210112;
 h=from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=UkVS0EkiSlahKPYfZqBv0R64tVxIYZOpcAGSO6m/SSY=;
 b=FW/pE+BUIxs/j6HGCVDXx3PgbfCfEF96utoVfIEswbGAhgu3SFznajVV8voWXlbEZM
 F+/DqKqPnTNG26gSmQr038ZINxEl82hjCucY6EZinAzaWazHFJJB4Zi/cNT/gY0ux0cf
 bD7cP8z4KyYfz/7fcv33b/v6xY29wcZfZosVe5tKarnoV97UQd3G2bUbj+YBnO2hmvGW
 69IoruOWoYlWp7C7ZyeMpBdW51l68ODhGys57abBa+G9E4lBoBDUHiYcoX/8KvCMGtF+
 8h4t1pQyjIuQIOHnPgjK4mK39SaG/wuZ6r5NlJsiwA3ApKqhJ2d3CSanbmKCDEK862+L
 MGlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version
 :content-transfer-encoding;
 bh=UkVS0EkiSlahKPYfZqBv0R64tVxIYZOpcAGSO6m/SSY=;
 b=QnrjGfNVuY4Mysq3qrH0Fk5rzX53D34w+gHISx1OxoAFKfzy8/jmM0xcRgBlTuAwrB
 tGdNNpT9YzFixRHijZ1yAuHy+aj93lU3wEM4eyMLMHzK/0ZWwiTK5T6/cHuoXVf/B3d7
 CgrOhkqEzZNZ7RBLIFNLci7XLb8+GO4ohCIUYCqCiWOQYtvAL4BaGE3GrIbZ1XEOAHUf
 8Fr4MQp1B309oEw+oRFiH9mUSExKRsD5gD4IdV3YylQBnfEfAZj1cEkvHXrIcCr2Pql/
 8L35mv2Zyu0pS0L6AJSq8qUZXBKkzNj5CVFoz/88FwyNoDN40atCDd1YKJxDyUMtvCmg
 d7ow==
X-Gm-Message-State: AOAM530paMEYRroJSSr9/G2pi198rIO1VJC8wIJRSaZgQ6NF0GXtw5bi
 i7kf6E04QAx1IZC7dmoRFSM0Bv5QsID82w==
X-Google-Smtp-Source: ABdhPJwuuJF2d87DZ62TSp4xWPEE4Zyk8R0WJw1tCrkaKULgyz4dljJ6LDhAzWlDLlhs+vA/PmjI0Q==
X-Received: by 2002:a05:6214:2485:b0:462:4bf3:a817 with SMTP id
 gi5-20020a056214248500b004624bf3a817mr7759641qvb.82.1653453189434; 
 Tue, 24 May 2022 21:33:09 -0700 (PDT)
Received: from localhost.localdomain
 (1459483-v115.1145-static.batvilaa.metronetinc.net. [192.69.181.148])
 by smtp.gmail.com with ESMTPSA id
 x1-20020a05620a0ec100b0069fc13ce1e9sm640241qkm.26.2022.05.24.21.33.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 24 May 2022 21:33:09 -0700 (PDT)
From: Karl Hallsby <karl@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH] gnu: grub: add removable grub-efi bootloader option
Date: Tue, 24 May 2022 23:32:54 -0500
Message-Id: <20220525043254.62715-1-karl@HIDDEN>
X-Mailer: git-send-email 2.36.1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: none client-ip=2607:f8b0:4864:20::f2c;
 envelope-from=karl@HIDDEN; helo=mail-qv1-xf2c.google.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 25 May 2022 10:03:28 -0400
Cc: Karl Hallsby <karl@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

For single-disk installs (external USBs) and for amnesiac UEFIs, Guix is not
found using its default Grub EFI bootloader location of
/boot/efi/EFI/Guix/grubx64.efi means the Guix install will not be found.

To handle this, we can place the bootloader file in the UEFI specification
location, overwriting any other OS that may have placed a file there. This
location is namely /boot/efi/EFI/BOOT/BOOTX64.efi. Grub has explicit support
for this location/situation with the `--removable` flag.
---
 gnu/bootloader/grub.scm | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/gnu/bootloader/grub.scm b/gnu/bootloader/grub.scm
index 120cd55012..65d7171432 100644
--- a/gnu/bootloader/grub.scm
+++ b/gnu/bootloader/grub.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@HIDDEN>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
 ;;; Copyright © 2020 Stefan <stefan-guix@HIDDEN>
+;;; Copyright © 2022 Karl Hallsby <karl@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -50,10 +51,12 @@ (define-module (gnu bootloader grub)
             grub-theme-color-highlight
             grub-theme-gfxmode
 
+            install-grub-efi-removable
             install-grub-efi-netboot
 
             grub-bootloader
             grub-efi-bootloader
+            grub-efi-removable-bootloader
             grub-efi-netboot-bootloader
             grub-mkrescue-bootloader
             grub-minimal-bootloader
@@ -608,6 +611,31 @@ (define install-grub-efi
                         "--bootloader-id=Guix"
                         "--efi-directory" target-esp)))))
 
+(define install-grub-efi-removable
+  #~(lambda (bootloader efi-dir mount-point)
+      ;; NOTE: mount-point is /mnt in guix system init /etc/config.scm /mnt/point
+      ;; NOTE: efi-dir comes from target list of booloader configuration
+      ;; There is nothing useful to do when called in the context of a disk
+      ;; image generation.
+      (when efi-dir
+        ;; Install GRUB onto the EFI partition mounted at EFI-DIR, for the
+        ;; system whose root is mounted at MOUNT-POINT.
+        (let ((grub-install (string-append bootloader "/sbin/grub-install"))
+              (install-dir (string-append mount-point "/boot"))
+              ;; When installing Guix, it's common to mount EFI-DIR below
+              ;; MOUNT-POINT rather than /boot/efi on the live image.
+              (target-esp (if (file-exists? (string-append mount-point efi-dir))
+                              (string-append mount-point efi-dir)
+                              efi-dir)))
+          ;; Tell 'grub-install' that there might be a LUKS-encrypted /boot or
+          ;; root partition.
+          (setenv "GRUB_ENABLE_CRYPTODISK" "y")
+          (invoke/quiet grub-install "--boot-directory" install-dir
+                        "--removable"
+                        ;; "--no-nvram"
+                        "--bootloader-id=Guix"
+                        "--efi-directory" target-esp)))))
+
 (define (install-grub-efi-netboot subdir)
   "Define a grub-efi-netboot bootloader installer for installation in SUBDIR,
 which is usually efi/Guix or efi/boot."
@@ -734,6 +762,12 @@ (define grub-efi-bootloader
    (name 'grub-efi)
    (package grub-efi)))
 
+(define grub-efi-removable-bootloader
+  (bootloader
+   (inherit grub-efi-bootloader)
+   (name 'grub-efi-removable-bootloader)
+   (installer install-grub-efi-removable)))
+
 (define grub-efi-netboot-bootloader
   (bootloader
    (inherit grub-efi-bootloader)

base-commit: d129d962e437fd215c5e9428fc1b26e2d72ffbda
-- 
2.36.1





Acknowledgement sent to Karl Hallsby <karl@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#55631; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 5 Jun 2022 14:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.