From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 11 10:46:11 2023 Received: (at submit) by debbugs.gnu.org; 11 Nov 2023 15:46:11 +0000 Received: from localhost ([127.0.0.1]:54005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1qBX-0004mW-0L for submit@debbugs.gnu.org; Sat, 11 Nov 2023 10:46:11 -0500 Received: from lists.gnu.org ([2001:470:142::17]:37644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r1qBU-0004kk-Pu for submit@debbugs.gnu.org; Sat, 11 Nov 2023 10:46:09 -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 1r1qAi-0004RG-GN for bug-guix@gnu.org; Sat, 11 Nov 2023 10:45:21 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1qAg-0007aJ-Cf for bug-guix@gnu.org; Sat, 11 Nov 2023 10:45:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:mime-version; bh=ql+ncHpbI/ABquV28S2OoVXo5WYbfv53BhqHph+sNvM=; b=AX+IhguMwzA5l8Omn3lpF9qSnmI0mlnf5QIFeqIHk5r60QfkIpWGVA8h dlHunL656Yw8unL4OKDtuN7tLKSYtc7uVz2jz/jHwvi9s/ebZh8C+Wt9L BOPh6ztqCKi7DOw3VVb5hXffbo4TcPnrzKB8SQ4bCacu36h5eRQRiipck 0=; Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=ludovic.courtes@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.03,295,1694728800"; d="scan'208";a="135854899" Received: from vpn-0-27.aquilenet.fr (HELO ribbon) ([185.233.101.27]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2023 16:45:12 +0100 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org 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 , Denis 'GNUtoo' Carikli X-URL: http://www.fdn.fr/~lcourtes/ 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-Key: http://www.fdn.fr/~lcourtes/ludovic.asc 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@inria.fr> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=192.134.164.83; envelope-from=ludovic.courtes@inria.fr; helo=mail2-relais-roc.national.inria.fr 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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, 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 clause. 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= nes.tmpl guix system: error: EFI bootloader required with GPT partitioning --8<---------------cut here---------------end--------------->8--- Thanks in advance! Ludo=E2=80=99. --=-=-= 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 +;;; Copyright =C2=A9 2013-2020, 2023 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2016 Christine Lemmer-Webber ;;; Copyright =C2=A9 2016, 2017 Leo Famulari ;;; Copyright =C2=A9 2017 Marius Bakke @@ -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 #:key grub-efi32 + grub-targets #:allow-other-keys) "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)) =20 (define* (initialize-root-partition root #:key 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 (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))))))) =20 (define root-partition (partition --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 14 15:53:34 2023 Received: (at 67109) by debbugs.gnu.org; 14 Nov 2023 20:53:34 +0000 Received: from localhost ([127.0.0.1]:34242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r30Pe-0007tm-AG for submit@debbugs.gnu.org; Tue, 14 Nov 2023 15:53:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r30Pc-0007tY-IP for 67109@debbugs.gnu.org; Tue, 14 Nov 2023 15:53:33 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r30Ol-0006VI-J7; Tue, 14 Nov 2023 15:52:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=YrdTdoo2UxWKHM5WPU2wImo2bxvAPjhh2TJZRDOqO5c=; b=R34Fowoi25L9n7+98UlQ 2DAqvOMC6Qa+UanTUGUv603sS+Lp7x5ejm4LWixNIPhSIB+n0Lv4qGJqp/CB2Uls7+ubnUyMDVyBR zRh2eubqWVXuvUqNFeh+517pCrnGc4QpA0+aSgDru2AptO1I7pQ0iKGDn9XA5Hj7ZULuiuDCFQTS3 5YHfmRv28ZA/HvQL5Xm+x7jOfeuRiXBBaPgMiWFG+NEJwCXdeA0+Y2jhJVr/wN+NtukNcKsdDRHQN dNMgFidxzFXMbSMYSKgU4rNeBM1zd3TP+ecHMNjYT1pAhfPMxbm45TSvwerbrpqkh19joigzDJVW0 kEXQTXDpr8UhDg==; From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#67109: =?utf-8?B?4oCYZWZpMzItZXNw4oCZ?= image support pulls in host-side code In-Reply-To: <874jhs1egq.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Sat, 11 Nov 2023 16:45:09 +0100") References: <874jhs1egq.fsf@inria.fr> Date: Tue, 14 Nov 2023 21:52:35 +0100 Message-ID: <871qcskqgc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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: 67109 Cc: 67109@debbugs.gnu.org, Denis 'GNUtoo' Carikli X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey, Thanks for investigating this! > Thus I=E2=80=99m proposing the fix below. How can I test it though? I g= et: > > $ ./pre-inst-env guix system image -t efi32-raw gnu/system/examples/bare-= bones.tmpl > guix system: error: EFI bootloader required with GPT partitioning I added this check recently because we do not currently support installing the `grub-bootloader` on a non-MBR disk. The way to test your change is to switch the bare-bones system bootloader to `grub-efi-bootloader`, this way: --8<---------------cut here---------------start------------->8--- diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare= -bones.tmpl index dc6aff5273..e11d4bd5ee 100644 --- a/gnu/system/examples/bare-bones.tmpl +++ b/gnu/system/examples/bare-bones.tmpl @@ -18,8 +18,9 @@ ;; target hard disk, and "my-root" is the label of the target ;; root file system. (bootloader (bootloader-configuration - (bootloader grub-bootloader) - (targets '("/dev/sdX")))) + (bootloader grub-efi-bootloader) + (targets '("/boot/efi")))) --8<---------------cut here---------------end--------------->8--- We then have the following error: --8<---------------cut here---------------start------------->8--- guix system: error: #:out> args)) gnu/system= /image.scm:146:8 7fef96f85360>: invalid G-expression input --8<---------------cut here---------------end--------------->8--- Mathieu From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 25 09:33:57 2023 Received: (at 67109) by debbugs.gnu.org; 25 Nov 2023 14:33:57 +0000 Received: from localhost ([127.0.0.1]:38236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6tjJ-0001E7-1H for submit@debbugs.gnu.org; Sat, 25 Nov 2023 09:33:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6tjF-0001Ds-Rp for 67109@debbugs.gnu.org; Sat, 25 Nov 2023 09:33:56 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r6tiy-0006ez-Jj; Sat, 25 Nov 2023 09:33:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=dNUHOTNgYWcGQcTOz2e4VIKq3EErUb1+/Ftc3gKl6Uc=; b=MIFW3AupB7FpLHfht5Jf dK/JH7Xgj2Bu4H3Ihmgrp5IVVh881PaM2KdAhRPRHoHySAztDx1Zk6VlM38yDLDrjEtLCEZI49/AO hMJrmdCP9AVW4rDj5uV2pxk0xhWBaL+qKJY1BCDZuTQStEumL/CCRR8Jg+0cIIAtBtXu5Ghyfr2YB IUU7lr8JmDQ+BytD7D30p/HttnYXu27Iditn0szKkocSsdslLhjdLVnjonaWlZYa+rLsU0FuG6siH UOrkB9lY4Lz2UbxRquSzK7/UQqS0V1TEnBHC/Y7CIvxxIMe8BwODEmBqhr0X9kWdo2epYmgFxNi5O SJYE+zK54QmylQ==; From: Mathieu Othacehe To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#67109: =?utf-8?B?4oCYZWZpMzItZXNw4oCZ?= image support pulls in host-side code In-Reply-To: <871qcskqgc.fsf@gnu.org> (Mathieu Othacehe's message of "Tue, 14 Nov 2023 21:52:35 +0100") References: <874jhs1egq.fsf@inria.fr> <871qcskqgc.fsf@gnu.org> Date: Sat, 25 Nov 2023 15:33:33 +0100 Message-ID: <87bkbhucle.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67109 Cc: 67109@debbugs.gnu.org, Denis 'GNUtoo' Carikli X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello, > guix system: error: # initialize-efi32-partition root #:grub-targets # (quote ("i386-efi" . "BOOTIA32.EFI")) gnu/system/image.scm:142:28 > 7fef96f85390>:out> args)) gnu/system/image.scm:146:8 7fef96f85360>: > invalid G-expression input Expressed that way, I no longer have this error and `target` seems to take the expected value, WDYT? --8<---------------cut here---------------start------------->8--- (define esp32-partition (partition (inherit esp-partition) (initializer #~(lambda (root . args) (let ((targets '#$(let-system (system target) (cond ((target-x86? (or target system)) '("i386-efi". "BOOTIA32.EFI")) ((target-arm? (or target system)) '("arm-efi" . "BOOTARM.EFI")) (else #f))))) (apply initialize-efi32-partition root #:grub-targets targets args)))))) --8<---------------cut here---------------end--------------->8--- Thanks, Mathieu From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 27 04:08:07 2023 Received: (at 67109) by debbugs.gnu.org; 27 Nov 2023 09:08:07 +0000 Received: from localhost ([127.0.0.1]:43215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7Xb4-0006TZ-Rp for submit@debbugs.gnu.org; Mon, 27 Nov 2023 04:08:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r7Xb0-0006T2-Fh for 67109@debbugs.gnu.org; Mon, 27 Nov 2023 04:08:05 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7Xaj-0001x8-9h; Mon, 27 Nov 2023 04:07:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=Gujm/4h1ZGbw/zE+7+z94q2vFx5FliRCWYKq2cR8bJo=; b=YaeM9INKwsxoxYKL0WQM JoTHkeVcAlwVbFN5/fm9jlGNzBTBBDPaanvGaufwSXAVYHMQwX38HzfQcnTt0Tir50ltSIyzrE0PW Iy0VVO7DyrxMcDfz9bDhrzC4uZkfD3ZSDbX7NV+x8wiV0jMtoMe1xHRheGbiYqTtGmssFLTyvf+u1 QQNoBdDmLjcIEQW6t4M3OlDMjUrDXxfKKDsmxngvgmtlI6k0JF50JE2H6jsKldrlH5FyL1YUgxA7o aUSBpgU7xhRrrkZTlgVqqCwYRd1nVLm9bwEEkosLjx3JF4ce/P8d/5ET/UqKhLsrq0GO0Ht9DJ6vg QMiOTa/WYAGn4A==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Mathieu Othacehe Subject: Re: bug#67109: =?utf-8?B?4oCYZWZpMzItZXNw4oCZ?= image support pulls in host-side code In-Reply-To: <87bkbhucle.fsf@gnu.org> (Mathieu Othacehe's message of "Sat, 25 Nov 2023 15:33:33 +0100") References: <874jhs1egq.fsf@inria.fr> <871qcskqgc.fsf@gnu.org> <87bkbhucle.fsf@gnu.org> Date: Mon, 27 Nov 2023 10:07:40 +0100 Message-ID: <87zfyzy36r.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) 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: 67109 Cc: 67109@debbugs.gnu.org, Denis 'GNUtoo' Carikli X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Mathieu Othacehe skribis: >> guix system: error: #> initialize-efi32-partition root #:grub-targets #> (quote ("i386-efi" . "BOOTIA32.EFI")) gnu/system/image.scm:142:28 >> 7fef96f85390>:out> args)) gnu/system/image.scm:146:8 7fef96f85360>: >> invalid G-expression input > > Expressed that way, I no longer have this error and `target` seems to > take the expected value, WDYT? > > (define esp32-partition > (partition > (inherit esp-partition) > (initializer > #~(lambda (root . args) > (let ((targets '#$(let-system (system target) > (cond ((target-x86? (or target system)) > '("i386-efi". "BOOTIA32.EFI")) > ((target-arm? (or target system)) > '("arm-efi" . "BOOTARM.EFI")) > (else #f))))) > (apply initialize-efi32-partition root > #:grub-targets targets > args)))))) Am I right that it breaks if we do: (let ((targets #$(let-system =E2=80=A6 #~'("i386-efi". "BOOTIA32.EFI")))) =E2=80=A6) ? That would be the =E2=80=9Ccorrect=E2=80=9D way to do it, but the problem i= s that the body of =E2=80=98let-system=E2=80=99 is supposed to evaluate to a file-like= object, which is not what we=E2=80=99re trying to do here. Hmm, annoying. Thanks, Ludo=E2=80=99.