GNU bug report logs - #67109
‘efi32-esp’ image support pulls in host-side code

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; Reported by: Ludovic Courtès <ludovic.courtes@HIDDEN>; dated Sat, 11 Nov 2023 15:47:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at submit <at>

Received: (at submit) by; 11 Nov 2023 15:46:11 +0000
From debbugs-submit-bounces <at> Sat Nov 11 10:46:11 2023
Received: from localhost ([]:54005
	by with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at>>)
	id 1r1qBX-0004mW-0L
	for submit <at>; Sat, 11 Nov 2023 10:46:11 -0500
Received: from ([2001:470:142::17]:37644)
 by with esmtp (Exim 4.84_2)
 (envelope-from <ludovic.courtes@HIDDEN>) id 1r1qBU-0004kk-Pu
 for submit <at>; Sat, 11 Nov 2023 10:46:09 -0500
Received: from ([2001:470:142:3::10])
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludovic.courtes@HIDDEN>)
 id 1r1qAi-0004RG-GN
 for bug-guix@HIDDEN; Sat, 11 Nov 2023 10:45:21 -0500
Received: from ([])
 by with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludovic.courtes@HIDDEN>)
 id 1r1qAg-0007aJ-Cf
 for bug-guix@HIDDEN; Sat, 11 Nov 2023 10:45:20 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=dc;
 BOPh6ztqCKi7DOw3VVb5hXffbo4TcPnrzKB8SQ4bCacu36h5eRQRiipck 0=;
 dkim=none (message not signed) header.i=none;
 spf=SoftFail smtp.mailfrom=ludovic.courtes@HIDDEN;
 dmarc=fail (p=none dis=none)
X-IronPort-AV: E=Sophos;i="6.03,295,1694728800"; d="scan'208";a="135854899"
Received: from (HELO ribbon) ([])
 by with
 ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2023 16:45:12 +0100
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludovic.courtes@HIDDEN>
To: bug-guix@HIDDEN
Subject: =?utf-8?B?4oCYZWZpMzItZXNw4oCZ?= image support pulls in host-side code
User-Agent: Gnus/5.13 (Gnus v5.13)
X-Debbugs-Cc: Mathieu Othacehe <othacehe@HIDDEN>, Denis 'GNUtoo' Carikli
X-Revolutionary-Date: Primidi 21 Brumaire an 232 de la =?utf-8?Q?R=C3=A9vo?=
 =?utf-8?Q?lution=2C?= jour de la Bacchante
X-PGP-Key-ID: 0x090B11993D9AEBB5
X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4  0CFB 090B 1199 3D9A EBB5
X-OS: x86_64-pc-linux-gnu
Date: Sat, 11 Nov 2023 16:45:09 +0100
Message-ID: <874jhs1egq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=;
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at>
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <>
List-Unsubscribe: <>, 
 <mailto:debbugs-submit-request <at>>
List-Archive: <>
List-Post: <mailto:debbugs-submit <at>>
List-Help: <mailto:debbugs-submit-request <at>>
List-Subscribe: <>, 
 <mailto:debbugs-submit-request <at>>
Errors-To: debbugs-submit-bounces <at>
Sender: "Debbugs-submit" <debbugs-submit-bounces <at>>
X-Spam-Score: -0.0 (/)

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable


I noticed that 62c86c8391ceb8953ca972498fd75ea9298b85ff pulls in
host-side code on the =E2=80=9Cbuild side=E2=80=9D, via (guix utils), meani=
ng that the
closure of the (gnu build image) module would now include 80 modules.

This change also introduces uses of =E2=80=98target-x86?=E2=80=99 and =E2=
=80=98target-arm?=E2=80=99 on
the build side that are unlikely to have the intended effect because the
check is then done based on the native system type when running the
build process.  Last, the =E2=80=98cond=E2=80=99 form in that commit lacks =
an =E2=80=98else=E2=80=99

Thus I=E2=80=99m proposing the fix below.  How can I test it though?  I get:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix system image -t efi32-raw gnu/system/examples/bare-bo=
guix system: error: EFI bootloader required with GPT partitioning
--8<---------------cut here---------------end--------------->8---

Thanks in advance!


Content-Type: text/x-patch; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 49dc01c0d1..63262a4ffe 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovi=
c Court=C3=A8s <ludo@HIDDEN>
+;;; Copyright =C2=A9 2013-2020, 2023 Ludovic Court=C3=A8s <ludo@HIDDEN>
 ;;; Copyright =C2=A9 2016 Christine Lemmer-Webber <cwebber@HIDDEN>
 ;;; Copyright =C2=A9 2016, 2017 Leo Famulari <leo@HIDDEN>
 ;;; Copyright =C2=A9 2017 Marius Bakke <mbakke@HIDDEN>
@@ -29,7 +29,6 @@ (define-module (gnu build image)
   #:use-module (guix build syscalls)
   #:use-module (guix build utils)
   #:use-module (guix store database)
-  #:use-module (guix utils)
   #:use-module (gnu build bootloader)
   #:use-module (gnu build install)
   #:use-module (gnu build linux-boot)
@@ -191,13 +190,11 @@ (define* (initialize-efi-partition root
 (define* (initialize-efi32-partition root
+                                     grub-targets
   "Install in ROOT directory, an EFI 32bit loader using GRUB-EFI32."
   (install-efi-loader grub-efi32 root
-                      #:targets (cond ((target-x86?)
-                                       '("i386-efi" . "BOOTIA32.EFI"))
-                                      ((target-arm?)
-                                       '("arm-efi" . "BOOTARM.EFI")))))
+                      #:targets grub-targets))
 (define* (initialize-root-partition root
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index a990c4f861..49d4287a74 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -136,7 +136,17 @@ (define esp-partition
 (define esp32-partition
    (inherit esp-partition)
-   (initializer (gexp initialize-efi32-partition))))
+   (initializer
+    (let-system (system target)
+      (let ((targets (cond ((target-x86? (or target system))
+                            #~'("i386-efi" . "BOOTIA32.EFI"))
+                           ((target-arm? (or target system))
+                            #~'("arm-efi" . "BOOTARM.EFI"))
+                           (else #f))))
+        #~(lambda (root . args)
+            (apply initialize-efi32-partition root
+                   #:grub-targets #$targets
+                   args)))))))
 (define root-partition


Acknowledgement sent to Ludovic Courtès <ludovic.courtes@HIDDEN>:
New bug report received and forwarded. Copy sent to othacehe@HIDDEN, GNUtoo@HIDDEN, bug-guix@HIDDEN. Full text available.
Report forwarded to othacehe@HIDDEN, GNUtoo@HIDDEN, bug-guix@HIDDEN:
bug#67109; Package guix. 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: Sat, 11 Nov 2023 16:00:02 UTC

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