GNU logs - #73202, boring messages


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] guix: scripts: Rewrite reinstall-bootloader to use provenance data.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 12 Sep 2024 17:00:02 +0000
Resent-Message-ID: <handler.73202.B.172616037519089 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
X-Debbugs-Original-To: guix-patches@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.172616037519089
          (code B ref -1); Thu, 12 Sep 2024 17:00:02 +0000
Received: (at submit) by debbugs.gnu.org; 12 Sep 2024 16:59:35 +0000
Received: from localhost ([127.0.0.1]:41768 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sonAN-0004xo-34
	for submit <at> debbugs.gnu.org; Thu, 12 Sep 2024 12:59:35 -0400
Received: from lists.gnu.org ([209.51.188.17]:40292)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1sonAK-0004xe-Pg
 for submit <at> debbugs.gnu.org; Thu, 12 Sep 2024 12:59:33 -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 <herman@HIDDEN>) id 1sonAC-0004dl-Ao
 for guix-patches@HIDDEN; Thu, 12 Sep 2024 12:59:24 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]
 helo=email.rimm.ee)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <herman@HIDDEN>) id 1sonA6-00012N-06
 for guix-patches@HIDDEN; Thu, 12 Sep 2024 12:59:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726160350;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=btJc+SU6FN0iMlsaQoLpdEQ1FwpzFtHgI5jaCelZEjY=;
 b=lbrtjeULBwQXoe6UkSeKOl9B4aAtGLzVXSG91aTlTifX9UyfxMifItv3sRBpCJEU4g7V9c
 kD9od0A0scjUQYEyJlUf6fi2ukj5GwE+/pfyonh9u9aifPc9OvCymU0xL30NOfCZZaAAXA
 5Xp97qYEohkxlcZtpk1FCNkixhdbnhQNwFcjtmpvOgOQ7R0q3zaBtg97p9pryqvnV9h841
 eAqz1WD9OMNntCVHjb+KGt2OSF0GwB2E/GfOSkAOBS4hqinoGa1gP5I2Ivj9RFJAGF9vte
 aUpb6CfUltpinCu7T508CgnaBhEk4WJjWoye/AqF2U/deYRkZQ3t/i/NHFjQ7g==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 9baf5441
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 12 Sep 2024 16:59:09 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 12 Sep 2024 18:58:17 +0200
Message-ID: <20240912165818.21580-1-herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=81.205.150.117; envelope-from=herman@HIDDEN;
 helo=email.rimm.ee
X-Spam_score_int: 16
X-Spam_score: 1.6
X-Spam_bar: +
X-Spam_report: (1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1,
 DKIM_SIGNED=0.1, RCVD_IN_PBL=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 TVD_RCVD_IP=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
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: -2.4 (--)

From: Lilah Tascheter <lilah@HIDDEN>

Looking up bootloaders by name is broken because (extlinux) bootloaders
share a name.  Also, bootloader-configuration data is significant to
bootloader installation, so it shouldn't just use the default values.
Installation can rely on the provenance service instead, which should be
present for the vast majority of systems.

* guix/scripts/system.scm (install-bootloader-from-os,
install-bootloader-from-provenance): Add procedures.
(reinstall-bootloader): Remove procedure.
(switch-to-system-generation, process-command): Use
install-bootloader-from-provenance.

Change-Id: I5713a43ad4f9f32a129d980db06d70de16b03f27
---
Hello,

This requires patches from #69343.  #72457 is big and I thought it would
be nice to separately review whatever possible, hence the new issue.  

This is [PATCH v5 01/15] from issue #72457, but with a modified commit
description and the addition of an install-bootloader-from-os procedure,
to reduce nesting and only define local variables when relevant.

The (gnu tests reconfigure) tests all pass, though I myself cannot
roll-back or switch-generations for unrelated reasons.  So please let me
know if this patch creates any trouble with the aformentioned and if you
have ideas for additional (gnu tests reconfigure) tests.

Thanks,
Herman

 gnu/bootloader.scm      |  2 ++
 guix/scripts/system.scm | 72 +++++++++++++++--------------------------
 2 files changed, 28 insertions(+), 46 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index f32e90e79d..61311b32cb 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -7,6 +7,8 @@
 ;;; Copyright © 2022 Josselin Poiret <dev@HIDDEN>
 ;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@HIDDEN>
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
+;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 0f7d864e06..d14dfd8d81 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -88,6 +88,7 @@ (define-module (guix scripts system)
   #:use-module (srfi srfi-37)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
+  #:use-module (ice-9 receive)
   #:use-module (rnrs bytevectors)
   #:export (guix-system
             read-operating-system
@@ -377,61 +378,39 @@ (define (switch-to-system-generation store spec)
          (activate (string-append generation "/activate")))
     (if number
         (begin
-          (reinstall-bootloader store number)
+          (install-bootloader-from-provenance store number)
           (switch-to-generation* %system-profile number)
           (unless-file-not-found (primitive-load activate)))
         (leave (G_ "cannot switch to system generation '~a'~%") spec))))
 
-(define* (system-bootloader-name #:optional (system %system-profile))
-  "Return the bootloader name stored in SYSTEM's \"parameters\" file."
-  (let ((params (unless-file-not-found
-                 (read-boot-parameters-file system))))
-    (boot-parameters-bootloader-name params)))
-
-(define (reinstall-bootloader store number)
-  "Re-install bootloader for existing system profile generation NUMBER.
-STORE is an open connection to the store."
-  (let* ((generation (generation-file-name %system-profile number))
-         ;; Detect the bootloader used in %system-profile.
-         (bootloader (lookup-bootloader-by-name (system-bootloader-name)))
-
-         ;; Use the detected bootloader with default configuration.
-         ;; It will be enough to allow the system to boot.
-         (bootloader-config (bootloader-configuration
-                             (bootloader bootloader)))
-
-         ;; Make the specified system generation the default entry.
-         (chosen-alternative (generation->boot-alternative
-                              %system-profile number))
-         (params (boot-alternative-parameters chosen-alternative))
-         (locale (boot-parameters-locale params))
-         (store-crypto-devices (boot-parameters-store-crypto-devices params))
-         (store-directory-prefix
-          (boot-parameters-store-directory-prefix params))
-         (old-generations
-          (delv number (reverse (generation-numbers %system-profile))))
-         (previous-boot-alternatives (profile->boot-alternatives
-                                      %system-profile old-generations))
-         (entries (list (boot-parameters->menu-entry params)))
-         (old-entries (map boot-parameters->menu-entry
-                           (map boot-alternative-parameters
-                                previous-boot-alternatives))))
+(define (install-bootloader-from-os store number os)
+  "Re-install an old bootloader defined in <operating-system> record OS,
+for system profile generation NUMBER, with store STORE."
+  (let* ((os (read-operating-system os))
+         (bootloader-config (operating-system-bootloader os))
+         (numbers (generation-numbers %system-profile))
+         (numbers (delv number (reverse numbers)))
+         (old (profile->boot-alternatives %system-profile numbers))
+         (bootcfg (operating-system-bootcfg os old)))
     (run-with-store store
-      (mlet* %store-monad
-          ((bootcfg (lower-object
-                     ((bootloader-configuration-file-generator bootloader)
-                      bootloader-config entries
-                      #:locale locale
-                      #:store-crypto-devices store-crypto-devices
-                      #:store-directory-prefix store-directory-prefix
-                      #:old-entries old-entries)))
-           (drvs -> (list bootcfg)))
+      (mlet* %store-monad ((bootcfg (lower-object bootcfg))
+                           (drvs -> (list bootcfg)))
         (mbegin %store-monad
           (built-derivations drvs)
           ;; Only install bootloader configuration file.
           (install-bootloader local-eval bootloader-config bootcfg
                               #:run-installer? #f))))))
 
+(define (install-bootloader-from-provenance store number)
+  "Re-install an old bootloader using provenance data for system profile
+generation NUMBER with store STORE."
+  (receive (_ os)
+      (system-provenance (generation-file-name %system-profile number))
+    (if os
+        (install-bootloader-from-os store number os)
+        (leave (G_ "cannot rollback to generation '~a': no provenance~%")
+               number))))
+
 
 ;;;
 ;;; Graphs.
@@ -1413,10 +1392,11 @@ (define-syntax-rule (with-store* store exp ...)
      (let ((pattern (match args
                       (() #f)
                       ((pattern) pattern)
-                      (x (leave (G_ "wrong number of arguments~%"))))))
+                      (_ (leave (G_ "wrong number of arguments~%")))))
+           (number (generation-number %system-profile)))
        (with-store* store
          (delete-matching-generations store %system-profile pattern)
-         (reinstall-bootloader store (generation-number %system-profile)))))
+         (install-bootloader-from-provenance store number))))
     ((switch-generation)
      (let ((pattern (match args
                       ((pattern) pattern)
-- 
2.45.2





Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Herman Rimm <herman@HIDDEN>
Subject: bug#73202: Acknowledgement ([PATCH] guix: scripts: Rewrite
 reinstall-bootloader to use provenance data.)
Message-ID: <handler.73202.B.172616037519089.ack <at> debbugs.gnu.org>
References: <20240912165818.21580-1-herman@HIDDEN>
X-Gnu-PR-Message: ack 73202
X-Gnu-PR-Package: guix-patches
X-Gnu-PR-Keywords: patch
Reply-To: 73202 <at> debbugs.gnu.org
Date: Thu, 12 Sep 2024 17:00:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 guix-patches@HIDDEN

If you wish to submit further information on this problem, please
send it to 73202 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
73202: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D73202
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 00/15] Preparation for bootloader rewrite.
References: <20240912165818.21580-1-herman@HIDDEN>
In-Reply-To: <20240912165818.21580-1-herman@HIDDEN>
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:02 +0000
Resent-Message-ID: <handler.73202.B73202.17268287625138 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287625138
          (code B ref 73202); Fri, 20 Sep 2024 10:40:02 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:22 +0000
Received: from localhost ([127.0.0.1]:34136 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb2n-0001Ko-G2
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:21 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2l-0001KU-Ak
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828730;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=YMSbwwWrjCJ9mBYubz8lsMmTqveIFD+ld2bfATbEa74=;
 b=A+NjgmsTrTNDZaqM/D24nVYjiQq2EWruTy5zSznAzmQis3DMu/it26WeKz4KtPLNw0Up1k
 jbenUHTuA9gNWWWPgB0KroLg74T9zoiY7HdGkbOEmRVC3f56NR2AAbDUiT3KIettc70B8D
 fKHk8jvCHuKeSHkofOQmAnpCT5FN2wvA+Z8Iy36TXv2Fjb9ODCUbdELmPiZZSTkzv/LeP+
 3oAnH3vpFrb6de9t7x5yn8F74dI05sVFmW3PhJ1L4+fbEVEKtOcNaXYZ42FKHWQjx0DsT7
 vVly8UM7l/byfzKMkudHuHEx8BuiwVeDsUTTy7X9pZyDTFIlRxHVvuHBiAaZcg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 356cdb9d
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO)
 for <73202 <at> debbugs.gnu.org>; Fri, 20 Sep 2024 10:38:50 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:45 +0200
Message-ID: <cover.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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:  Hello, Patch #1 is now patch #5. This patches series adds
 the procedures, macros and record used in #72457. I am not sure how to test
 these on their own. Feel free to write some small tests, if you think of
 [...] Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  Hello, Patch #1 is now patch #5. This patches series adds
   the procedures, macros and record used in #72457. I am not sure how to test
    these on their own. Feel free to write some small tests, if you think of
   [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Hello,

Patch #1 is now patch #5.  This patches series adds the procedures,
macros and record used in #72457.  I am not sure how to test these on
their own.  Feel free to write some small tests, if you think of any.
If I failed to described a change or did it poorly, please let me know.

Patch #11 and patches with fewer changes can be merged out of order.

Yesterday I had trouble using control <at> debbugs.gnu.org to block one issue
on another.  So if you could make this issue block on #69343, and #72457
block on this, I would appreciate that.

Cheers,
Herman

Herman Rimm (3):
  guix: utils: Add flatten and flat-map from haunt.
  guix: records: Add wrap-element procedure.
  gnu: bootloader: Match records outside the module.

Lilah Tascheter (12):
  gnu: bootloader: Remove deprecated bootloader-configuration field.
  gnu: system: Remove useless boot parameters.
  gnu: tests: reconfigure: Remove bootloader install test.
  guix: scripts: Remove unused code.
  guix: scripts: Rewrite reinstall-bootloader to use provenance data.
  gnu: bootloader: Add bootloader-target record and infastructure.
  gnu: bootloader: Add bootloader-configurations->gexp.
  gnu: bootloader: Add device-subvol field to menu-entry record.
  gnu: build: bootloader: Add efi-bootnums procedure.
  gnu: bootloader: Install any bootloader to ESP.
  gnu: system: boot: Add procedure.
  teams: Add bootloading team.

 doc/guix.texi             |  34 +--
 etc/teams.scm             |  10 +
 gnu/bootloader.scm        | 504 +++++++++++++++++++++++++++++++++-----
 gnu/build/bootloader.scm  | 161 +++++++-----
 gnu/build/image.scm       |  23 +-
 gnu/image.scm             |   4 +
 gnu/system.scm            |   7 -
 gnu/system/boot.scm       |  14 +-
 gnu/system/image.scm      |  22 +-
 gnu/tests/reconfigure.scm |  86 +------
 guix/records.scm          |   7 +
 guix/scripts/system.scm   |  96 +++-----
 guix/ui.scm               |   9 +
 guix/utils.scm            |  26 ++
 tests/boot-parameters.scm |  18 +-
 15 files changed, 677 insertions(+), 344 deletions(-)


base-commit: 9292d35ab63055e3752e698710a1a408cc7de7fd
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 01/15] gnu: bootloader: Remove deprecated bootloader-configuration field.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:02 +0000
Resent-Message-ID: <handler.73202.B73202.17268287665171 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287665171
          (code B ref 73202); Fri, 20 Sep 2024 10:40:02 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:26 +0000
Received: from localhost ([127.0.0.1]:34143 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb2r-0001LJ-T9
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:26 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2m-0001KU-Uu
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828731;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=lbIDUnQSSIiT/U5QgVY/Gnnt5br4GelA26wzEaPawfk=;
 b=OLMemUQExHGqXtS1xHbFa+dMzOJsiKtpdw3w8yFvVzUFO2djHu898Lnxsx1JTYyJGzIDe1
 IOZ3vlnSIiaIQXzMxEQay4nL9PbwmJJBEJcn/fkk0T7+BQ+lsj4uwGJ56IiyDcaK+2zI6/
 mA/1cNKgbXcWcHgs5C2wlm545xoithyctgeYmQbljRAddRcsunbonpE5XlhkSMDZ+iuVvY
 QEqO3D9tj/1tTGmdah2ruC854WUhqKAC3FrJHRYC8oj+CoUfVRj5Rni2+OvMx04JoovIic
 WCiTOLTuwATCeOseZ2LVi+A/b9ibjBEy7VUYULOQ3C6AuQwh6mmsbxqVOepzXg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 4717e1cc
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:51 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:46 +0200
Message-ID: <19cb7c8d9d8d8cf1693007365a6867674325ccab.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (warn-target-field-deprecation): Delete sanitizer.
 (bootloader-configuration)[target]:
 Remove deprecated field. (bootloader-configuration-target): Delete procedure.
 (bootloader-co [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (warn-target-field-deprecation): Delete sanitizer. (bootloader-configuration)[target]:
    Remove deprecated field. (bootloader-configuration-target): Delete procedure.
    (bootloader-co [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (warn-target-field-deprecation): Delete sanitizer.
(bootloader-configuration)[target]: Remove deprecated field.
(bootloader-configuration-target): Delete procedure.
(bootloader-configuration-targets): Do not use target field.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/bootloader.scm | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index f32e90e79d..865521e6e5 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -66,7 +66,6 @@ (define-module (gnu bootloader)
             bootloader-configuration
             bootloader-configuration?
             bootloader-configuration-bootloader
-            bootloader-configuration-target ;deprecated
             bootloader-configuration-targets
             bootloader-configuration-menu-entries
             bootloader-configuration-default-entry
@@ -244,24 +243,14 @@ (define-record-type* <bootloader>
 ;; The <bootloader-configuration> record contains bootloader independant
 ;; configuration used to fill bootloader configuration file.
 
-(define-with-syntax-properties (warn-target-field-deprecation
-                                (value properties))
-  (when value
-    (warning (source-properties->location properties)
-             (G_ "the 'target' field is deprecated, please use 'targets' \
-instead~%")))
-  value)
 
 (define-record-type* <bootloader-configuration>
   bootloader-configuration make-bootloader-configuration
   bootloader-configuration?
   (bootloader
-   bootloader-configuration-bootloader) ;<bootloader>
+   bootloader-configuration-bootloader)   ;<bootloader>
   (targets               %bootloader-configuration-targets
                          (default #f))     ;list of strings
-  (target                %bootloader-configuration-target ;deprecated
-                         (default #f)
-                         (sanitize warn-target-field-deprecation))
   (menu-entries          bootloader-configuration-menu-entries
                          (default '()))   ;list of <menu-entry>
   (default-entry         bootloader-configuration-default-entry
@@ -285,14 +274,9 @@ (define-record-type* <bootloader-configuration>
   (extra-initrd          bootloader-configuration-extra-initrd
                          (default #f)))   ;string | #f
 
-(define-deprecated (bootloader-configuration-target config)
-  bootloader-configuration-targets
-  (%bootloader-configuration-target config))
 
 (define (bootloader-configuration-targets config)
   (or (%bootloader-configuration-targets config)
-      ;; TODO: Remove after the deprecated 'target' field is removed.
-      (list (%bootloader-configuration-target config))
       ;; XXX: At least the GRUB installer (see (gnu bootloader grub)) has this
       ;; peculiar behavior of installing fonts and GRUB modules when DEVICE is #f,
       ;; hence the default value of '(#f) rather than '().
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 02/15] gnu: system: Remove useless boot parameters.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:03 +0000
Resent-Message-ID: <handler.73202.B73202.17268287675186 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287675186
          (code B ref 73202); Fri, 20 Sep 2024 10:40:03 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:27 +0000
Received: from localhost ([127.0.0.1]:34146 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb2s-0001LM-9F
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:27 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2o-0001KU-6D
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:22 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828733;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=KmgrhZIM7bLOfUU9MLGaqHtRJB8u7epytM/ovVdNuu8=;
 b=lxdp6eRv2npzxHxHKiw0vbbnIp/XTu4hzzh0UsKSM8bL9jIK/b+BJWXaxxyWSQxVavZRYS
 IWyxCaqJbdRJAk30LFRoNgHKqp5F6y+xuB8+hXZQCJNm8672kP+aRNi9YnJfAKMm2OTIzN
 4tkOgZ+Qhow0zmZVEb9jHkF7ZDgiqngjJre7s8HpU96SrfDw3Ol3u0kPB34XCfdtMn48qW
 zeNDwklRAS/tfsGQlnCVJ1fGH9TQrZsAgWdm2oAzv4Fm/84uq+z+xl2RSQyAogBkx1auIN
 2mGdpSDQpGgkIR3bQL0g3tA3V9n1mwbByd+Nkibmb0/GTvVRSJEBpHrH9H6Muw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 654fd6f5
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:53 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:47 +0200
Message-ID: <7779b50c171a053248705ebd18f6b7ba4ea68a48.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> * gnu/system.scm
 (operating-system-boot-parameters, operating-system-boot-parameters-file):
 Delete bootloader-menu-entries. * gnu/system/boot.scm
 (boot-parameters)[bootloader-menu-entries]: Delete fie [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/system.scm
    (operating-system-boot-parameters, operating-system-boot-parameters-file):
    Delete bootloader-menu-entries. * gnu/system/boot.scm (boot-parameters)[bootloader-menu-entries]:
    Delete fie [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/system.scm (operating-system-boot-parameters,
operating-system-boot-parameters-file): Delete bootloader-menu-entries.
* gnu/system/boot.scm (boot-parameters)[bootloader-menu-entries]: Delete
field.
(read-boot-parameters): Don't read bootloader-menu-entries.
* tests/boot-parameters.scm (%grub-boot-parameters,
test-read-boot-parameters, test-read-boot-parameters): Don't include
bootloader-menu-entries.
("read, bootloader-menu-entries, default value"): Delete test.

Change-Id: I46d9cff4604dbfcf654b0820fdb77e72aecffbb4
---
 gnu/system.scm            |  7 -------
 gnu/system/boot.scm       |  8 --------
 tests/boot-parameters.scm | 18 +++++-------------
 3 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 25afa96295..a3eee5aa24 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1298,8 +1298,6 @@ (define* (operating-system-boot-parameters os root-device
      (initrd initrd)
      (multiboot-modules multiboot-modules)
      (bootloader-name bootloader-name)
-     (bootloader-menu-entries
-      (bootloader-configuration-menu-entries (operating-system-bootloader os)))
      (locale locale)
      (store-device (ensure-not-/dev (file-system-device store)))
      (store-directory-prefix (btrfs-store-subvolume-file-name file-systems))
@@ -1341,11 +1339,6 @@ (define* (operating-system-boot-parameters-file os)
                                 #$(boot-parameters-multiboot-modules params)))
                             #~())
                      (bootloader-name #$(boot-parameters-bootloader-name params))
-                     (bootloader-menu-entries
-                      #$(map menu-entry->sexp
-                             (or (and=> (operating-system-bootloader os)
-                                        bootloader-configuration-menu-entries)
-                                 '())))
                      (locale #$(boot-parameters-locale params))
                      (store
                       (device
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 833caef496..a898ab9549 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -54,7 +54,6 @@ (define-module (gnu system boot)
             boot-parameters-label
             boot-parameters-root-device
             boot-parameters-bootloader-name
-            boot-parameters-bootloader-menu-entries
             boot-parameters-store-crypto-devices
             boot-parameters-store-device
             boot-parameters-store-directory-prefix
@@ -112,8 +111,6 @@ (define-record-type* <boot-parameters>
   ;; partition.
   (root-device      boot-parameters-root-device)
   (bootloader-name  boot-parameters-bootloader-name)
-  (bootloader-menu-entries                        ;list of <menu-entry>
-   boot-parameters-bootloader-menu-entries)
   (store-device     boot-parameters-store-device)
   (store-mount-point boot-parameters-store-mount-point)
   (store-directory-prefix boot-parameters-store-directory-prefix)
@@ -174,11 +171,6 @@ (define (read-boot-parameters port)
          ((_ args) args)
          (#f       'grub))) ; for compatibility reasons.
 
-      (bootloader-menu-entries
-       (match (assq 'bootloader-menu-entries rest)
-         ((_ entries) (map sexp->menu-entry entries))
-         (#f          '())))
-
       ;; In the past, we would store the directory name of linux instead of
       ;; the absolute file name of its image.  Detect that and correct it.
       (kernel (if (string=? kernel (direct-store-path kernel))
diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm
index 2e7976aa6c..e1dc4620c3 100644
--- a/tests/boot-parameters.scm
+++ b/tests/boot-parameters.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@HIDDEN>
 ;;; Copyright © 2022 Josselin Poiret <dev@HIDDEN>
+;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -34,6 +35,7 @@ (define-module (test-boot-parameters)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix tests)
+  #:use-module (ice-9 format)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-64)
   #:use-module (rnrs bytevectors))
@@ -64,7 +66,6 @@ (define %root-path "/")
 (define %grub-boot-parameters
   (boot-parameters
    (bootloader-name 'grub)
-   (bootloader-menu-entries '())
    (root-device %default-root-device)
    (label %default-label)
    (kernel %default-kernel)
@@ -107,7 +108,6 @@ (define* (test-read-boot-parameters
           #:key
           (version %boot-parameters-version)
           (bootloader-name 'grub)
-          (bootloader-menu-entries '())
           (label %default-label)
           (root-device (quote-uuid %default-root-device))
           (kernel %default-kernel)
@@ -127,7 +127,7 @@ (define* (test-read-boot-parameters
       (cond ((eq? 'false val) (format #false fmt #false))
             (val              (format #false fmt val))
             (else             "")))
-    (format #false "(boot-parameters~a~a~a~a~a~a~a~a~a~a)"
+    (format #f "(boot-parameters~@{~a~})"
             (sexp-or-nothing " (version ~S)" version)
             (sexp-or-nothing " (label ~S)" label)
             (sexp-or-nothing " (root-device ~S)" root-device)
@@ -135,7 +135,7 @@ (define* (test-read-boot-parameters
             (sexp-or-nothing " (kernel-arguments ~S)" kernel-arguments)
             (sexp-or-nothing " (initrd ~S)" initrd)
             (if with-store
-                (format #false " (store~a~a~a~a)"
+                (format #f " (store~@{~a~})"
                         (sexp-or-nothing " (device ~S)" store-device)
                         (sexp-or-nothing " (mount-point ~S)"
                                          store-mount-point)
@@ -145,9 +145,7 @@ (define* (test-read-boot-parameters
                                          store-crypto-devices))
                 "")
             (sexp-or-nothing " (locale ~S)" locale)
-            (sexp-or-nothing " (bootloader-name ~a)" bootloader-name)
-            (sexp-or-nothing " (bootloader-menu-entries ~S)"
-                             bootloader-menu-entries)))
+            (sexp-or-nothing " (bootloader-name ~a)" bootloader-name)))
   (let ((str (generate-boot-parameters)))
     (call-with-input-string str read-boot-parameters)))
 
@@ -170,7 +168,6 @@ (define* (test-read-boot-parameters
 
 (test-assert "read, construction, optional fields"
   (and (test-read-boot-parameters #:bootloader-name #false)
-       (test-read-boot-parameters #:bootloader-menu-entries #false)
        (test-read-boot-parameters #:kernel-arguments #false)
        (test-read-boot-parameters #:with-store #false)
        (test-read-boot-parameters #:store-device #false)
@@ -223,11 +220,6 @@ (define* (test-read-boot-parameters
   (boot-parameters-bootloader-name
    (test-read-boot-parameters #:bootloader-name #false)))
 
-(test-eq "read, bootloader-menu-entries, default value"
-  '()
-  (boot-parameters-bootloader-menu-entries
-   (test-read-boot-parameters #:bootloader-menu-entries #false)))
-
 (test-eq "read, kernel-arguments, default value"
   '()
   (boot-parameters-kernel-arguments
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 03/15] gnu: tests: reconfigure: Remove bootloader install test.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:04 +0000
Resent-Message-ID: <handler.73202.B73202.17268287685201 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287685201
          (code B ref 73202); Fri, 20 Sep 2024 10:40:04 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:28 +0000
Received: from localhost ([127.0.0.1]:34149 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb2t-0001Lb-BA
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:28 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2p-0001KU-3Q
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828734;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=ovim1EBaCAE1MVZajqRxcRakZdmW0ZG41AR3OZD7f5g=;
 b=QlNxPR8TbxnSrQFf7lM8HQ1wCZXxkESSMqmGDsUxx8su4UUniPgJU97+7AnFzmE8tfvREw
 mTH4gNgKtNENKgHt0cpnIWioZHsDvKCxMJ8xGxSsB76AtEufrTXCuIorXaXDVYBcfIJqkS
 HA15b9n+6tu4KPrdL7Si139BBFmun2DEFTHOG3oRpPc7Wd5pXHKmoMrVbUGTkGg6SZ5Ujb
 g45PK2k5zh6bGXk/nKXcgX92rrfQSDM8X0a/O6V0YDL8CJBzagTy9GUfzzu0Sk3ch7zm9Z
 bL2SlAgZmwc2O3D1a4xKIkjfU6bpym4tWCMCxkKHy8UhOjGHGStXKQrD0TY6FA==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id d7f4739a
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:54 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:48 +0200
Message-ID: <58bd6e83712e96acd4c2c29ed7ff8be3c75a9d5a.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/tests/reconfigure.scm
 (%test-install-bootloader): Delete variable. (run-install-bootloader-test):
 Delete procedure. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 ---
 gnu/tests/reconfigure.scm | 86 + 1 file changed, 1 insertion(+),
 85 deletions(-)
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/tests/reconfigure.scm
    (%test-install-bootloader): Delete variable. (run-install-bootloader-test):
    Delete procedure. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 ---
    gnu/tests/reconfigure.scm | 86 + 1 file changed, 1 insertion(+), 85 deletions(-)
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/tests/reconfigure.scm (%test-install-bootloader): Delete variable.
(run-install-bootloader-test): Delete procedure.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/tests/reconfigure.scm | 86 +--------------------------------------
 1 file changed, 1 insertion(+), 85 deletions(-)

diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm
index bcc7645fa3..8aa5311171 100644
--- a/gnu/tests/reconfigure.scm
+++ b/gnu/tests/reconfigure.scm
@@ -30,8 +30,7 @@ (define-module (gnu tests reconfigure)
   #:use-module (guix scripts system reconfigure)
   #:use-module (guix store)
   #:export (%test-switch-to-system
-            %test-upgrade-services
-            %test-install-bootloader))
+            %test-upgrade-services))
 
 ;;; Commentary:
 ;;;
@@ -178,83 +177,6 @@ (define* (run-upgrade-services-test)
           (disable (upgrade-services-program '() '() '(dummy) '())))
      (test enable disable))))
 
-(define* (run-install-bootloader-test)
-  "Run a test of an OS running INSTALL-BOOTLOADER-PROGRAM, which installs a
-bootloader's configuration file."
-  (define os
-    (marionette-operating-system
-     (simple-operating-system)
-     #:imported-modules '((gnu services herd)
-                          (guix combinators))))
-
-  (define vm (virtual-machine
-              (operating-system os)
-              (volatile? #f)))
-
-  (define (test script)
-    (with-imported-modules '((gnu build marionette))
-      #~(begin
-          (use-modules (gnu build marionette)
-                       (ice-9 regex)
-                       (srfi srfi-1)
-                       (srfi srfi-64))
-
-          (define marionette
-            (make-marionette (list #$vm)))
-
-          ;; Return the system generation paths that have GRUB menu entries.
-          (define (generations-in-grub-cfg marionette)
-            (let ((grub-cfg (marionette-eval
-                             '(begin
-                                (use-modules (rnrs io ports))
-                                (call-with-input-file "/boot/grub/grub.cfg"
-                                  get-string-all))
-                             marionette)))
-              (map (lambda (parameter)
-                     (second (string-split (match:substring parameter) #\=)))
-                   (list-matches "system=[^ ]*" grub-cfg))))
-
-          (test-runner-current (system-test-runner #$output))
-          (test-begin "install-bootloader")
-
-          (test-assert "no prior menu entry for system generation"
-            (not (member #$os (generations-in-grub-cfg marionette))))
-
-          (test-assert "script successfully evaluated"
-            (marionette-eval
-             '(primitive-load #$script)
-             marionette))
-
-          (test-assert "menu entry created for system generation"
-            (member #$os (generations-in-grub-cfg marionette)))
-
-          (test-end))))
-
-  (let* ((bootloader ((compose bootloader-configuration-bootloader
-                               operating-system-bootloader)
-                      os))
-         ;; The typical use-case for 'install-bootloader-program' is to read
-         ;; the boot parameters for the existing menu entries on the system,
-         ;; parse them with 'boot-parameters->menu-entry', and pass the
-         ;; results to 'operating-system-bootcfg'. However, to obtain boot
-         ;; parameters, we would need to start the marionette, which we should
-         ;; ideally avoid doing outside of the 'test' G-Expression. Thus, we
-         ;; generate a bootloader configuration for the script as if there
-         ;; were no existing menu entries. In the grand scheme of things, this
-         ;; matters little -- these tests should not make assertions about the
-         ;; behavior of 'operating-system-bootcfg'.
-         (bootcfg (operating-system-bootcfg os '()))
-         (bootcfg-file (bootloader-configuration-file bootloader)))
-    (gexp->derivation
-     "install-bootloader"
-     ;; Due to the read-only nature of the virtual machines used in the system
-     ;; test suite, the bootloader installer script is omitted. 'grub-install'
-     ;; would attempt to write directly to the virtual disk if the
-     ;; installation script were run.
-     (test
-      (install-bootloader-program #f #f #f bootcfg bootcfg-file '(#f) "/")))))
-
-
 (define %test-switch-to-system
   (system-test
    (name "switch-to-system")
@@ -267,9 +189,3 @@ (define %test-upgrade-services
    (description "Upgrade the Shepherd by unloading obsolete services and
 loading new services.")
    (value (run-upgrade-services-test))))
-
-(define %test-install-bootloader
-  (system-test
-   (name "install-bootloader")
-   (description "Install a bootloader and its configuration file.")
-   (value (run-install-bootloader-test))))
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 04/15] guix: scripts: Remove unused code.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:04 +0000
Resent-Message-ID: <handler.73202.B73202.17268287695210 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287695210
          (code B ref 73202); Fri, 20 Sep 2024 10:40:04 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:29 +0000
Received: from localhost ([127.0.0.1]:34151 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb2u-0001Lq-8e
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:28 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2p-0001KU-Tx
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828734;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=zpBup98EnkEOzxSooYxu6HmN8J4ynaJDcGgaravKFeI=;
 b=jJ8uSdc7yQ6LzdikdJYSpNIow6/FlMmM2cLmRQc4apZhn1yrtRa8Sb5GSE+8W5qE+UJ4iT
 /0XCUY6lBNL5MdWJnTq/lqmEhax1WlexHBwF4JQeobl7H1rl9QAMNSNmO8M2MTTzdxiS6o
 9jTw7ONCSMW7DF94lphJmHhVwj1aX76P8fnhV01XohIScAkyKxp2o63su+2UcWWQqNaqFO
 YmLqXULoq7f9CkplJRros+8cOYAMHdTBPJv5Z8PHVvNyWKgfMyj9ZELty+N9cqneLVv1xj
 9iQwIwGWjpQcrONxWKPFgL7GXngnuOF6+PMnfKmaBshTh84DCPbZyanpWIiJRw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id bd932324
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:54 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:49 +0200
Message-ID: <adc9c69d8284ac445cc0281d7921e41970c4b0f1.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 guix/scripts/system.scm
 (bootloader-installer-script): Delete. Change-Id:
 Ic1e0a523c814e4f1bf44b2721f5658f00066b0ab
 --- guix/scripts/system.scm | 22 1 file changed, 22 deletions(-) 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * guix/scripts/system.scm
    (bootloader-installer-script): Delete. Change-Id: Ic1e0a523c814e4f1bf44b2721f5658f00066b0ab
    --- guix/scripts/system.scm | 22 1 file changed, 22 deletions(-) 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* guix/scripts/system.scm (bootloader-installer-script): Delete.

Change-Id: Ic1e0a523c814e4f1bf44b2721f5658f00066b0ab
---
 guix/scripts/system.scm | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 0f7d864e06..83a4de39d0 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -757,28 +757,6 @@ (define (maybe-suggest-running-guix-pull)
     (warning (G_ "Consider running 'guix pull' before 'reconfigure'.~%"))
     (warning (G_ "Failing to do that may downgrade your system!~%"))))
 
-(define (bootloader-installer-script installer
-                                     bootloader device target)
-  "Return a file calling INSTALLER gexp with given BOOTLOADER, DEVICE
-and TARGET arguments."
-  (scheme-file "bootloader-installer"
-               (with-imported-modules '((gnu build bootloader)
-                                        (guix build utils))
-                 #~(begin
-                     (use-modules (gnu build bootloader)
-                                  (guix build utils)
-                                  (ice-9 binary-ports)
-                                  (srfi srfi-34)
-                                  (srfi srfi-35))
-
-                     (guard (c ((message-condition? c) ;XXX: i18n
-                                (format (current-error-port) "error: ~a~%"
-                                        (condition-message c))
-                                (exit 1)))
-                       (#$installer #$bootloader #$device #$target)
-                       (info (G_ "bootloader successfully installed on '~a'~%")
-                             #$device))))))
-
 (define (local-eval exp)
   "Evaluate EXP, a G-Expression, in-place."
   (mlet* %store-monad ((lowered (lower-gexp exp))
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 06/15] guix: utils: Add flatten and flat-map from haunt.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:05 +0000
Resent-Message-ID: <handler.73202.B73202.17268287795268 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287795268
          (code B ref 73202); Fri, 20 Sep 2024 10:40:05 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:39 +0000
Received: from localhost ([127.0.0.1]:34161 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb35-0001Mt-5j
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:39 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2q-0001KU-PA
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828735;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=vfcqcX2IoxjeLL2a13Hzs5VnUYGnh2RdWddfI6pSBb8=;
 b=oRemBdjrHe3H7OwyDwiEzYFou91OamSy9W6i3r5pyJr0HR8m3YKNs9GS2fedgL/Xbx2aqB
 momiG8p5oTUg/bTb+eBdmWPQnQkeC03rVaiOJnsQu4t1lnEmvcBawhG00RCdUku3ioL/1G
 sRLrw+kZLu4xsF8C2QHa+SxezBAmfJ/RFRB/NLRr7AnFDo6SdwHbqJ+0uI5l2wk73Vp9N9
 UTkZ5lYvBuc2HdsfpC7usXTBvWx90wMuVSd+ha35na4MfrNs0k5F6IU786dTTFNDzUBK8+
 BykVqZUEUq1uRimqOqngvHrDUxKPa2Gy8DNGuljQYQUBp32+KK848D5nT8wiIw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 74a9aac9
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO)
 for <73202 <at> debbugs.gnu.org>; Fri, 20 Sep 2024 10:38:55 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:51 +0200
Message-ID: <fa66024b117d156422da77f50e1c2461410de125.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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:  * guix/utils.scm (flatten,
 flat-map): Add procedures. Change-Id:
 I1d7d49fd02115e3de09ed69bcf5f55a10423162e --- guix/utils.scm | 26
 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm
 index d8ce6ed886..e37c2d8770 100644 --- a/guix/utils.scm +++ b/guix/utils.scm
 @@ -139,6 +139,9 @@ (define-module (guix utils) with-environment-variables
 ar [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  * guix/utils.scm (flatten, flat-map): Add procedures. Change-Id:
    I1d7d49fd02115e3de09ed69bcf5f55a10423162e --- guix/utils.scm | 26 ++++++++++++++++++++++++++
    1 file changed, 26 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm
    index d8ce6ed886..e37c2d8770 100644 --- a/guix/utils.scm +++ b/guix/utils.scm
    @@ -139,6 +139,9 @@ (define-module (guix utils) with-environment-variables
    ar [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

* guix/utils.scm (flatten, flat-map): Add procedures.

Change-Id: I1d7d49fd02115e3de09ed69bcf5f55a10423162e
---
 guix/utils.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/guix/utils.scm b/guix/utils.scm
index d8ce6ed886..e37c2d8770 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -139,6 +139,9 @@ (define-module (guix utils)
             with-environment-variables
             arguments-from-environment-variable
 
+            flatten
+            flat-map
+
             config-directory
             cache-directory
 
@@ -1027,6 +1030,29 @@ (define (with-atomic-file-output file proc)
         (false-if-exception (delete-file template))
         (close-port out)))))
 
+;; TODO: bring over other utility procedures from (haunt utils).
+(define* (flatten lst #:optional depth)
+  "Return a list that recursively concatenates the sub-lists of LST,
+up to DEPTH levels deep.  When DEPTH is #f, the entire tree is
+flattened."
+  (if (and (number? depth) (zero? depth))
+      lst
+      (fold-right (match-lambda*
+                   (((sub-list ...) memo)
+                    (append (flatten sub-list (and depth (1- depth)))
+                            memo))
+                   ((elem memo)
+                    (cons elem memo)))
+                  '()
+                  lst)))
+
+(define (flat-map proc . lsts)
+  "Apply PROC to each element of each list in LSTS and return a new
+list in which nested lists are concatenated into the result.
+
+For example, the list (1 2 (3)) would be flattened to (1 2 3)."
+  (flatten (apply map proc lsts) 1))
+
 (define* (xdg-directory variable suffix #:key (ensure? #t))
   "Return the name of the XDG directory that matches VARIABLE and SUFFIX,
 after making sure that it exists if ENSURE? is true.  VARIABLE is an
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 07/15] guix: records: Add wrap-element procedure.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:06 +0000
Resent-Message-ID: <handler.73202.B73202.17268287805275 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287805275
          (code B ref 73202); Fri, 20 Sep 2024 10:40:06 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:40 +0000
Received: from localhost ([127.0.0.1]:34163 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb35-0001Mv-It
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:39 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2t-0001KU-39
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828735;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=ncPhGvvLij3mJW3Pl60KSTuVhclk2lIYNppvNs/WgWk=;
 b=U8MrvkFmbCO6121E0Yq/VKysSOUyE25F2Mne6osjSkhV6pqaJNg5W06GqhpIlnwYeFL7UM
 bbsV5Td2fzQVb3ooVZa602RAd6e9iuU+rjJPxbgiuma4ahWSSPGJ6+WlWCG+AQ5RUnbkbv
 U7d9pwoDTGf/FMzcq9maEY7vijaBls64rOZ3hHBstSyXmWsad1XgHia7O9O1m4m9o7vIqE
 0d4AazTyrXpfJes6OSh7ijF2f8vlVGhOfDbyzzbKPkfLXwFLoDTcuhOZ7svMzbhaOgkGCJ
 HUfpYMWJ+kj0WQe0oQV5tad7H572V/+BQcm+3l7UuhQi9q1pLgqtENYcKSQ7MA==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id b25ad08c
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO)
 for <73202 <at> debbugs.gnu.org>; Fri, 20 Sep 2024 10:38:55 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:52 +0200
Message-ID: <b901da23e25dd80eaebfe8e0379cf0f0da62f825.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: * guix/records.scm (wrap-element): Add procedure. Change-Id:
 If121c5d856e815776830282a0701a73e5ae2a7e7 --- guix/records.scm | 7 +++++++
 1 file changed,
 7 insertions(+) diff --git a/guix/records.scm b/guix/records.scm
 index c084441441..b521a59257 100644 --- a/guix/records.scm +++
 b/guix/records.scm
 @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GN [...]
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  * guix/records.scm (wrap-element): Add procedure. Change-Id:
    If121c5d856e815776830282a0701a73e5ae2a7e7 --- guix/records.scm | 7 +++++++
    1 file changed, 7 insertions(+) diff --git a/guix/records.scm b/guix/records.scm
    index c084441441..b521a59257 100644 --- a/guix/records.scm +++ b/guix/records.scm
    @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GN [...]
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

* guix/records.scm (wrap-element): Add procedure.

Change-Id: If121c5d856e815776830282a0701a73e5ae2a7e7
---
 guix/records.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/guix/records.scm b/guix/records.scm
index c084441441..b521a59257 100644
--- a/guix/records.scm
+++ b/guix/records.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012-2024 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Mark H Weaver <mhw@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,8 @@ (define-module (guix records)
             alist->record
             object->fields
             recutils->alist
+            wrap-element
+
             match-record
             match-record-lambda))
 
@@ -606,6 +609,10 @@ (define (recutils->alist port)
               (else
                (error "unmatched line" line))))))))
 
+(define (wrap-element x)
+  "Sanitize a record field value X to a list."
+  (if (list? x) x (list x)))
+
 
 ;;;
 ;;; Pattern matching.
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 08/15] gnu: bootloader: Add bootloader-target record and infastructure.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:06 +0000
Resent-Message-ID: <handler.73202.B73202.17268287815283 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287815283
          (code B ref 73202); Fri, 20 Sep 2024 10:40:06 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:41 +0000
Received: from localhost ([127.0.0.1]:34165 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb35-0001N2-UC
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:40 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2u-0001KU-8U
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828736;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=1x15cyw0n9/lW0gK6t1whKY8AYW/FK5N7aXYfyIY+Wo=;
 b=bZRr/eTo+s1db5uF1TQkBrPIBMlmHH+vvPDmdxsNiRQI8u70e+z336lkQo4jazOZsf/C9J
 yEuu9DV8D6OgR/2hsEjeYoN+QOUb+qEkX9iyd4DnhwYLzJ9YYKwReO/3mqmgqoTO37ek15
 hxvZrsVtadEzIRSiXjxjvH5IBgj8wMrkLQiio5AicKja6GHRg9RNf9PQmiKLpWxi0D5ykx
 kKiAHoGCY6MhbrvZIMJ1mNgSaG4yjiU4YPza80UJgRxJ0Gk4yozKrEnLX6EelYf8pfw6qU
 j3/qRT8V1KdX4D6Ys0wOTr34YqJtc9qRT1LJKU1ytwnJ4wbvzQgzsm1uv99uAQ==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id be171398
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:56 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:53 +0200
Message-ID: <221de7ca9881aa279048d2e71bbed6263b26b165.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (bootloader-target): New record. (&target-error): New condition. (pathcat,
 get-target-of-type, parent-of, unfold-pathcat, target-base?, type-major?,
 ensure, ensure-target-types, e [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (bootloader-target): New record. (&target-error): New condition. (pathcat,
    get-target-of-type, parent-of, unfold-pathcat, target-base?, type-major?,
    ensure, ensure-target-types, e [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (bootloader-target): New record.
(&target-error): New condition.
(pathcat, get-target-of-type, parent-of, unfold-pathcat, target-base?,
type-major?, ensure, ensure-target-types, ensure-majors, gbegin): New
procedures.
(define-literal, with-targets, :path, :devpath, :device, :fs, :label,
:uuid): New macros.
* guix/ui.scm (call-with-error-handling)[target-error?]: Handle
target-errors.

Change-Id: I3f07c9096dd8b91c04449b6360b3b7d21640da14
---
 gnu/bootloader.scm | 229 ++++++++++++++++++++++++++++++++++++++++++++-
 guix/ui.scm        |   9 ++
 2 files changed, 233 insertions(+), 5 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 3ea50a4004..0c24996205 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2022 Josselin Poiret <dev@HIDDEN>
 ;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@HIDDEN>
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,19 +25,28 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu bootloader)
+  #:autoload   (gnu build file-systems)
+               (read-partition-label read-partition-uuid
+                find-partition-by-label find-partition-by-uuid)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
-  #:use-module (guix gexp)
-  #:use-module (guix profiles)
-  #:use-module (guix records)
+  #:autoload   (guix build syscalls)
+               (mounts mount-source mount-point mount-type)
   #:use-module (guix deprecation)
-  #:use-module ((guix ui) #:select (warn-about-load-error))
   #:use-module (guix diagnostics)
+  #:use-module (guix gexp)
   #:use-module (guix i18n)
+  #:use-module (guix modules)
+  #:use-module (guix profiles)
+  #:use-module (guix records)
+  #:use-module (guix utils)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 receive)
+  #:use-module (rnrs bytevectors)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-35)
-  #:use-module (ice-9 match)
   #:export (menu-entry
             menu-entry?
             menu-entry-label
@@ -62,6 +72,25 @@ (define-module (gnu bootloader)
             bootloader-configuration-file
             bootloader-configuration-file-generator
 
+            bootloader-target
+            bootloader-target?
+            bootloader-target-type
+            bootloader-target-expected?
+            bootloader-target-path
+            bootloader-target-offset
+            bootloader-target-device
+            bootloader-target-file-system
+            bootloader-target-label
+            bootloader-target-uuid
+
+            target-error?
+            target-error-type
+            target-error-targets
+
+            gbegin
+            :path :devpath :device :fs :label :uuid
+            with-targets
+
             bootloader-configuration
             bootloader-configuration?
             bootloader-configuration-bootloader
@@ -232,6 +261,196 @@ (define-record-type* <bootloader>
   (configuration-file              bootloader-configuration-file)
   (configuration-file-generator    bootloader-configuration-file-generator))
 
+
+;;;
+;;; Bootloader target record.
+;;;
+
+;; <bootloader-target> represents different kinds of targets in a
+;; normalized form.
+
+(define-record-type* <bootloader-target>
+  bootloader-target make-bootloader-target bootloader-target?
+  (type bootloader-target-type)                            ; symbol
+  (expected? bootloader-target-expected? (default #f))     ; bool
+
+  (path bootloader-target-path (default #f))               ; string|#f
+  (offset bootloader-target-offset (thunked)               ; symbol|#f
+          (default (and (bootloader-target-path this-record)
+                        (not (eq? (bootloader-target-type this-record) 'root))
+                        'root)))
+  (device bootloader-target-device (default #f))           ; string|#f
+  (file-system bootloader-target-file-system (default #f)) ; string|#f
+  (label bootloader-target-label (default #f))             ; string|#f
+  (uuid bootloader-target-uuid (default #f)))              ; uuid|#f
+
+(define-condition-type &target-error &error target-error?
+  (type target-error-type)
+  (targets target-error-targets))
+
+(define (pathcat p1 p2)
+  (string-append (string-trim-right p1 #\/) "/" (string-trim p2 #\/)))
+
+(define* (get-target-of-type type targets #:optional require?)
+  "Finds a target in TARGETS of type TYPE, returns REQUIRE? if #false,
+or provides an error otherwise."
+  (define (type? target)
+    (eq? type (bootloader-target-type target)))
+  (match (filter type? targets)
+    ((target _ ...) target)
+    (_ (and require?
+            (raise
+              (condition
+                (&message (message (G_ "required, but not provided")))
+                (&target-error (type type) (targets targets))))))))
+
+(define (parent-of target targets)
+  "Resolve the parent of TARGET in TARGETS, return #f if orphan."
+  (and=> (bootloader-target-offset target)
+         (cut get-target-of-type <> targets #t)))
+
+(define (unfold-pathcat target targets)
+  "Find the full VFS path of TARGET."
+  (let ((quit (lambda (t) (not (and=> t bootloader-target-path))))
+        (parent-of (cut parent-of <> targets)))
+    (reduce pathcat #f
+      (unfold quit bootloader-target-path parent-of target))))
+
+(define (target-base? t)
+  (or (not t) (match-record t <bootloader-target>
+                (expected? offset device label uuid)
+                (or device label uuid (not offset) expected?))))
+
+(define (type-major? target) (memq target '(root esp disk)))
+
+(define (ensure types targets end)
+  (let* ((used-in (cute unfold end identity (cut parent-of <> targets) <>))
+         (cons-in (lambda (t) (cons t (used-in t))))
+         (ensure (map (cut get-target-of-type <> targets #t) types)))
+    (filter identity (apply append (map cons-in ensure)))))
+
+(define* (ensure-target-types types targets #:optional (base? #f))
+  "Ensures all TYPES are provided in TARGETS.  Returns #t iff every ensured
+target and its requirements are fully provided.  Errors out when a required TYPE
+isn't provided.  When BASE?, only ensure path requirements up to a device."
+  (not (any bootloader-target-expected?
+         (ensure types targets (if base? target-base? not)))))
+
+(define (ensure-majors types targets)
+  "Errors out when a required TYPE isn't provided, or when use of multiple major
+targets is detected."
+  (let* ((all (map bootloader-target-type (ensure types targets target-base?)))
+         (majors (delete-duplicates (filter type-major? all) eq?)))
+    (if (< (length majors) 2) #t
+      (raise (condition (&message (message (G_ "multiple major targets used")))
+                        (&target-error (type majors) (targets targets)))))))
+
+
+
+(define (gbegin . gex)
+  "Sequence provided g-expressions."
+  (case (length gex) ((0) #f) ((1) (car gex)) (else #~(begin #$@gex))))
+
+;; syntax matching on free literals breaks easily, so bind them
+(define-syntax-rule (define-literal id) (define-syntax id (syntax-rules ())))
+(define-literal :path)
+(define-literal :devpath)
+(define-literal :device)
+(define-literal :fs)
+(define-literal :label)
+(define-literal :uuid)
+
+(define-syntax with-targets
+  (cut syntax-case <> ()
+    ((_ targets-expr block ...)
+     (let* ((genvars (compose generate-temporaries make-list))
+            (targets (car (genvars 1))))
+       (define (resolve in target base)
+         (with-syntax ((target target) (base base) (targets targets))
+           (syntax-case in
+             (:path :devpath :device :fs :label :uuid)
+             ((name _) (not (identifier? #'name))
+              #`(_ (syntax-error "binds must be to identifiers" #,in)))
+             ((name :device) #'(name (bootloader-target-device base)))
+             ((name :label) #'(name (bootloader-target-label base)))
+             ((name :uuid) #'(name (bootloader-target-uuid base)))
+             ((name :fs) #'(name (bootloader-target-file-system base)))
+             ((name :path) #'(name (unfold-pathcat target targets)))
+             ((name :devpath)
+              #'(name (if (target-base? target)
+                          "/"
+                          (pathcat "/" (bootloader-target-path target)))))
+             (_ #`(_ (syntax-error "invalid binding spec" #,in))))))
+
+       (define (binds spec)
+         (syntax-case spec (=>)
+           ((type => binds ...)
+            (with-syntax (((target base) (genvars 2)) (targets targets))
+              (append
+                #`((get (lambda (t) (get-target-of-type t targets #t)))
+                   (target (get type))
+                   (base (if (target-base? target)
+                             target
+                             (get (bootloader-target-offset target)))))
+                (map (cut resolve <> #'target #'base) #'(binds ...)))))
+           (_ #f)))
+
+       (define blocks
+         (cut syntax-case <> ()
+           ((spec ... expr)
+            (let* ((path? (cut syntax-case <> (:path) ((_ :path) #t) (_ #f)))
+                   (qualified? (cut syntax-case <> (=>)
+                                 ((_ => spec ...) (any path? #'(spec ...)))
+                                 (_ #f)))
+                   (specs #'(spec ...))
+                   (lets (apply append (filter-map binds specs)))
+                   (type (cut syntax-case <> (=>)
+                           ((t => _ ...) #'t) (t #'t))))
+              (receive (full part) (partition qualified? specs)
+                #`(and (ensure-majors (list #,@(map type specs)) #,targets)
+                       (ensure-target-types (list #,@(map type part))
+                                            #,targets #t)
+                       (ensure-target-types (list #,@(map type full))
+                                            #,targets #f)
+                       (let* #,lets expr)))))
+           (bad #'(syntax-error "malformed block" bad))))
+       "Using the list TARGETS, evaluate and sequence each BLOCK to produce a
+gexp.  BLOCK is a set of SPECs followed by an EXPR (evaluating to a gexp).
+Each SPEC denotes a type of target to guard EXPR on their existance and
+full-qualification.  This procedure is linear in regard to BLOCKs.
+
+SPEC may be of the following forms:
+@itemize
+@item 'TYPE Requires TYPE to be fully present or promised. Errors otherwise.
+@item ('TYPE => (VAR COMPONENT) ...): As type, but also binds variables. TYPE's
+      COMPONENT is bound to the variable VAR as described below.
+@end itemize
+
+Available COMPONENTs are:
+@itemize
+@item :path (fully-qualified)
+@item :devpath (relative from device)
+@item :device (auto-detected from uuid and label if not user-provided)
+@item :fs
+@item :label
+@item :uuid
+@end itemize
+
+Note that installers may be called multiple times with different targets being
+fully-qualified.  To ensure that targets aren't installed multiple times, make sure
+that each BLOCK ensures at least one major target, either directly or indirectly.
+Likewise, at most one major target should be ensured per BLOCK, under the same
+conditions.  Major targets originate from disk image handling, and are currently:
+@itemize
+@item disk
+@item root
+@item esp
+@end itemize"
+       #`(let ((#,targets targets-expr))
+           (apply gbegin (filter identity
+                                 (list #,@(map blocks #'(block ...))))))))
+    (bad #'(syntax-error "must provide targets" bad))))
+
 
 ;;;
 ;;; Bootloader configuration record.
diff --git a/guix/ui.scm b/guix/ui.scm
index 966f0611f6..0b1455cb3c 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2018 Steve Sprang <scs@HIDDEN>
 ;;; Copyright © 2022 Taiju HIGASHI <higashi@HIDDEN>
 ;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +37,8 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (guix ui)                       ;import in user interfaces only
+  #:use-module ((gnu bootloader)
+                #:select (target-error? target-error-type target-error-targets))
   #:use-module (guix i18n)
   #:use-module (guix colors)
   #:use-module (guix diagnostics)
@@ -861,6 +864,12 @@ (define (call-with-error-handling thunk)
                      (invoke-error-stop-signal c)
                      (cons (invoke-error-program c)
                            (invoke-error-arguments c))))
+              ((target-error? c)
+               (leave (G_ "bootloader-target '~a'~@[: ~a~] ~
+                          among the following targets:~%~{~y~}")
+                      (target-error-type c)
+                      (and (message-condition? c) (condition-message c))
+                      (target-error-targets c)))
 
              ((formatted-message? c)
               (apply report-error
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 09/15] gnu: bootloader: Add bootloader-configurations->gexp.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:07 +0000
Resent-Message-ID: <handler.73202.B73202.17268287815291 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287815291
          (code B ref 73202); Fri, 20 Sep 2024 10:40:07 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:41 +0000
Received: from localhost ([127.0.0.1]:34167 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb36-0001NA-TN
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:41 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2w-0001KU-2H
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828736;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=qBNIh/kScwIFDm4cVMybJISLgB15iFQHhIQqqC68N6I=;
 b=kYa1VIPDu0TbozIxMUfi3rFd3qi0pV+A4J1sRX6pF9zRr1rEjgRbz1ue4h25UzRRw3pNPA
 cueJCbXLjSq5T6q9SSmbgeNIA2H+hkyHUxjbakhNllwuUhTH86gmOh7w6LmP13vfwKsAt4
 sarTrIfBi1HQin3JIyHPX2VeaLbvBHC5dZqEp32/CXcaJ97NWOHldXJ8OIx0HPACUVJlM6
 nNYX/sTBGhNyRCOeBKnBt9peUd1AFwmA0fB8LdNlZJPqViyk+91IexTQpWuc9rwc0aY0ar
 BUTUyTXzUovPjwPPr0qYNTJERBwsHd70mJHDAKdnTgqNm+htKUu3JEA5NkhsWg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 408c324a
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:56 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:54 +0200
Message-ID: <36b06c055689a23a29e1ad8cc0e2617a1f57f900.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (bootloader)[default-targets]: Add field. (target-overrides, normalize,
 bootloader-configuration->gexp, 
 bootloader-configurations->gexp): New procedures. 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (bootloader)[default-targets]: Add field. (target-overrides, normalize, bootloader-configuration->gexp,
    bootloader-configurations->gexp): New procedures. 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (bootloader)[default-targets]: Add field.
(target-overrides, normalize, bootloader-configuration->gexp,
bootloader-configurations->gexp): New procedures.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/bootloader.scm | 108 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 108 insertions(+)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 0c24996205..c77de6f55e 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -67,6 +67,7 @@ (define-module (gnu bootloader)
             bootloader?
             bootloader-name
             bootloader-package
+            bootloader-default-targets
             bootloader-installer
             bootloader-disk-image-installer
             bootloader-configuration-file
@@ -107,6 +108,8 @@ (define-module (gnu bootloader)
             bootloader-configuration-device-tree-support?
             bootloader-configuration-extra-initrd
 
+            bootloader-configuration->gexp
+            bootloader-configurations->gexp
 
             efi-bootloader-chain))
 
@@ -255,6 +258,7 @@ (define-record-type* <bootloader>
   bootloader?
   (name                            bootloader-name)
   (package                         bootloader-package)
+  (default-targets bootloader-default-targets (default '()))
   (installer                       bootloader-installer)
   (disk-image-installer            bootloader-disk-image-installer
                                    (default #f))
@@ -498,6 +502,110 @@ (define (bootloader-configuration-targets config)
       ;; hence the default value of '(#f) rather than '().
       (list #f)))
 
+
+;;;
+;;; Bootloader installation paths.
+;;;
+
+(define (target-overrides . layers)
+  (let* ((types (flat-map (cute map bootloader-target-type <>) layers))
+         ;; TODO: use loop instead of fold for early termination.
+         (pred (lambda (type layer found)
+                 (or found (get-target-of-type type layer))))
+         (find (lambda (type) (fold (cute pred type <> <>) #f layers))))
+    (filter identity (map find (delete-duplicates types)))))
+
+(define (normalize targets)
+  "Augments TARGETS with filesystem information at runtime, allowing
+users to specify a lot less information.  Puts TARGETS into a normal
+form, where each path is fully specified up to a device offset."
+  (define (mass m)
+    `((,(mount-source m) . ,m)
+      (,(mount-point m) . ,m)))
+
+  (define (accessible=> d f)
+    (and d (access? d R_OK) (f d)))
+
+  (define (fixuuid target)
+    (match-record target <bootloader-target> (uuid file-system)
+      (let ((type (cond ((not file-system) 'dce)
+                        ((member file-system '("vfat" "fat32")) 'fat)
+                        ((string=? file-system "ntfs") 'ntfs)
+                        ((string=? file-system "iso9660") 'iso9660)
+                        (else 'dce))))
+        (bootloader-target (inherit target)
+          (uuid (cond ((uuid? uuid) uuid)
+                  ((bytevector? uuid) (bytevector->uuid uuid type))
+                  ((string? uuid) (string->uuid uuid type))
+                  (else #f)))))))
+
+  (define (arborify target targets)
+    (let* ((up (lambda (t) (and t (parent-of t targets))))
+           (proto (unfold target-base? identity up (up target) list))
+           (chain (reverse (cons target proto))))
+      (bootloader-target
+        (inherit target)
+        (offset (and=> (car chain) bootloader-target-type))
+        (path (reduce pathcat #f (map bootloader-target-path (cdr chain)))))))
+
+  (let ((amounts (delay (apply append (map mass (mounts))))))
+    (define (assoc-mnt f)
+      (lambda (v) (and=> (assoc-ref (force amounts) v) f)))
+
+    (define (scrape target)
+      (match-record target <bootloader-target>
+        (expected? path offset device label uuid file-system)
+        (if expected? target
+          (bootloader-target
+            (inherit target)
+            (device (or device
+                        (false-if-exception
+                          (or (and=> uuid find-partition-by-uuid)
+                              (and=> label find-partition-by-label)))
+                        (and path ((assoc-mnt mount-source)
+                                   (unfold-pathcat target targets)))))
+            (label (or label (accessible=> device read-partition-label)))
+            (uuid (or uuid (accessible=> device read-partition-uuid)))
+            (file-system (or file-system (and=> device (assoc-mnt mount-type))))
+            (offset (and path offset))
+            (path (or path (and=> device (assoc-mnt mount-point))))))))
+
+    (let ((mid (map (compose fixuuid scrape) targets)))
+      (map (cut arborify <> mid) mid))))
+
+(define* (bootloader-configuration->gexp bootloader-config args #:key
+                                          (root-offset "/") (overrides '()))
+  "Returns a gexp to install BOOTLOADER-CONFIG to its targets, passing ARGS
+to each installer alongside the additional #:bootloader-config keyword
+arguments.  Target OVERRIDES are applied and all path targets have ROOT-OFFSET
+applied.  The following keyword arguments are expected in ARGS:
+@enumerate
+@item current-boot-alternative
+@item old-boot-alternatives
+@item locale (from bootmeta)
+@item store-directory-prefix (from bootmeta)
+@item store-crypto-devices (from bootmeta)
+@end enumerate"
+  (let* ((bootloader (bootloader-configuration-bootloader bootloader-config))
+         (installer (bootloader-installer bootloader))
+         (auto-targets (list (bootloader-target
+                               (type 'root)
+                               (path root-offset)
+                               (offset #f))))
+         (targets (target-overrides
+                    overrides
+                    (bootloader-configuration-targets bootloader-config)
+                    auto-targets
+                    (bootloader-default-targets bootloader)))
+         (conf (bootloader-configuration
+                 (inherit bootloader-config)
+                 (targets (normalize targets)))))
+    (apply installer #:bootloader-config conf args)))
+
+(define (bootloader-configurations->gexp bootloader-configs . rest)
+  (apply gbegin (filter-map (cut apply bootloader-configuration->gexp <> rest)
+                            bootloader-configs)))
+
 
 ;;;
 ;;; Bootloaders.
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 05/15] guix: scripts: Rewrite reinstall-bootloader to use provenance data.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:07 +0000
Resent-Message-ID: <handler.73202.B73202.17268287825301 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287825301
          (code B ref 73202); Fri, 20 Sep 2024 10:40:07 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:42 +0000
Received: from localhost ([127.0.0.1]:34169 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb37-0001NI-G8
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:42 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43185
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2q-0001Kd-Ip
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:30 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828735;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=DwAo2jQ1bi8kjcxB4jfOBU7q1povzjxlSAJ+YxbvP9g=;
 b=aNYbi9mXbzaI64734AdfUFR5NZMEwIZdJ23tUnigE1V85rxw7eBfnIq/6jZ1KwgOC1N2+n
 K2R9uJkE2rpokXA7QK9cK4XWemRuvgSI71WsCjsCyoH1pxRwNb4oiMiXZeTHZ36uCYdrXy
 hh5MxtQsZraCiTFJDz10m76me2LGHKni9WX1OWZKKKGi1giqme+Lp3K/928L44OURBhUc4
 RRVzCVhJtFP1ZOhE+8RrgmJMZnflPI8Cwbmv7YjPHQAj83cYz1hFoBPkgu5I5dO8e20DIQ
 +TyH2TCQTrHu1lrzoR74RWMciCExxdRMcl8m+ERZhxGepXaCyeBDG8hdwS2nSg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 171fd720
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:54 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:50 +0200
Message-ID: <5b95c2bdceeeefb36857f7dfb869d19140fbae9d.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> Looking up
 bootloaders
 by name is broken because (extlinux) bootloaders share a name. Also,
 bootloader-configuration
 data is significant to bootloader installation, so it shouldn't just use
 the defaul [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> Looking up bootloaders
    by name is broken because (extlinux) bootloaders share a name. Also, bootloader-configuration
    data is significant to bootloader installation, so it shouldn't just use
   the defaul [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

Looking up bootloaders by name is broken because (extlinux) bootloaders
share a name.  Also, bootloader-configuration data is significant to
bootloader installation, so it shouldn't just use the default values.
Installation can rely on the provenance service instead, which should be
present for the vast majority of systems.

* gnu/bootloader.scm (%bootloaders): Delete variable.
(lookup-bootloader-by-name, bootloader-modules): Delete procedures.
* guix/scripts/system.scm (install-bootloader-from-os,
install-bootloader-from-provenance): Add procedures.
(reinstall-bootloader): Remove procedure.
(switch-to-system-generation, process-command): Use
install-bootloader-from-provenance.

Change-Id: I5713a43ad4f9f32a129d980db06d70de16b03f27
---
 gnu/bootloader.scm      | 26 ---------------
 guix/scripts/system.scm | 74 ++++++++++++++++-------------------------
 2 files changed, 28 insertions(+), 72 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 865521e6e5..3ea50a4004 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -26,7 +26,6 @@
 (define-module (gnu bootloader)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
-  #:use-module (guix discovery)
   #:use-module (guix gexp)
   #:use-module (guix profiles)
   #:use-module (guix records)
@@ -79,8 +78,6 @@ (define-module (gnu bootloader)
             bootloader-configuration-device-tree-support?
             bootloader-configuration-extra-initrd
 
-            %bootloaders
-            lookup-bootloader-by-name
 
             efi-bootloader-chain))
 
@@ -287,29 +284,6 @@ (define (bootloader-configuration-targets config)
 ;;; Bootloaders.
 ;;;
 
-(define (bootloader-modules)
-  "Return the list of bootloader modules."
-  (all-modules (map (lambda (entry)
-                      `(,entry . "gnu/bootloader"))
-                    %load-path)
-               #:warn warn-about-load-error))
-
-(define %bootloaders
-  ;; The list of publically-known bootloaders.
-  (delay (fold-module-public-variables (lambda (obj result)
-                                         (if (bootloader? obj)
-                                             (cons obj result)
-                                             result))
-                                       '()
-                                       (bootloader-modules))))
-
-(define (lookup-bootloader-by-name name)
-  "Return the bootloader called NAME."
-  (or (find (lambda (bootloader)
-              (eq? name (bootloader-name bootloader)))
-            (force %bootloaders))
-      (leave (G_ "~a: no such bootloader~%") name)))
-
 (define (efi-bootloader-profile packages files hooks)
   "Creates a profile from the lists of PACKAGES and FILES from the store.
 This profile is meant to be used by the bootloader-installer.
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 83a4de39d0..d23f9153e5 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -11,6 +11,8 @@
 ;;; Copyright © 2021 Brice Waegeneire <brice@HIDDEN>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@HIDDEN>
 ;;; Copyright © 2022 Tobias Geerinckx-Rice <me@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
+;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -88,6 +90,7 @@ (define-module (guix scripts system)
   #:use-module (srfi srfi-37)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
+  #:use-module (ice-9 receive)
   #:use-module (rnrs bytevectors)
   #:export (guix-system
             read-operating-system
@@ -377,61 +380,39 @@ (define (switch-to-system-generation store spec)
          (activate (string-append generation "/activate")))
     (if number
         (begin
-          (reinstall-bootloader store number)
+          (install-bootloader-from-provenance store number)
           (switch-to-generation* %system-profile number)
           (unless-file-not-found (primitive-load activate)))
         (leave (G_ "cannot switch to system generation '~a'~%") spec))))
 
-(define* (system-bootloader-name #:optional (system %system-profile))
-  "Return the bootloader name stored in SYSTEM's \"parameters\" file."
-  (let ((params (unless-file-not-found
-                 (read-boot-parameters-file system))))
-    (boot-parameters-bootloader-name params)))
-
-(define (reinstall-bootloader store number)
-  "Re-install bootloader for existing system profile generation NUMBER.
-STORE is an open connection to the store."
-  (let* ((generation (generation-file-name %system-profile number))
-         ;; Detect the bootloader used in %system-profile.
-         (bootloader (lookup-bootloader-by-name (system-bootloader-name)))
-
-         ;; Use the detected bootloader with default configuration.
-         ;; It will be enough to allow the system to boot.
-         (bootloader-config (bootloader-configuration
-                             (bootloader bootloader)))
-
-         ;; Make the specified system generation the default entry.
-         (chosen-alternative (generation->boot-alternative
-                              %system-profile number))
-         (params (boot-alternative-parameters chosen-alternative))
-         (locale (boot-parameters-locale params))
-         (store-crypto-devices (boot-parameters-store-crypto-devices params))
-         (store-directory-prefix
-          (boot-parameters-store-directory-prefix params))
-         (old-generations
-          (delv number (reverse (generation-numbers %system-profile))))
-         (previous-boot-alternatives (profile->boot-alternatives
-                                      %system-profile old-generations))
-         (entries (list (boot-parameters->menu-entry params)))
-         (old-entries (map boot-parameters->menu-entry
-                           (map boot-alternative-parameters
-                                previous-boot-alternatives))))
+(define (install-bootloader-from-os store number os)
+  "Re-install an old bootloader defined in <operating-system> record OS,
+for system profile generation NUMBER, with store STORE."
+  (let* ((os (read-operating-system os))
+         (bootloader-config (operating-system-bootloader os))
+         (numbers (generation-numbers %system-profile))
+         (numbers (delv number (reverse numbers)))
+         (old (profile->boot-alternatives %system-profile numbers))
+         (bootcfg (operating-system-bootcfg os old)))
     (run-with-store store
-      (mlet* %store-monad
-          ((bootcfg (lower-object
-                     ((bootloader-configuration-file-generator bootloader)
-                      bootloader-config entries
-                      #:locale locale
-                      #:store-crypto-devices store-crypto-devices
-                      #:store-directory-prefix store-directory-prefix
-                      #:old-entries old-entries)))
-           (drvs -> (list bootcfg)))
+      (mlet* %store-monad ((bootcfg (lower-object bootcfg))
+                           (drvs -> (list bootcfg)))
         (mbegin %store-monad
           (built-derivations drvs)
           ;; Only install bootloader configuration file.
           (install-bootloader local-eval bootloader-config bootcfg
                               #:run-installer? #f))))))
 
+(define (install-bootloader-from-provenance store number)
+  "Re-install an old bootloader using provenance data for system profile
+generation NUMBER with store STORE."
+  (receive (_ os)
+      (system-provenance (generation-file-name %system-profile number))
+    (if os
+        (install-bootloader-from-os store number os)
+        (leave (G_ "cannot rollback to generation '~a': no provenance~%")
+               number))))
+
 
 ;;;
 ;;; Graphs.
@@ -1391,10 +1372,11 @@ (define (process-command command args opts)
      (let ((pattern (match args
                       (() #f)
                       ((pattern) pattern)
-                      (x (leave (G_ "wrong number of arguments~%"))))))
+                      (_ (leave (G_ "wrong number of arguments~%")))))
+           (number (generation-number %system-profile)))
        (with-store* store
          (delete-matching-generations store %system-profile pattern)
-         (reinstall-bootloader store (generation-number %system-profile)))))
+         (install-bootloader-from-provenance store number))))
     ((switch-generation)
      (let ((pattern (match args
                       ((pattern) pattern)
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 10/15] gnu: bootloader: Add device-subvol field to menu-entry record.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:08 +0000
Resent-Message-ID: <handler.73202.B73202.17268287835308 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287835308
          (code B ref 73202); Fri, 20 Sep 2024 10:40:08 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:43 +0000
Received: from localhost ([127.0.0.1]:34171 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb38-0001NS-GG
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:43 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:49077
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2w-0001LI-5e
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828737;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=lPgCs4Nu2yl6xykEjUSkcYZmYylDxuSJxq1PmguWGiI=;
 b=e7+jliFtqPuCg+sNox+M13LTVjTnfUNncj7uty+3uLn/jlq3mQoefZx4Af9+W6n2ThzfNN
 R1Z2YJgnQxl2IJ2/21b8fqzf4n3m974EJrRZ1Hhw/UBNYFAGXZPpXB75PYuPdk9fbwLq/0
 ZRINOJGm/Z4Yj8uR2w7u/UxxakYODqDxEc/Ko287RFGIIDlZXW0uiugNGYBfvCskLrd9AS
 wyOrMzTX5AjMoAb5NOZDsmYkqC1DWNdPA9+j2kO52QDskOCe1NCB+QH5tL7yVfzWlBz0VB
 wsq+BPqhaIJUeV8Ii+Gs1tl+ominxhGzXkakiRxMxWb2srwFhjOBbtXe0/Fmaw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id e97864cb
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:57 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:55 +0200
Message-ID: <9ebe41c442f375788d3783fb780d11f8bdf3ed75.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (menu-entry-device-subvol): Add and export field. (normalize-file): Add
 procedure.
 (device->sexp): Match device-subvol and include in S-expression.
 (sexp->menu-entry): Try match d [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (menu-entry-device-subvol): Add and export field. (normalize-file): Add procedure.
    (device->sexp): Match device-subvol and include in S-expression. (sexp->menu-entry):
    Try match d [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (menu-entry-device-subvol): Add and export field.
(normalize-file): Add procedure.
(device->sexp): Match device-subvol and include in S-expression.
(sexp->menu-entry): Try match device-subvol and include in menu-entry.
* gnu/system/boot.scm (boot-parameters->menu-entry): Add device-subvol
value to menu-entry.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/bootloader.scm  | 51 ++++++++++++++++++++++++++++++++++-----------
 gnu/system/boot.scm |  2 ++
 2 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index c77de6f55e..f1352122a9 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -51,15 +51,17 @@ (define-module (gnu bootloader)
             menu-entry?
             menu-entry-label
             menu-entry-device
+            menu-entry-device-mount-point
+            menu-entry-device-subvol
             menu-entry-linux
             menu-entry-linux-arguments
             menu-entry-initrd
-            menu-entry-device-mount-point
             menu-entry-multiboot-kernel
             menu-entry-multiboot-arguments
             menu-entry-multiboot-modules
             menu-entry-chain-loader
 
+            normalize-file
             menu-entry->sexp
             sexp->menu-entry
 
@@ -126,6 +128,8 @@ (define-record-type* <menu-entry>
                    (default #f))
   (device-mount-point menu-entry-device-mount-point
                    (default #f))
+  (device-subvol menu-entry-device-subvol
+                   (default #f))
   (linux           menu-entry-linux
                    (default #f))
   (linux-arguments menu-entry-linux-arguments
@@ -142,6 +146,18 @@ (define-record-type* <menu-entry>
   (chain-loader     menu-entry-chain-loader
                     (default #f)))         ; string, path of efi file
 
+(define (normalize-file entry file)
+  "Normalize a file FILE stored in a menu entry into one suitable for a
+bootloader.  Realizes device-mount-point and device-subvol."
+  (match-menu-entry entry (device-mount-point device-subvol)
+    ;; Avoid using cut procedure from SRFI-26 inside G-exp.
+    (let ((mount (and=> device-mount-point (cut string-trim <> #\/))))
+      #~(let* ((file (string-trim #$file #\/))
+               (file (if (and #$mount (string-prefix? #$mount file))
+                         (substring file (string-length #$mount))
+                         file)))
+          (string-append (or #$device-subvol "") "/" file)))))
+
 (define (report-menu-entry-error menu-entry)
   (raise
    (condition
@@ -169,7 +185,7 @@ (define (menu-entry->sexp entry)
        `(label ,(file-system-label->string label)))
       (_ device)))
   (match entry
-    (($ <menu-entry> label device mount-point
+    (($ <menu-entry> label device mount-point subvol
                      (? identity linux) linux-arguments (? identity initrd)
                      #f () () #f)
      `(menu-entry (version 0)
@@ -178,8 +194,9 @@ (define (menu-entry->sexp entry)
                   (device-mount-point ,mount-point)
                   (linux ,linux)
                   (linux-arguments ,linux-arguments)
-                  (initrd ,initrd)))
-    (($ <menu-entry> label device mount-point #f () #f
+                  (initrd ,initrd)
+                  (device-subvol ,subvol)))
+    (($ <menu-entry> label device mount-point subvol #f () #f
                      (? identity multiboot-kernel) multiboot-arguments
                      multiboot-modules #f)
      `(menu-entry (version 0)
@@ -188,19 +205,23 @@ (define (menu-entry->sexp entry)
                   (device-mount-point ,mount-point)
                   (multiboot-kernel ,multiboot-kernel)
                   (multiboot-arguments ,multiboot-arguments)
-                  (multiboot-modules ,multiboot-modules)))
-    (($ <menu-entry> label device mount-point #f () #f #f () ()
+                  (multiboot-modules ,multiboot-modules)
+                  (device-subvol ,subvol)))
+    (($ <menu-entry> label device mount-point subvol #f () #f #f () ()
                      (? identity chain-loader))
      `(menu-entry (version 0)
                   (label ,label)
                   (device ,(device->sexp device))
                   (device-mount-point ,mount-point)
-                  (chain-loader ,chain-loader)))
+                  (chain-loader ,chain-loader)
+                  (device-subvol ,subvol)))
     (_ (report-menu-entry-error entry))))
 
 (define (sexp->menu-entry sexp)
   "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a <menu-entry>
 record."
+  ;; XXX: The match ORs shadow subvol.
+  (define subvol #f)
   (define (sexp->device device-sexp)
     (match device-sexp
       (('uuid type uuid-string)
@@ -213,35 +234,41 @@ (define (sexp->menu-entry sexp)
                   ('label label) ('device device)
                   ('device-mount-point mount-point)
                   ('linux linux) ('linux-arguments linux-arguments)
-                  ('initrd initrd) _ ...)
+                  ('initrd initrd)
+                  (or ('device-subvol subvol _ ...) (_ ...)))
      (menu-entry
       (label label)
       (device (sexp->device device))
       (device-mount-point mount-point)
+      (device-subvol subvol)
       (linux linux)
       (linux-arguments linux-arguments)
       (initrd initrd)))
     (('menu-entry ('version 0)
                   ('label label) ('device device)
-                  ('device-mount-point mount-point)
+                  ('device-mount-point mount-point) ('device-subvol subvol)
                   ('multiboot-kernel multiboot-kernel)
                   ('multiboot-arguments multiboot-arguments)
-                  ('multiboot-modules multiboot-modules) _ ...)
+                  ('multiboot-modules multiboot-modules)
+                  (or ('device-subvol subvol _ ...) (_ ...)))
      (menu-entry
       (label label)
       (device (sexp->device device))
       (device-mount-point mount-point)
+      (device-subvol subvol)
       (multiboot-kernel multiboot-kernel)
       (multiboot-arguments multiboot-arguments)
       (multiboot-modules multiboot-modules)))
     (('menu-entry ('version 0)
                   ('label label) ('device device)
-                  ('device-mount-point mount-point)
-                  ('chain-loader chain-loader) _ ...)
+                  ('device-mount-point mount-point) ('device-subvol subvol)
+                  ('chain-loader chain-loader)
+                  (or ('device-subvol subvol _ ...) (_ ...)))
      (menu-entry
       (label label)
       (device (sexp->device device))
       (device-mount-point mount-point)
+      (device-subvol subvol)
       (chain-loader chain-loader)))))
 
 
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index a898ab9549..8a183ebe3a 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -16,6 +16,7 @@
 ;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@HIDDEN>
 ;;; Copyright © 2023 Bruno Victal <mirai@HIDDEN>
 ;;; Copyright © 2023 Felix Lechner <felix.lechner@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -332,6 +333,7 @@ (define (boot-parameters->menu-entry conf)
      (label (boot-parameters-label conf))
      (device (boot-parameters-store-device conf))
      (device-mount-point (boot-parameters-store-mount-point conf))
+     (device-subvol (boot-parameters-store-directory-prefix conf))
      (linux (and (not multiboot?) kernel))
      (linux-arguments (if (not multiboot?)
                           (boot-parameters-kernel-arguments conf)
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 11/15] gnu: build: bootloader: Add efi-bootnums procedure.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:08 +0000
Resent-Message-ID: <handler.73202.B73202.17268287835315 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287835315
          (code B ref 73202); Fri, 20 Sep 2024 10:40:08 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:43 +0000
Received: from localhost ([127.0.0.1]:34173 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb39-0001NZ-5H
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:43 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2x-0001KU-17
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:31 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828738;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=ahYOiYejvGUtNAnSjkb6HMGrj1pd/GqjJ61kZBWbi9A=;
 b=NN1T3WpWUf4k+3qfAJvOXlmfYSiFpoe7GSIvY9RlxO8BBFd2ckPMUoeqsP56Dx+2dOeCfU
 hoEVdMJGOjwEk05eq8NZEAnQrLl2mjc+QXpIO6pN3PEfbPyOrhzB/LbbRj+F5FtH3lseAY
 FOvj8ciPpbpTS9Vo7FH+VeZnI4drzm7XdkJo7DNGK4V+AyyVCtyYvfo4hSSFrAgR7smfqo
 FJiTN3R1pjuaNrzf+7EEu2yYtdsDYA3vWksO7U4vttpLGnx+qmZ56qo0w06/YYovHTcnOM
 xkwT/JgCf3PV9bsUrsjV1vnI7UrYnJZyGCT0VmHAdEYwt4PLjLKg9IUROP4SJQ==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id d76c76f8
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:58 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:56 +0200
Message-ID: <5bb21b9075822392a90e3e5aeb4e5daa2fcfff82.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/build/bootloader.scm
 (atomic-copy, efi-bootnums): Add procedures. (in-temporary-directory): Add
 macro. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 ---
 gnu/build/bootloader.scm
 | 48 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+),
 1 deletion(-) 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/build/bootloader.scm
    (atomic-copy, efi-bootnums): Add procedures. (in-temporary-directory): Add
    macro. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 --- gnu/build/bootloader.scm
    | 48 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+),
    1 deletion(-) 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/build/bootloader.scm (atomic-copy, efi-bootnums): Add procedures.
(in-temporary-directory): Add macro.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/build/bootloader.scm | 48 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scm
index af6063a884..3934e03aee 100644
--- a/gnu/build/bootloader.scm
+++ b/gnu/build/bootloader.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2019 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@HIDDEN>
 ;;; Copyright © 2022 Timothy Sample <samplet@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,13 +21,25 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu build bootloader)
+  #:autoload   (guix build syscalls) (free-disk-space)
   #:use-module (guix build utils)
   #:use-module (guix utils)
   #:use-module (ice-9 binary-ports)
+  #:use-module (guix diagnostics)
+  #:use-module (guix i18n)
   #:use-module (ice-9 format)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 popen)
+  #:use-module (ice-9 receive)
+  #:use-module (ice-9 regex)
   #:use-module (rnrs io ports)
   #:use-module (rnrs io simple)
-  #:export (write-file-on-device
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-35)
+  #:export (atomic-copy
+            in-temporary-directory
+            write-file-on-device
             install-efi-loader))
 
 
@@ -34,6 +47,21 @@ (define-module (gnu build bootloader)
 ;;; Writing utils.
 ;;;
 
+(define (atomic-copy from to)
+  (let ((pivot (string-append to ".new")))
+    (copy-file from pivot)
+    (rename-file pivot to)))
+
+(define-syntax-rule (in-temporary-directory blocks ...)
+  "Run BLOCKS while chdir'd into a temporary directory."
+  ;; Under POSIX.1-2008, mkdtemp must make the dir with 700 perms.
+  (let* ((tmp (or (getenv "TMPDIR") "/tmp"))
+         (dir (mkdtemp (string-append tmp "/guix-bootloader.XXXXXX")))
+         (cwd (getcwd)))
+    (dynamic-wind (lambda () (chdir dir))
+                  (lambda () blocks ...)
+                  (lambda () (chdir cwd) (delete-file-recursively dir)))))
+
 (define (write-file-on-device file size device offset)
   "Write SIZE bytes from FILE to DEVICE starting at OFFSET."
   (call-with-input-file file
@@ -56,6 +84,24 @@ (define (write-file-on-device file size device offset)
 ;;; EFI bootloader.
 ;;;
 
+;; XXX: Parsing efibootmgr output may be kinda jank.  A better way may exist.
+(define (efi-bootnums efibootmgr)
+  "Returns '(path . bootnum) pairs for each EFI boot entry.  bootnum is
+a string, and path is backslash-deliminated and relative to the ESP."
+  (let* ((pipe (open-pipe* OPEN_READ efibootmgr))
+         (text (get-string-all pipe))
+         (status (status:exit-val (close-pipe pipe)))
+         (bootnum-pattern
+           "^Boot([0-9a-fA-F]+).*[^A-Za-z]File\\(([^)]+)\\)$"))
+    (unless (zero? status)
+      (raise-exception
+        (formatted-message (G_ "efibootmgr exited with error code ~a") status)))
+    (fold-matches (make-regexp bootnum-pattern regexp/newline) text '()
+                  (lambda (match acc)
+                    (let* ((path (match:substring match 2))
+                           (bootnum (match:substring match 1)))
+                      (cons (cons path bootnum) acc))))))
+
 (define* (install-efi grub grub-config esp #:key targets)
   "Write a self-contained GRUB EFI loader to the mounted ESP using
 GRUB-CONFIG.
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 13/15] gnu: bootloader: Match records outside the module.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:09 +0000
Resent-Message-ID: <handler.73202.B73202.17268287975345 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287975345
          (code B ref 73202); Fri, 20 Sep 2024 10:40:09 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:57 +0000
Received: from localhost ([127.0.0.1]:34175 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb3M-0001O6-Ow
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:57 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:49077
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2x-0001LI-MB
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828739;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=MGXJGMlBS2JxeQ9UHG5y4t5h/ac6O9cs+W8GkavSdxg=;
 b=V0IU4Prql54YM2qCJTgGf8JObJRqiSeN9UX6NSd8iTUHNs+mbIJuu1d2PTrz+wRKpkCVOm
 CbCn+pphSi2/K0GS81MSoI/fbOA2YzdPBHU/Lbu8LxxtKqP10H/kBGCQdGdPf/UTstaRlT
 AKsaO2UcNB5fy8iNevaqEQlpJdAyFFloja+GX3zBIk9u1TNUjnq9S4pFSP3Cwz2lcV9g36
 aP+KhgoL0HdmD4uhrNtfQpcdkmX2v7DY/6xq2Vedf1Wo19xVipz+USkKk9n+c7f7Qsxow6
 v5yoryDHFBzTuHl+coknVFV/xXhGYqm7yaBheVzj5O+GlLNi0u82R1nJ2us+sg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 4ac43d61
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO)
 for <73202 <at> debbugs.gnu.org>; Fri, 20 Sep 2024 10:38:59 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:58 +0200
Message-ID: <a872720357926e5b9df856bf793fd84a95917207.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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:  * gnu/bootloader.scm (match-bootloader-configuration,
 match-menu-entry):
 Add macros. Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b ---
 gnu/bootloader.scm
 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  * gnu/bootloader.scm (match-bootloader-configuration, match-menu-entry):
    Add macros. Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b --- gnu/bootloader.scm
    | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

* gnu/bootloader.scm (match-bootloader-configuration, match-menu-entry):
Add macros.

Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b
---
 gnu/bootloader.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 6b08e61492..b1ed187aa2 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@HIDDEN>
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
 ;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
+;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -115,6 +116,9 @@ (define-module (gnu bootloader)
             bootloader-configuration->gexp
             bootloader-configurations->gexp
 
+            match-bootloader-configuration
+            match-menu-entry
+
             %efi-supported-systems
             efi-arch
             install-efi
@@ -642,6 +646,20 @@ (define (bootloader-configurations->gexp bootloader-configs . rest)
   (apply gbegin (filter-map (cut apply bootloader-configuration->gexp <> rest)
                             bootloader-configs)))
 
+;; In lieu of exporting bootloader-configuration and menu-entry RTDs.
+(define-syntax match-bootloader-configuration
+  (syntax-rules ()
+    "Bind each BOOTLOADER-CONFIGURATION field in FIELDS."
+    ((_ bootloader-configuration (fields ...) body ...)
+     (match-record bootloader-configuration <bootloader-configuration>
+                   (fields ...) body ...))))
+
+(define-syntax match-menu-entry
+  (syntax-rules ()
+    "Bind each MENU-ENTRY field in FIELDS."
+    ((_ menu-entry (fields ...) body ...)
+     (match-record menu-entry <menu-entry> (fields ...) body ...))))
+
 
 ;;;
 ;;; Bootloader installation to ESP.
-- 
2.45.2





Message sent to pelzflorian@HIDDEN, ludo@HIDDEN, maxim.cournoyer@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 12/15] gnu: bootloader: Install any bootloader to ESP.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: pelzflorian@HIDDEN, ludo@HIDDEN, maxim.cournoyer@HIDDEN, guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:09 +0000
Resent-Message-ID: <handler.73202.B73202.17268287995353 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Florian Pelz <pelzflorian@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-Debbugs-Original-Xcc: Florian Pelz <pelzflorian@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287995353
          (code B ref 73202); Fri, 20 Sep 2024 10:40:09 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:59 +0000
Received: from localhost ([127.0.0.1]:34177 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb3N-0001OA-Ds
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:58 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43185
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2x-0001Kd-42
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828738;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=l2Ib8TUuId3fa/0/TUPCFG/VuPhW0cCnZY3ZbhGCG0U=;
 b=rcyGWR64HdZY38AFu9e8Gd4EmYty0uNtN9bF/dT+kjVHkfGo8gQDyz/JTPzNjLjNC2GdXA
 OQNzYkkcXumCWLfMyA3ZGmull584Z5lC5Rj+916gpDINvp1IRxLXI8Hu0TDa6BmmauwVl9
 IxMu41UaIj37z7IO37LwVJB8IpGbg3RJvqWuSJ10JJsgLHxbvdEgfjTP/Mjc7fS0olyhlt
 Z+5RlW50HY+PU9UIsZfWLm0WAr2G7U8AWiH+1AKI0M8+QUadFZCsPq/5wqitETJ1mxbxAG
 4hZMpSaWsA166Xnkk1hMXl59xllA63TBecvKoAlfYo+9VQHmOtF0MWFV/OMBng==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 352f43b3
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:58 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:57 +0200
Message-ID: <52e31df0e5a3a0d0c4b015d135d5eb0ce3e4829e.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (efi-arch, install-efi): New procedures. (%efi-supported-systems,
 lazy-efibootmgr):
 New variables. (bootloader-configuration)[efi-removable?, 32bit?]: New fields.
 (match-bootloade [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (efi-arch, install-efi): New procedures. (%efi-supported-systems, lazy-efibootmgr):
    New variables. (bootloader-configuration)[efi-removable?, 32bit?]: New fields.
    (match-bootloade [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (efi-arch, install-efi): New procedures.
(%efi-supported-systems, lazy-efibootmgr): New variables.
(bootloader-configuration)[efi-removable?, 32bit?]: New fields.
(match-bootloader-configuration, match-menu-entry): New macros.
* gnu/build/bootloader.scm (install-efi-loader): Delete procedure.
(install-efi): Rewrite to support installation of any efi bootloader.
* gnu/build/image.scm (initialize-efi32-partition): Deprecate.
(initialize-efi-partitition): Only create EFI directory.
* gnu/image.scm (partition)[target]: New field in order to support
dynamic provision of image partitions as bootloader targets.
* gnu/system/image.scm (root-partition, esp-partition): Use target
field.
* gnu/system/image.scm (esp32-partition, efi32-disk-partition,
efi32-raw-image-type): Deprecate.
* doc/guix.texi (Creating System Images)[image Reference]<partition
Reference>: Add target field.
[Instantiate an Image]: Update examples and update formatting.
<efi32-disk-image, efi32-raw-image-type>: Delete.
<pinebook-pro-image-type, rock64-image-type>: Reword slightly.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 doc/guix.texi            |  34 ++++++------
 gnu/bootloader.scm       |  56 ++++++++++++++++++-
 gnu/build/bootloader.scm | 115 ++++++++++++++++++++-------------------
 gnu/build/image.scm      |  23 ++------
 gnu/image.scm            |   4 ++
 gnu/system/image.scm     |  22 +++-----
 6 files changed, 150 insertions(+), 104 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index f7fb4b4cc3..eb24ab9798 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -130,6 +130,7 @@
 Copyright @copyright{} 2024 Dariqq@*
 Copyright @copyright{} 2024 Denis 'GNUtoo' Carikli@*
 Copyright @copyright{} 2024 Fabio Natali@*
+Copyright @copyright{} 2024 Lilah Tascheter@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -47950,6 +47951,12 @@ partition Reference
 this flag set, usually the root one. The @code{'esp} flag identifies a
 UEFI System Partition.
 
+@item @code{target} (default: @var{#f})
+If provided, this partition provides itself as a bootloader target
+(@pxref{Bootloader Configuration}).  Most commonly, this is used to provide the
+@code{'root} and @code{'esp} targets, with the root partition and EFI System
+Partition, respectively, though this can provide any target necessary.
+
 @item @code{initializer} (default: @code{#false})
 The partition initializer procedure as a gexp.  This procedure is called
 to populate a partition.  If no initializer is passed, the
@@ -47998,6 +48005,7 @@ Instantiate an Image
     (label "GNU-ESP")
     (file-system "vfat")
     (flags '(esp))
+    (target 'esp)
     (initializer (gexp initialize-efi-partition)))
    (partition
     (size (* 50 MiB))
@@ -48014,15 +48022,17 @@ Instantiate an Image
     (label root-label)
     (file-system "ext4")
     (flags '(boot))
+    (target 'root)
     (initializer (gexp initialize-root-partition))))))
 @end lisp
 
-Note that the first and third partitions use generic initializers
-procedures, initialize-efi-partition and initialize-root-partition
-respectively.  The initialize-efi-partition installs a GRUB EFI loader
-that is loading the GRUB bootloader located in the root partition.  The
-initialize-root-partition instantiates a complete system as defined by
-the @code{%simple-os} operating-system.
+Note that the first and third partitions use generic initializer
+procedures, @code{initialize-efi-partition} and
+@code{initialize-root-partition} respectively.
+@code{initialize-efi-partition} simply creates the directory structure
+for an EFI bootloader to install itself to.
+@code{initialize-root-partition} instantiates a complete system as
+defined by the @code{%simple-os} operating-system.
 
 You can now run:
 
@@ -48079,10 +48089,6 @@ Instantiate an Image
 @code{i686} machines, supporting BIOS or UEFI booting.
 @end defvar
 
-@defvar efi32-disk-image
-Same as @code{efi-disk-image} but with a 32 bits EFI partition.
-@end defvar
-
 @defvar iso9660-image
 An ISO-9660 image composed of a single bootable partition.  This image
 can also be used on most @code{x86_64} and @code{i686} machines.
@@ -48173,10 +48179,6 @@ image-type Reference
 Build an image based on the @code{efi-disk-image} image.
 @end defvar
 
-@defvar efi32-raw-image-type
-Build an image based on the @code{efi32-disk-image} image.
-@end defvar
-
 @defvar qcow2-image-type
 Build an image based on the @code{mbr-disk-image} image but with the
 @code{compressed-qcow2} image format.
@@ -48204,14 +48206,14 @@ image-type Reference
 @defvar pinebook-pro-image-type
 Build an image that is targeting the Pinebook Pro machine.  The MBR
 image contains a single partition starting at a @code{9MiB} offset.  The
-@code{u-boot-pinebook-pro-rk3399-bootloader} bootloader will be
+@code{u-boot-pinebook-pro-rk3399-bootloader} bootloader can be
 installed in this gap.
 @end defvar
 
 @defvar rock64-image-type
 Build an image that is targeting the Rock64 machine.  The MBR image
 contains a single partition starting at a @code{16MiB} offset.  The
-@code{u-boot-rock64-rk3328-bootloader} bootloader will be installed in
+@code{u-boot-rock64-rk3328-bootloader} bootloader can be installed in
 this gap.
 @end defvar
 
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index f1352122a9..6b08e61492 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -100,6 +100,8 @@ (define-module (gnu bootloader)
             bootloader-configuration-targets
             bootloader-configuration-menu-entries
             bootloader-configuration-default-entry
+            bootloader-configuration-efi-removable?
+            bootloader-configuration-32bit?
             bootloader-configuration-timeout
             bootloader-configuration-keyboard-layout
             bootloader-configuration-theme
@@ -113,6 +115,9 @@ (define-module (gnu bootloader)
             bootloader-configuration->gexp
             bootloader-configurations->gexp
 
+            %efi-supported-systems
+            efi-arch
+            install-efi
             efi-bootloader-chain))
 
 
@@ -502,6 +507,10 @@ (define-record-type* <bootloader-configuration>
                          (default '()))   ;list of <menu-entry>
   (default-entry         bootloader-configuration-default-entry
                          (default 0))     ;integer
+  (efi-removable?        bootloader-configuration-efi-removable?
+                         (default #f))    ;bool
+  (32bit?                bootloader-configuration-32bit?
+                         (default #f))    ;bool
   (timeout               bootloader-configuration-timeout
                          (default 5))     ;seconds as integer
   (keyboard-layout       bootloader-configuration-keyboard-layout
@@ -635,9 +644,54 @@ (define (bootloader-configurations->gexp bootloader-configs . rest)
 
 
 ;;;
-;;; Bootloaders.
+;;; Bootloader installation to ESP.
 ;;;
 
+;; systems currently supported by efi-arch. should be used for packages relying
+;; on it.
+(define %efi-supported-systems
+  '("i686-linux" "x86_64-linux" "armhf-linux" "aarch64-linux" "riscv64-linux"))
+
+(define* (efi-arch #:key (target (or (%current-target-system) (%current-system)))
+                         (32? #f))
+  "Returns the UEFI architecture name for the current target, in lowercase."
+  (cond ((target-x86-32? target)  "ia32")
+        ((target-x86-64? target)  (if 32? "ia32" "x64"))
+        ((target-arm32? target)   "arm")
+        ((target-aarch64? target) (if 32? "arm" "aa64"))
+        ((target-riscv64? target) (if 32? "riscv32" "riscv64"))
+        (else (raise (formatted-message (G_ "no UEFI standard arch for ~a!")
+                                        target)))))
+
+(define (lazy-efibootmgr)
+  "Lazy-loaded efibootmgr package, in order to prevent circular refs."
+  (module-ref (resolve-interface '(gnu packages linux)) 'efibootmgr))
+
+(define (install-efi bootloader-config plan)
+  "Returns a gexp installing PLAN to the ESP, as denoted by the 'vendir target.
+PLAN is a gexp of a list of '(BUILDER DEST-BASENAME . LABEL) triples, that
+should be in boot order.  If the user selects a removable bootloader, only the
+first entry in PLAN is used."
+  (match-record bootloader-config <bootloader-configuration>
+    (targets efi-removable? 32bit?)
+    (if efi-removable?
+      ;; Hard code the output location to a well-known path recognized by
+      ;; compliant firmware.  See "3.5.1.1 Removable Media Boot Behaviour":
+      ;; http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf
+      (with-targets targets
+        (('esp => (path :path))
+         #~(let ((boot #$(string-append path "/EFI/BOOT"))
+                 (arch #$(string-upcase (efi-arch #:32? 32bit?)))
+                 (builder (car (car #$plan))))
+             (mkdir-p boot)
+             ;; Only realize the first planspec.
+             (builder (string-append boot "/BOOT" arch ".EFI")))))
+      ;; Install normally if not configured as removable.
+      (with-targets targets
+        (('vendir => (vendir :path) (loader :devpath) (disk :device))
+         #~(install-efi #+(file-append (lazy-efibootmgr) "/sbin/efibootmgr")
+                        #$vendir #$loader #$disk #$plan))))))
+
 (define (efi-bootloader-profile packages files hooks)
   "Creates a profile from the lists of PACKAGES and FILES from the store.
 This profile is meant to be used by the bootloader-installer.
diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scm
index 3934e03aee..064466bd33 100644
--- a/gnu/build/bootloader.scm
+++ b/gnu/build/bootloader.scm
@@ -23,8 +23,6 @@
 (define-module (gnu build bootloader)
   #:autoload   (guix build syscalls) (free-disk-space)
   #:use-module (guix build utils)
-  #:use-module (guix utils)
-  #:use-module (ice-9 binary-ports)
   #:use-module (guix diagnostics)
   #:use-module (guix i18n)
   #:use-module (ice-9 format)
@@ -40,7 +38,7 @@ (define-module (gnu build bootloader)
   #:export (atomic-copy
             in-temporary-directory
             write-file-on-device
-            install-efi-loader))
+            install-efi))
 
 
 ;;;
@@ -102,57 +100,62 @@ (define (efi-bootnums efibootmgr)
                            (bootnum (match:substring match 1)))
                       (cons (cons path bootnum) acc))))))
 
-(define* (install-efi grub grub-config esp #:key targets)
-  "Write a self-contained GRUB EFI loader to the mounted ESP using
-GRUB-CONFIG.
-
-If TARGETS is set, use its car as the GRUB image format and its cdr as
-the output filename.  Otherwise, use defaults for the host platform."
-  (let* ((system %host-type)
-         ;; Hard code the output location to a well-known path recognized by
-         ;; compliant firmware. See "3.5.1.1 Removable Media Boot Behaviour":
-         ;; http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf
-         (grub-mkstandalone (string-append grub "/bin/grub-mkstandalone"))
-         (efi-directory (string-append esp "/EFI/BOOT"))
-         ;; Map grub target names to boot file names.
-         (efi-targets (or targets
-                          (cond ((string-prefix? "x86_64" system)
-                                 '("x86_64-efi" . "BOOTX64.EFI"))
-                                ((string-prefix? "i686" system)
-                                 '("i386-efi" . "BOOTIA32.EFI"))
-                                ((string-prefix? "armhf" system)
-                                 '("arm-efi" . "BOOTARM.EFI"))
-                                ((string-prefix? "aarch64" system)
-                                 '("arm64-efi" . "BOOTAA64.EFI"))))))
-    ;; grub-mkstandalone requires a TMPDIR to prepare the firmware image.
-    (setenv "TMPDIR" esp)
-
-    (mkdir-p efi-directory)
-    (invoke grub-mkstandalone "-O" (car efi-targets)
-            "-o" (string-append efi-directory "/"
-                                (cdr efi-targets))
-            ;; Graft the configuration file onto the image.
-            (string-append "boot/grub/grub.cfg=" grub-config))))
-
-(define* (install-efi-loader grub-efi esp #:key targets)
-  "Install in ESP directory the given GRUB-EFI bootloader.  Configure it to
-load the Grub bootloader located in the 'Guix_image' root partition.
-
-If TARGETS is set, use its car as the GRUB image format and its cdr as
-the output filename.  Otherwise, use defaults for the host platform."
-  (let ((grub-config "grub.cfg"))
-    (call-with-output-file grub-config
-      (lambda (port)
-        ;; Create a tiny configuration file telling the embedded grub where to
-        ;; load the real thing.  XXX This is quite fragile, and can prevent
-        ;; the image from booting when there's more than one volume with this
-        ;; label present.  Reproducible almost-UUIDs could reduce the risk
-        ;; (not eliminate it).
-        (format port
-                "insmod part_msdos~@
-               insmod part_gpt~@
-               search --set=root --label Guix_image~@
-               configfile /boot/grub/grub.cfg~%")))
-    (install-efi grub-efi grub-config esp #:targets targets)
-    (delete-file grub-config)))
+(define (install-efi efibootmgr vendir loader* disk plan)
+  "See also install-efi in (gnu bootloader)."
+  (let* ((loader (string-map (match-lambda (#\/ #\\) (x x)) loader*))
+         (bootnums (filter (compose (cut string-prefix? loader <>) car)
+                     (efi-bootnums efibootmgr)))
+         (plan-files (map cadr plan)))
+    (define (size file) (if (file-exists? file) (stat:size (stat file)) 0))
+    (define (vendirof file) (string-append vendir "/" file))
+    (define (loaderof file) (string-append loader "\\" file))
+    (define (delete-boot num file)
+      (invoke efibootmgr "--quiet" "--bootnum" num "--delete-bootnum")
+      (when (file-exists? file) (delete-file file)))
 
+    (mkdir-p vendir)
+    ;; Delete old entries first, to clear up space.
+    (for-each (lambda (spec) ; '(path . bootnum)
+                (let* ((s (substring (car spec) (string-length loader)))
+                       (file (substring s (if (string-prefix? "\\" s) 1 0))))
+                  (unless (member file plan-files)
+                    (delete-boot (cdr spec) (vendirof file)))))
+      bootnums)
+    ;; New and updated entries.
+    (in-temporary-directory
+      (for-each
+        (lambda (spec)
+          (let* ((builder (car spec)) (name (cadr spec))
+                 (dest (vendirof name)) (loadest (loaderof name))
+                 (rest (reverse (cdr (member name plan-files)))))
+            ;; Build to a temporary file so we can check its size.
+            (builder name)
+            ;; Disk space is usually limited on ESPs.
+            ;; Try to clear space as we install new bootloaders.
+            (if (while (> (- (size name) (size dest)) (free-disk-space vendir))
+                  (let ((del (find (compose file-exists? vendirof) rest)))
+                    (if del (delete-file (vendirof del)) (break #t))))
+                (begin
+                  (and=> (assoc-ref bootnums loadest) (cut delete-boot <> dest))
+                  (warning (G_ "ESP too small for bootloader ~a!~%") name))
+                ;; The ESP is too small for atomic copy.
+                (begin
+                  (copy-file name dest)
+                  (unless (assoc loadest bootnums)
+                    (invoke
+                      efibootmgr "--quiet" "--create-only" "--label"
+                      (cddr spec) "--disk" disk "--loader" loadest))))
+            (delete-file name)))
+        plan))
+    ;; Verify that at least the first entry was installed.
+    (unless (file-exists? (vendirof (cadr (car plan))))
+      ;; Extremely fatal error so we use leave instead of raise.
+      (leave (G_ "not enough space in ESP to install bootloader!
+ SYSTEM WILL NOT BOOT UNLESS THIS IS FIXED!~%")))
+    ;; Some UEFI systems will refuse to acknowledge the existence of boot
+    ;; entries unless they're in bootorder, so just shove everything in there.
+    (invoke
+      efibootmgr "--quiet" "--bootorder"
+      ;; Recall efi-bootnums to get a fresh list with new installs.
+      (let ((num (cute assoc-ref (efi-bootnums efibootmgr) <>))) ; cute is eager
+        (string-join (filter-map (compose num loaderof) plan-files) ",")))))
diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 6ca0a428e0..1b2d4da814 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2022 Pavel Shlyak <p.shlyak@HIDDEN>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@HIDDEN>
 ;;; Copyright © 2023 Efraim Flashner <efraim@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +29,7 @@ (define-module (gnu build image)
   #:use-module (guix build store-copy)
   #:use-module (guix build syscalls)
   #:use-module (guix build utils)
+  #:use-module (guix deprecation)
   #:use-module (guix store database)
   #:use-module (guix utils)
   #:use-module (gnu build bootloader)
@@ -181,23 +183,10 @@ (define* (register-closure prefix closure
                        #:prefix prefix
                        #:registration-time %epoch)))))
 
-(define* (initialize-efi-partition root
-                                   #:key
-                                   grub-efi
-                                   #:allow-other-keys)
-  "Install in ROOT directory, an EFI loader using GRUB-EFI."
-  (install-efi-loader grub-efi root))
-
-(define* (initialize-efi32-partition root
-                                     #:key
-                                     grub-efi32
-                                     #: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")))))
+(define (initialize-efi-partition root . rest)
+  (mkdir-p (string-append root "/EFI")))
+
+(define-deprecated/alias initialize-efi32-partition initialize-efi-partition)
 
 (define* (initialize-root-partition root
                                     #:key
diff --git a/gnu/image.scm b/gnu/image.scm
index 7fb06dec10..c6cc264147 100644
--- a/gnu/image.scm
+++ b/gnu/image.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020, 2022 Mathieu Othacehe <othacehe@HIDDEN>
 ;;; Copyright © 2023 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -35,6 +36,7 @@ (define-module (gnu image)
             partition-label
             partition-uuid
             partition-flags
+            partition-target
             partition-initializer
 
             image
@@ -131,6 +133,8 @@ (define-record-type* <partition> partition make-partition
   (flags                partition-flags
                         (default '())  ;list of symbols
                         (sanitize validate-partition-flags))
+  (target               partition-target ; bootloader target type: symbol | #f
+                        (default #f))
   (initializer          partition-initializer
                         (default #false))) ;gexp | #false
 
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index b0c96c60f0..8ac91800ad 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2022 Alex Griffin <a@HIDDEN>
 ;;; Copyright © 2023 Efraim Flashner <efraim@HIDDEN>
 ;;; Copyright © 2023 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu system image)
+  #:use-module (guix deprecation)
   #:use-module (guix diagnostics)
   #:use-module (guix discovery)
   #:use-module (guix gexp)
@@ -133,12 +135,10 @@ (define esp-partition
    ;; FAT-ness is based on file system size (16 in this case).
    (file-system "vfat")
    (flags '(esp))
-   (initializer (gexp initialize-efi-partition))))
+   (target 'esp)
+   (initializer #~initialize-efi-partition)))
 
-(define esp32-partition
-  (partition
-   (inherit esp-partition)
-   (initializer (gexp initialize-efi32-partition))))
+(define-deprecated/alias esp32-partition esp-partition)
 
 (define root-partition
   (partition
@@ -149,6 +149,7 @@ (define root-partition
    ;; with U-Boot.
    (file-system-options (list "-O" "^metadata_csum,^64bit"))
    (flags '(boot))
+   (target 'root)
    (initializer (gexp initialize-root-partition))))
 
 (define mbr-disk-image
@@ -173,11 +174,7 @@ (define efi-disk-image
    (partition-table-type 'gpt)
    (partitions (list esp-partition root-partition))))
 
-(define efi32-disk-image
-  (image-without-os
-   (format 'disk-image)
-   (partition-table-type 'gpt)
-   (partitions (list esp32-partition root-partition))))
+(define-deprecated/alias efi32-disk-image efi-disk-image)
 
 (define iso9660-image
   (image-without-os
@@ -238,10 +235,7 @@ (define efi-raw-image-type
    (name 'efi-raw)
    (constructor (cut image-with-os efi-disk-image <>))))
 
-(define efi32-raw-image-type
-  (image-type
-   (name 'efi32-raw)
-   (constructor (cut image-with-os efi32-disk-image <>))))
+(define-deprecated/alias efi32-raw-image-type efi-raw-image-type)
 
 (define qcow2-image-type
   (image-type
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 15/15] teams: Add bootloading team.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:40:10 +0000
Resent-Message-ID: <handler.73202.B73202.17268287995360 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268287995360
          (code B ref 73202); Fri, 20 Sep 2024 10:40:10 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:39:59 +0000
Received: from localhost ([127.0.0.1]:34179 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srb3O-0001OI-RI
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:59 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:49077
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2y-0001LI-Pa
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:33 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828740;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=JMyL6wxv0K/n+14BL5MIqksXAnqONeJGjRnmYYtwgQo=;
 b=lWfxOYLE1PdKEz0chwcCC2Kd/nUk4eJLIHW5XsrwFOxm55J6Se3JKSlfPTb0eYdprbvsni
 HOEcdeDHdvW1Wt5KcXuHW8oo16SUYt+QCORkdUHcAUxA9zPS/gzvTaPDQaMnf0M6F+hfRO
 vKyztWg1kcP8ZJI4sHaqASoN0h0tb5aHbP35H4oJTz+7gYSii6TTh6o8ljHgiuBKr9znj8
 lOxKlQIUvEFNfN/9FM97BjuFUMv9MrsgKNwrrlkL9QC8A5e/uQY+Vok4cr8PBjTIqOLiRD
 vlzQdIBz1YHywvn63gzeLgTB4px0WtwhSPJfXpOozPoF74am5FXN++4OLqZHKw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id b4ff3a9c
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:39:00 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:38:00 +0200
Message-ID: <2c080f11d3e0b6e6268f6c0ff704c2114de3ef8a.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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:  From: Lilah Tascheter <lilah@HIDDEN> Might as well,
 to help ease the transition. * etc/teams.scm (bootloaders): New team. (Lilah
 Tascheter): Create and add to above. 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> Might as well,
    to help ease the transition. * etc/teams.scm (bootloaders): New team. (Lilah
    Tascheter): Create and add to above. 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

Might as well, to help ease the transition.

* etc/teams.scm (bootloaders): New team.
(Lilah Tascheter): Create and add to above.

Change-Id: I63620f4e3151bb8e3d0bdf619fc70501af6397a0
---
 etc/teams.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/etc/teams.scm b/etc/teams.scm
index 9239021b39..2150a7aad1 100755
--- a/etc/teams.scm
+++ b/etc/teams.scm
@@ -328,6 +328,12 @@ (define-team embedded
         #:scope (list "gnu/packages/bootloaders.scm"
                       "gnu/packages/firmware.scm")))
 
+(define-team bootloaders
+  (team 'bootloaders
+        #:name "Bootloaders"
+        #:scope (list "gnu/bootloader.scm"
+                      (make-regexp* "^gnu/bootloader/"))))
+
 (define-team rust
   (team 'rust
         #:name "Rust"
@@ -749,6 +755,10 @@ (define-member (person "André Batista"
                        "nandre@HIDDEN")
   mozilla)
 
+(define-member (person "Lilah Tascheter"
+                       "lilah@HIDDEN")
+  bootloaders)
+
 
 (define (find-team name)
   (or (hash-ref %teams (string->symbol name))
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 14/15] gnu: system: boot: Add procedure.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 20 Sep 2024 10:58:02 +0000
Resent-Message-ID: <handler.73202.B73202.17268298489358 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17268298489358
          (code B ref 73202); Fri, 20 Sep 2024 10:58:02 +0000
Received: (at 73202) by debbugs.gnu.org; 20 Sep 2024 10:57:28 +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 <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srbKJ-0002Qq-LS
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:57:28 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:54361
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srb2y-0001KU-5W
 for 73202 <at> debbugs.gnu.org; Fri, 20 Sep 2024 06:39:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726828739;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=hBtoVZk2qqM8npvPjHvKOPxbrh78QcxcxFPaGOzXQGg=;
 b=rcJrQJuLxhSnK++IK0FScwY6YfBBtjOnjrEuQdNSUK+FvSshLXoYxvJR6ZgadkZRBGDtjl
 kfnTv8c/nC5M4ffc15DfYsfaeNPzSqamY3jy0seuiX9E7QLWUDjMTsD+XFhKaWvbfMyYTK
 CygEcAklC5B3O5u5WA3AI4yDkjURSpZhaYVgzQY5GHToW4sUgluNabjA8j/qB5ztcm1f7Q
 +LfzsNLy5Caxj/rs07YR2YOe+gPI/bqtt5uP/fwLQKiUzlLmYYJduHQyzdBwGS0Kp6DgaQ
 9fqLTIda6Q2ktVX6fFoyvr2dXq/J2pcBw/ehQfhurFLQY7kyEQTOOXqGzhAc8Q==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 4ab49205
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 20 Sep 2024 10:38:59 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Fri, 20 Sep 2024 12:37:59 +0200
Message-ID: <d40ec140d3581178b5a5fcbb16876621f5900b52.1726827025.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726827025.git.herman@HIDDEN>
References: <cover.1726827025.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/system/boot.scm
 (boot-alternative->menu-entry): New procedure. Change-Id:
 Id68fb3d39e6d9aca9267f3884cf54f2e7a08b353
 --- gnu/system/boot.scm | 4 ++++ 1 file changed, 4 insertions(+) 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/system/boot.scm
    (boot-alternative->menu-entry): New procedure. Change-Id: Id68fb3d39e6d9aca9267f3884cf54f2e7a08b353
    --- gnu/system/boot.scm | 4 ++++ 1 file changed, 4 insertions(+) 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/system/boot.scm (boot-alternative->menu-entry): New procedure.

Change-Id: Id68fb3d39e6d9aca9267f3884cf54f2e7a08b353
---
 gnu/system/boot.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 8a183ebe3a..2040984cbf 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -81,6 +81,7 @@ (define-module (gnu system boot)
             epoch->date-string
             decorated-boot-label
             boot-parameters->menu-entry
+            boot-alternative->menu-entry
 
             ensure-not-/dev
             system-linux-image-file-name))
@@ -347,6 +348,9 @@ (define (boot-parameters->menu-entry conf)
                             (boot-parameters-multiboot-modules conf)
                             '())))))
 
+(define boot-alternative->menu-entry
+  (compose boot-parameters->menu-entry boot-alternative-parameters))
+
 (define (ensure-not-/dev device)
   "If DEVICE starts with a slash, return #f.  This is meant to filter out
 Linux device names such as /dev/sda, and to preserve GRUB device names and
-- 
2.45.2





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


Received: (at control) by debbugs.gnu.org; 20 Sep 2024 13:42:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 09:42:58 2024
Received: from localhost ([127.0.0.1]:34408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srduU-0003Kf-BA
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 09:42:58 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:52292)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srduS-0003KM-PD
 for control <at> debbugs.gnu.org; Fri, 20 Sep 2024 09:42:57 -0400
DKIM-Signature: a=rsa-sha256;
 b=vu08qsIN94L+ZwUfCo8k2HwJMWBpZ/DiIFZ+yg0XG9b9M43JebELsQ61PWQHZVhC+dRWRbK3qO8K3x8AbUomcEnKaT2yHJuie6IDJOMXnxlPJhA6OBqyAQUF7fFk7XIHu6ZXOVRHOThVk2Lq3nNX5m+MBEvPwPLbULUVJGnBgasj2AOZ9s7eaHMVcOmBHf6JKcXc6BmfS3S+zI9+MUtedyA1Zpkg+zW+a1RDGiv5G5Whz3AvJr3HxZpS9EF9f4IEzkl45Ypxx3dBCAQK9LQ84X+WvkKvf2cftoAA9KSDybkaw6Qkh10pMEl7p5fWMOFxrekHN75c6qmB0dmJFjVnEQ==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=1MKbcHwdGc7Sq+zHFSyIDEroZO+GYqoNQ5LrkXPm43k=;
 h=Received:Subject:From:To:Date; 
DKIM-Signature: a=rsa-sha256;
 b=ndBFxDCKXucdmgJUgfOmZUCPSBfURk7wbwXGjombCkhebcfUTtK/b6iw51efSubYKy3Vcad9YLMO23eKY+dLKsUiFbgVl+U4QG6vi0Uv4r9JM/E4+l67x4y9xaftIBr74WpLaYGUxuoqB223LbyEbNLLpGMCMTT+LlVZbD7azIOiH56CvcOCDGlrqMyn/Q6s4B/1hqOPQlQJyMSdRITPDO3toQshaqv2YB9CynHlPo+7Rw6lyrprYmVuUgRY5VNVnp4OhkC3Y7eYLDqX2cLOi1bK8QgrkWEQ580Cd/55qLPLnSgFZDF1vGqdZBrIc+U8Ew3/t4joOMcbtxkEDCEX8Q==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=1MKbcHwdGc7Sq+zHFSyIDEroZO+GYqoNQ5LrkXPm43k=;
 h=Feedback-ID:Received:Subject:From:To:Date; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: control <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 795266850
 for <control <at> debbugs.gnu.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 13:42:31 +0000 (UTC)
Message-ID: <23990aeff364fc233963f4801b269f91c80ed9b7.camel@HIDDEN>
Subject: 
From: Lilah Tascheter <lilah@HIDDEN>
To: control <at> debbugs.gnu.org
Date: Fri, 20 Sep 2024 08:42:29 -0500
Organization: Dissociation for Heresiographal Computation
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
User-Agent: Evolution 3.48.4 
MIME-Version: 1.0
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:  block 73202 with 69343 block 72457 with 73202 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 2.0 BLANK_SUBJECT          Subject is present but empty
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: control
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 (+)

block 73202 with 69343
block 72457 with 73202




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


Received: (at control) by debbugs.gnu.org; 20 Sep 2024 13:42:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 09:42:58 2024
Received: from localhost ([127.0.0.1]:34408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srduU-0003Kf-BA
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 09:42:58 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:52292)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srduS-0003KM-PD
 for control <at> debbugs.gnu.org; Fri, 20 Sep 2024 09:42:57 -0400
DKIM-Signature: a=rsa-sha256;
 b=vu08qsIN94L+ZwUfCo8k2HwJMWBpZ/DiIFZ+yg0XG9b9M43JebELsQ61PWQHZVhC+dRWRbK3qO8K3x8AbUomcEnKaT2yHJuie6IDJOMXnxlPJhA6OBqyAQUF7fFk7XIHu6ZXOVRHOThVk2Lq3nNX5m+MBEvPwPLbULUVJGnBgasj2AOZ9s7eaHMVcOmBHf6JKcXc6BmfS3S+zI9+MUtedyA1Zpkg+zW+a1RDGiv5G5Whz3AvJr3HxZpS9EF9f4IEzkl45Ypxx3dBCAQK9LQ84X+WvkKvf2cftoAA9KSDybkaw6Qkh10pMEl7p5fWMOFxrekHN75c6qmB0dmJFjVnEQ==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=1MKbcHwdGc7Sq+zHFSyIDEroZO+GYqoNQ5LrkXPm43k=;
 h=Received:Subject:From:To:Date; 
DKIM-Signature: a=rsa-sha256;
 b=ndBFxDCKXucdmgJUgfOmZUCPSBfURk7wbwXGjombCkhebcfUTtK/b6iw51efSubYKy3Vcad9YLMO23eKY+dLKsUiFbgVl+U4QG6vi0Uv4r9JM/E4+l67x4y9xaftIBr74WpLaYGUxuoqB223LbyEbNLLpGMCMTT+LlVZbD7azIOiH56CvcOCDGlrqMyn/Q6s4B/1hqOPQlQJyMSdRITPDO3toQshaqv2YB9CynHlPo+7Rw6lyrprYmVuUgRY5VNVnp4OhkC3Y7eYLDqX2cLOi1bK8QgrkWEQ580Cd/55qLPLnSgFZDF1vGqdZBrIc+U8Ew3/t4joOMcbtxkEDCEX8Q==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=1MKbcHwdGc7Sq+zHFSyIDEroZO+GYqoNQ5LrkXPm43k=;
 h=Feedback-ID:Received:Subject:From:To:Date; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: control <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 795266850
 for <control <at> debbugs.gnu.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 13:42:31 +0000 (UTC)
Message-ID: <23990aeff364fc233963f4801b269f91c80ed9b7.camel@HIDDEN>
Subject: 
From: Lilah Tascheter <lilah@HIDDEN>
To: control <at> debbugs.gnu.org
Date: Fri, 20 Sep 2024 08:42:29 -0500
Organization: Dissociation for Heresiographal Computation
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
User-Agent: Evolution 3.48.4 
MIME-Version: 1.0
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:  block 73202 with 69343 block 72457 with 73202 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 2.0 BLANK_SUBJECT          Subject is present but empty
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: control
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 (+)

block 73202 with 69343
block 72457 with 73202




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


Received: (at control) by debbugs.gnu.org; 20 Sep 2024 13:47:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 09:47:30 2024
Received: from localhost ([127.0.0.1]:34419 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srdys-0003bZ-Ar
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 09:47:30 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:47644)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srdyp-0003bE-Su
 for control <at> debbugs.gnu.org; Fri, 20 Sep 2024 09:47:28 -0400
DKIM-Signature: a=rsa-sha256;
 b=h0jL0Fw54T1oE3o30z4gXYDM21eblzEXwfpqojj5gWA3KI5QqNEzRARtaHgAssCU/J9Drt/yegRcBVNCelty5UDdNgArpezxGiX3If+RD+RKCRiLTfATsYHHf5GdJaScJm7HEBDc8leHScn3SXNxgE2kTx/4rZ8RHYLYRaVBqDg/sll3sa5vvMRrjpu12RVKJHkDsF7DHLjiJBgPFsxiMKravg2anpwyobBVcEtrTEdbDEmUdQ+G7znjLXjsOI8sml5PKDv0kdj8GF5DvP+BWM83UvudKlD2rtesp+KWrgeU93M+/2bcOOk81SX+r4ugnwZKbYsgyGPjz0W+5QWxxA==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=KoCRuvY7tzm/1sCJJHKbp4EQiHtLHVCyOBq63CaQ2Y8=;
 h=Received:Subject:From:To:Date; 
DKIM-Signature: a=rsa-sha256;
 b=o9boc/9geuzKsVQEmGu4PoH2oAAhaMHjUK3EQ8iWu8oM1kQKwXkyy742CFCg5OZZQKKRNo/V3ylD9XxFVDfYqRhvXLtxLAHaFOqd28trL5uBL+xDt5mRCF+WvBLkKzVYtPLoqwjv+3nvFZXErPf8kBt2O4SNFRSkPxu36enh4o4lnv4I14Wbgj28S4NGF+oTNVDUdHRkEVef73CLLA/OW5hij40XsoKYpqmBOo1kzReWeYTerMHkf4t5Q00Vcb2xV2n4CXpo3eDdtbfTSQg4AO+zc+4b4KJIXsOY5rm7uMNn7Ks3h+AnY9nimr5lCI45ARj4G6+oTTQDW9XZwC4F+Q==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=KoCRuvY7tzm/1sCJJHKbp4EQiHtLHVCyOBq63CaQ2Y8=;
 h=Feedback-ID:Received:Subject:From:To:Date; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: control <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -196730959
 for <control <at> debbugs.gnu.org>
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 13:47:01 +0000 (UTC)
Message-ID: <675d766af7df47325dc2635ce6f4e33752eb7df7.camel@HIDDEN>
Subject: 
From: Lilah Tascheter <lilah@HIDDEN>
To: control <at> debbugs.gnu.org
Date: Fri, 20 Sep 2024 08:46:59 -0500
Organization: Dissociation for Heresiographal Computation
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
User-Agent: Evolution 3.48.4 
MIME-Version: 1.0
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:  retitle 73202 [PATCH] Preparation for bootloader rewrite. 
 Content analysis details:   (2.0 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.0 SPF_HELO_PASS          SPF: HELO matches SPF record
 2.0 BLANK_SUBJECT          Subject is present but empty
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: control
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 (+)

retitle 73202 [PATCH] Preparation for bootloader rewrite.




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 00/15] Preparation for bootloader rewrite.
References: <20240912165818.21580-1-herman@HIDDEN>
In-Reply-To: <20240912165818.21580-1-herman@HIDDEN>
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Sat, 21 Sep 2024 10:59:01 +0000
Resent-Message-ID: <handler.73202.B73202.172691631829691 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172691631829691
          (code B ref 73202); Sat, 21 Sep 2024 10:59:01 +0000
Received: (at 73202) by debbugs.gnu.org; 21 Sep 2024 10:58:38 +0000
Received: from localhost ([127.0.0.1]:37423 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxp0-0007ip-FH
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:58:38 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:43209
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxoy-0007iX-81
 for 73202 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:58:37 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726916287;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type;
 bh=YdHbFTKyp+m5g33qhVz7t9qCAhyZHSXLj/HyloqRqFU=;
 b=jeVfEnsg3rQGPnjkLTllQRj2+Vm/MkkFwaPntt7o+dfRl6Z+aRCr7+PEQRcxNVmsX/5Cng
 fPGtUc2xWMJdfajaDJ6ezlIAQx5RHVxV34T04d7khFnkTtP4jruxYYgUZdswzlW/rBbOAk
 LA+W1iGCrSkNboF4rgZDZMz2yaSGj/Vw94+UVUhiXX130REWTy/XnWfBhZ1i2bCW+t8MuQ
 UyD1wWXGIYhTfKY1hAz1PRnsKMSG+p0+DVxHW+HF8CPrw22Dx8UhWxebIh43QfPKqa0SyY
 3h9iJxKwWffzNFjBG3Lqz4FJ3/kiTPRikQpJNw3Me5957ue2gb7rMHVa2M36hA==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 7faaa272
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:58:06 +0000 (UTC)
Date: Sat, 21 Sep 2024 12:57:32 +0200
From: Herman Rimm <herman@HIDDEN>
Message-ID: <irawmqi6j6krolsuttvtzpujsbsjhapofceq6cpch3psw22mvm@wrbedbw4ewzm>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Spam-Score: 3.5 (+++)
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:  Hello, I posted revision v5 of #69343. If you would like to
 apply v2 of this issue on it, use git am -3 and pick the conflicting change
 made by patch #5 as is. Also note that the changes made by patch #14 ar [...]
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  Hello, I posted revision v5 of #69343. If you would like to
    apply v2 of this issue on it, use git am -3 and pick the conflicting change
    made by patch #5 as is. Also note that the changes made by patch #14 ar [...]
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Hello,

I posted revision v5 of #69343.  If you would like to apply v2 of this
issue on it, use git am -3 and pick the conflicting change made by patch
#5 as is.  Also note that the changes made by patch #14 are now included
in v5 of #69343.

Cheers,
Herman




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v2 00/15] Preparation for bootloader rewrite.
Resent-From: Lilah Tascheter <lilah@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Wed, 25 Sep 2024 21:00:01 +0000
Resent-Message-ID: <handler.73202.B73202.17272979484222 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Herman Rimm <herman@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17272979484222
          (code B ref 73202); Wed, 25 Sep 2024 21:00:01 +0000
Received: (at 73202) by debbugs.gnu.org; 25 Sep 2024 20:59:08 +0000
Received: from localhost ([127.0.0.1]:54753 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stZ6J-000162-OP
	for submit <at> debbugs.gnu.org; Wed, 25 Sep 2024 16:59:08 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:49634)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1stZ6G-00015M-U7
 for 73202 <at> debbugs.gnu.org; Wed, 25 Sep 2024 16:59:06 -0400
DKIM-Signature: a=rsa-sha256;
 b=WljMZNImrB73BMSocDZ23MEj/M3mVOMoO5MvxII7GXiWpKsWJAnV99AYc+ZjqFj2UVa0PqYM3muIBJAyp0sITfxRMQCiERleCGvyqdKmVD0b6uWtY+m0zjhP+HYdpCk8meQTuVhqM/oGHzQt7hxEFITwxAvxU5OVoKfE0h3w5ytt5p4jPE0W/T5+RL9gSldux8XYZ1p6E6+qBif6oBc3nAPiypQRpI59Fsjwrn0Loa3Ix5qO6E95eV7mj5zlDF3FSecOT2tFkof73ChLZRFPkRvlTaDoelC1nq81HsDDm66MPWoyhAL72XB9vsH4GtKlJwAq4IroAwNUSn+IG4eDXg==;
 s=purelymail1; d=lunabee.space; v=1;
 bh=09kJCAKiSzjhKNcc0VPSE2J7XyyXlacxGHy5p51azVc=;
 h=Received:Subject:From:To:Date; 
DKIM-Signature: a=rsa-sha256;
 b=V/u9Z2B1PDpVmqQ3SAmSS4q2a8HYy1UMXhYXqMFcVzd2Be7AXqJU1aKOHGGLt30Zw3TDG4BJ5zRaYNILdsnVUSBtAN9iyW5L+IFnWnFSxBPriEvGY1NYFwuqR/zIThsCibnDJXr8ByPdgtU4KY3ck+awKvWn4HkF7IkUiZF4DVjX6SvlxBzVw8FkGkZkppQ9TAPeapuKlTW1gFtilkB/n8J0QDGz93u+NvLibUDWUHJGz3jeGRVCPjPNo6c2cM87KXNGvIDU2/GnRp8NvROOCOPhiBgQfgk6ZePRmqXQh2f6f/TskYrWJGtuvVeZp3VlT427OjZbndXoQutsQruArg==;
 s=purelymail1; d=purelymail.com; v=1;
 bh=09kJCAKiSzjhKNcc0VPSE2J7XyyXlacxGHy5p51azVc=;
 h=Feedback-ID:Received:Subject:From:To:Date; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 73202 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -736411265; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Wed, 25 Sep 2024 20:58:31 +0000 (UTC)
Message-ID: <4ff19a6ca2cb04710ac9609666c0f69cfc88567f.camel@HIDDEN>
From: Lilah Tascheter <lilah@HIDDEN>
Date: Wed, 25 Sep 2024 15:58:30 -0500
In-Reply-To: <irawmqi6j6krolsuttvtzpujsbsjhapofceq6cpch3psw22mvm@wrbedbw4ewzm>
References: <irawmqi6j6krolsuttvtzpujsbsjhapofceq6cpch3psw22mvm@wrbedbw4ewzm>
Organization: Dissociation for Heresiographal Computation
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 
MIME-Version: 1.0
X-Spam-Score: -0.0 (/)
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 (-)


hey herman!

> use git am -3
fails on a clean pull/am due to lack of commit blobs. I'm not quite
sure how to fix that myself, would you be able to just re-send the
rebased patch series?

thanks!




Message sent to lilah@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 01/14] gnu: bootloader: Remove deprecated bootloader-configuration field.
References: <20240912165818.21580-1-herman@HIDDEN>
In-Reply-To: <20240912165818.21580-1-herman@HIDDEN>
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: lilah@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:02 +0000
Resent-Message-ID: <handler.73202.B73202.172734547713133 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>
X-Debbugs-Original-Xcc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734547713133
          (code B ref 73202); Thu, 26 Sep 2024 10:12:02 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:17 +0000
Received: from localhost ([127.0.0.1]:55462 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlSv-0003Pb-65
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:17 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSt-0003PA-2M
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:16 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345434;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=jrFz+Po8w18tytchy7+aNDboMOw/I/Oi+JJ7tveG/1k=;
 b=jGIrM9kqkitygQ0qtlWM75n2MmXzYgdUh/9TgmchtsPOpEgYxED7647OnkPRumg15xS/Wt
 MAeRBT4NZrhPsmK9aUQ4TKQMxYeOftJur0BvQ3E9cR8lbmBZqvnmT52eVdowhXAUdNjur4
 8jnAJ6cH8uOkBeBKnN769ekoNLJwqfi40PC6nBek7Q0Ka4TsTpHLuVBt3zJ2wd3mW61qnj
 B15V/8yr6DmOuKo6cgbRVgjsG6CFVI8UZHZvNxauIMmk7pBExxiVSqux//55Itsl06sd4/
 0+LLxVzc7dCCOKK+MnRiphF1fkS4afrEwwcTd4FQLBzCMdRDRLm6cmmEmDQwEA==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 785e15c2
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:34 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:08:58 +0200
Message-ID: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (warn-target-field-deprecation): Delete sanitizer.
 (bootloader-configuration)[target]:
 Remove deprecated field. (bootloader-configuration-target): Delete procedure.
 (bootloader-co [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (warn-target-field-deprecation): Delete sanitizer. (bootloader-configuration)[target]:
    Remove deprecated field. (bootloader-configuration-target): Delete procedure.
    (bootloader-co [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (warn-target-field-deprecation): Delete sanitizer.
(bootloader-configuration)[target]: Remove deprecated field.
(bootloader-configuration-target): Delete procedure.
(bootloader-configuration-targets): Do not use target field.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/bootloader.scm | 18 +-----------------
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index f32e90e79d..865521e6e5 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -66,7 +66,6 @@ (define-module (gnu bootloader)
             bootloader-configuration
             bootloader-configuration?
             bootloader-configuration-bootloader
-            bootloader-configuration-target ;deprecated
             bootloader-configuration-targets
             bootloader-configuration-menu-entries
             bootloader-configuration-default-entry
@@ -244,24 +243,14 @@ (define-record-type* <bootloader>
 ;; The <bootloader-configuration> record contains bootloader independant
 ;; configuration used to fill bootloader configuration file.
 
-(define-with-syntax-properties (warn-target-field-deprecation
-                                (value properties))
-  (when value
-    (warning (source-properties->location properties)
-             (G_ "the 'target' field is deprecated, please use 'targets' \
-instead~%")))
-  value)
 
 (define-record-type* <bootloader-configuration>
   bootloader-configuration make-bootloader-configuration
   bootloader-configuration?
   (bootloader
-   bootloader-configuration-bootloader) ;<bootloader>
+   bootloader-configuration-bootloader)   ;<bootloader>
   (targets               %bootloader-configuration-targets
                          (default #f))     ;list of strings
-  (target                %bootloader-configuration-target ;deprecated
-                         (default #f)
-                         (sanitize warn-target-field-deprecation))
   (menu-entries          bootloader-configuration-menu-entries
                          (default '()))   ;list of <menu-entry>
   (default-entry         bootloader-configuration-default-entry
@@ -285,14 +274,9 @@ (define-record-type* <bootloader-configuration>
   (extra-initrd          bootloader-configuration-extra-initrd
                          (default #f)))   ;string | #f
 
-(define-deprecated (bootloader-configuration-target config)
-  bootloader-configuration-targets
-  (%bootloader-configuration-target config))
 
 (define (bootloader-configuration-targets config)
   (or (%bootloader-configuration-targets config)
-      ;; TODO: Remove after the deprecated 'target' field is removed.
-      (list (%bootloader-configuration-target config))
       ;; XXX: At least the GRUB installer (see (gnu bootloader grub)) has this
       ;; peculiar behavior of installing fonts and GRUB modules when DEVICE is #f,
       ;; hence the default value of '(#f) rather than '().

base-commit: db3ec7f65bd04741f1d97a9a3bbd3d96f12caa52
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 02/14] gnu: system: Remove useless boot parameters.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:02 +0000
Resent-Message-ID: <handler.73202.B73202.172734548213178 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734548213178
          (code B ref 73202); Thu, 26 Sep 2024 10:12:02 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:22 +0000
Received: from localhost ([127.0.0.1]:55472 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlSz-0003QT-Hq
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:22 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSu-0003PA-D7
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:17 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345435;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=OXeZhAHSAvOKs7eTZmyPsqKOyWfNWR41xD+pV5vSCnE=;
 b=nPLQrP3JqCtoz5a/o9EqlgfZjjPoucqXbKu32tM7Ku5qpDkSimKgMw4kWxiNPB1d5bJmWG
 +206kaj1S3ZQzEdHBUmF+Psw/bvt2B4kOul5PTs/ezBBES1+yCb+yAC4n13dS4GuhYsX8J
 Vz/rcFJydz+KioLoFMUkaHrGXChWQNZtXmxIAyGSmuVfrMZ403fdMti+qxfKXPUEgOz1bT
 FL6HWHUlNot48jIOYMBiQU3O42GXAV+rDSgHgHR+0P/KiXJ2vO3kKV67MaCBg50EnarROM
 HRloARXi8IBo60NDhWLB4T+hH4YEhJvAnESNagziNooyTEeMZ5+mHCEWac+BZA==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id a542de37
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:35 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:08:59 +0200
Message-ID: <c0d6bcb2d8c56569b96ac9674de337188dd77c0b.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> * gnu/system.scm
 (operating-system-boot-parameters, operating-system-boot-parameters-file):
 Delete bootloader-menu-entries. * gnu/system/boot.scm
 (boot-parameters)[bootloader-menu-entries]: Delete fie [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/system.scm
    (operating-system-boot-parameters, operating-system-boot-parameters-file):
    Delete bootloader-menu-entries. * gnu/system/boot.scm (boot-parameters)[bootloader-menu-entries]:
    Delete fie [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/system.scm (operating-system-boot-parameters,
operating-system-boot-parameters-file): Delete bootloader-menu-entries.
* gnu/system/boot.scm (boot-parameters)[bootloader-menu-entries]: Delete
field.
(read-boot-parameters): Don't read bootloader-menu-entries.
* tests/boot-parameters.scm (%grub-boot-parameters,
test-read-boot-parameters, test-read-boot-parameters): Don't include
bootloader-menu-entries.
("read, bootloader-menu-entries, default value"): Delete test.

Change-Id: I46d9cff4604dbfcf654b0820fdb77e72aecffbb4
---
 gnu/system.scm            |  7 -------
 gnu/system/boot.scm       |  8 --------
 tests/boot-parameters.scm | 18 +++++-------------
 3 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 25afa96295..a3eee5aa24 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1298,8 +1298,6 @@ (define* (operating-system-boot-parameters os root-device
      (initrd initrd)
      (multiboot-modules multiboot-modules)
      (bootloader-name bootloader-name)
-     (bootloader-menu-entries
-      (bootloader-configuration-menu-entries (operating-system-bootloader os)))
      (locale locale)
      (store-device (ensure-not-/dev (file-system-device store)))
      (store-directory-prefix (btrfs-store-subvolume-file-name file-systems))
@@ -1341,11 +1339,6 @@ (define* (operating-system-boot-parameters-file os)
                                 #$(boot-parameters-multiboot-modules params)))
                             #~())
                      (bootloader-name #$(boot-parameters-bootloader-name params))
-                     (bootloader-menu-entries
-                      #$(map menu-entry->sexp
-                             (or (and=> (operating-system-bootloader os)
-                                        bootloader-configuration-menu-entries)
-                                 '())))
                      (locale #$(boot-parameters-locale params))
                      (store
                       (device
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index de312c7208..54e5673a54 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -51,7 +51,6 @@ (define-module (gnu system boot)
             boot-parameters-label
             boot-parameters-root-device
             boot-parameters-bootloader-name
-            boot-parameters-bootloader-menu-entries
             boot-parameters-store-crypto-devices
             boot-parameters-store-device
             boot-parameters-store-directory-prefix
@@ -110,8 +109,6 @@ (define-record-type* <boot-parameters>
   ;; partition.
   (root-device      boot-parameters-root-device)
   (bootloader-name  boot-parameters-bootloader-name)
-  (bootloader-menu-entries                        ;list of <menu-entry>
-   boot-parameters-bootloader-menu-entries)
   (store-device     boot-parameters-store-device)
   (store-mount-point boot-parameters-store-mount-point)
   (store-directory-prefix boot-parameters-store-directory-prefix)
@@ -172,11 +169,6 @@ (define (read-boot-parameters port)
          ((_ args) args)
          (#f       'grub))) ; for compatibility reasons.
 
-      (bootloader-menu-entries
-       (match (assq 'bootloader-menu-entries rest)
-         ((_ entries) (map sexp->menu-entry entries))
-         (#f          '())))
-
       ;; In the past, we would store the directory name of linux instead of
       ;; the absolute file name of its image.  Detect that and correct it.
       (kernel (if (string=? kernel (direct-store-path kernel))
diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm
index 2e7976aa6c..e1dc4620c3 100644
--- a/tests/boot-parameters.scm
+++ b/tests/boot-parameters.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@HIDDEN>
 ;;; Copyright © 2022 Josselin Poiret <dev@HIDDEN>
+;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -34,6 +35,7 @@ (define-module (test-boot-parameters)
   #:use-module (guix gexp)
   #:use-module (guix store)
   #:use-module (guix tests)
+  #:use-module (ice-9 format)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-64)
   #:use-module (rnrs bytevectors))
@@ -64,7 +66,6 @@ (define %root-path "/")
 (define %grub-boot-parameters
   (boot-parameters
    (bootloader-name 'grub)
-   (bootloader-menu-entries '())
    (root-device %default-root-device)
    (label %default-label)
    (kernel %default-kernel)
@@ -107,7 +108,6 @@ (define* (test-read-boot-parameters
           #:key
           (version %boot-parameters-version)
           (bootloader-name 'grub)
-          (bootloader-menu-entries '())
           (label %default-label)
           (root-device (quote-uuid %default-root-device))
           (kernel %default-kernel)
@@ -127,7 +127,7 @@ (define* (test-read-boot-parameters
       (cond ((eq? 'false val) (format #false fmt #false))
             (val              (format #false fmt val))
             (else             "")))
-    (format #false "(boot-parameters~a~a~a~a~a~a~a~a~a~a)"
+    (format #f "(boot-parameters~@{~a~})"
             (sexp-or-nothing " (version ~S)" version)
             (sexp-or-nothing " (label ~S)" label)
             (sexp-or-nothing " (root-device ~S)" root-device)
@@ -135,7 +135,7 @@ (define* (test-read-boot-parameters
             (sexp-or-nothing " (kernel-arguments ~S)" kernel-arguments)
             (sexp-or-nothing " (initrd ~S)" initrd)
             (if with-store
-                (format #false " (store~a~a~a~a)"
+                (format #f " (store~@{~a~})"
                         (sexp-or-nothing " (device ~S)" store-device)
                         (sexp-or-nothing " (mount-point ~S)"
                                          store-mount-point)
@@ -145,9 +145,7 @@ (define* (test-read-boot-parameters
                                          store-crypto-devices))
                 "")
             (sexp-or-nothing " (locale ~S)" locale)
-            (sexp-or-nothing " (bootloader-name ~a)" bootloader-name)
-            (sexp-or-nothing " (bootloader-menu-entries ~S)"
-                             bootloader-menu-entries)))
+            (sexp-or-nothing " (bootloader-name ~a)" bootloader-name)))
   (let ((str (generate-boot-parameters)))
     (call-with-input-string str read-boot-parameters)))
 
@@ -170,7 +168,6 @@ (define* (test-read-boot-parameters
 
 (test-assert "read, construction, optional fields"
   (and (test-read-boot-parameters #:bootloader-name #false)
-       (test-read-boot-parameters #:bootloader-menu-entries #false)
        (test-read-boot-parameters #:kernel-arguments #false)
        (test-read-boot-parameters #:with-store #false)
        (test-read-boot-parameters #:store-device #false)
@@ -223,11 +220,6 @@ (define* (test-read-boot-parameters
   (boot-parameters-bootloader-name
    (test-read-boot-parameters #:bootloader-name #false)))
 
-(test-eq "read, bootloader-menu-entries, default value"
-  '()
-  (boot-parameters-bootloader-menu-entries
-   (test-read-boot-parameters #:bootloader-menu-entries #false)))
-
 (test-eq "read, kernel-arguments, default value"
   '()
   (boot-parameters-kernel-arguments
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 03/14] gnu: tests: reconfigure: Remove bootloader install test.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:03 +0000
Resent-Message-ID: <handler.73202.B73202.172734548413201 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734548413201
          (code B ref 73202); Thu, 26 Sep 2024 10:12:03 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:24 +0000
Received: from localhost ([127.0.0.1]:55475 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlT0-0003Qa-9A
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:23 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSv-0003PA-He
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:18 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345437;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=ovim1EBaCAE1MVZajqRxcRakZdmW0ZG41AR3OZD7f5g=;
 b=euJ+NUU0YStGlgJ6WjnA+kHeJFqK0Fwm9iTGEjCLEXdEAr2zb0nDm4pGY2sr65qkzu16uU
 /RyBnbPl9IC97/hsOh/b+ub6lidYH5s0GeCb5rKNZafQ7gJ5XWcmDGla9EmhcFN4CHNb/Q
 fWWeiMK5utEHTVkcFTZqyWHnjByT942zdah+2NEuL7nzBgd/uuF8iNxDxpuU501Pih7P7K
 6mib50llwrSHIBCBPpA4eWcvOvdhRlROd6ubC+OYM9nrh6/Oc/MEja7a31py88SsNKUE/L
 CbFCAydrhjVYp+L0rI2yHZD1pty3ZZg3UcxlJlnyYUkef6dynCBvYHlZnF3blg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id eaaee76b
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:37 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:00 +0200
Message-ID: <b5b6223c077c323b2bb40e2266b233c46bda8730.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/tests/reconfigure.scm
 (%test-install-bootloader): Delete variable. (run-install-bootloader-test):
 Delete procedure. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 ---
 gnu/tests/reconfigure.scm | 86 + 1 file changed, 1 insertion(+),
 85 deletions(-)
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/tests/reconfigure.scm
    (%test-install-bootloader): Delete variable. (run-install-bootloader-test):
    Delete procedure. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 ---
    gnu/tests/reconfigure.scm | 86 + 1 file changed, 1 insertion(+), 85 deletions(-)
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/tests/reconfigure.scm (%test-install-bootloader): Delete variable.
(run-install-bootloader-test): Delete procedure.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/tests/reconfigure.scm | 86 +--------------------------------------
 1 file changed, 1 insertion(+), 85 deletions(-)

diff --git a/gnu/tests/reconfigure.scm b/gnu/tests/reconfigure.scm
index bcc7645fa3..8aa5311171 100644
--- a/gnu/tests/reconfigure.scm
+++ b/gnu/tests/reconfigure.scm
@@ -30,8 +30,7 @@ (define-module (gnu tests reconfigure)
   #:use-module (guix scripts system reconfigure)
   #:use-module (guix store)
   #:export (%test-switch-to-system
-            %test-upgrade-services
-            %test-install-bootloader))
+            %test-upgrade-services))
 
 ;;; Commentary:
 ;;;
@@ -178,83 +177,6 @@ (define* (run-upgrade-services-test)
           (disable (upgrade-services-program '() '() '(dummy) '())))
      (test enable disable))))
 
-(define* (run-install-bootloader-test)
-  "Run a test of an OS running INSTALL-BOOTLOADER-PROGRAM, which installs a
-bootloader's configuration file."
-  (define os
-    (marionette-operating-system
-     (simple-operating-system)
-     #:imported-modules '((gnu services herd)
-                          (guix combinators))))
-
-  (define vm (virtual-machine
-              (operating-system os)
-              (volatile? #f)))
-
-  (define (test script)
-    (with-imported-modules '((gnu build marionette))
-      #~(begin
-          (use-modules (gnu build marionette)
-                       (ice-9 regex)
-                       (srfi srfi-1)
-                       (srfi srfi-64))
-
-          (define marionette
-            (make-marionette (list #$vm)))
-
-          ;; Return the system generation paths that have GRUB menu entries.
-          (define (generations-in-grub-cfg marionette)
-            (let ((grub-cfg (marionette-eval
-                             '(begin
-                                (use-modules (rnrs io ports))
-                                (call-with-input-file "/boot/grub/grub.cfg"
-                                  get-string-all))
-                             marionette)))
-              (map (lambda (parameter)
-                     (second (string-split (match:substring parameter) #\=)))
-                   (list-matches "system=[^ ]*" grub-cfg))))
-
-          (test-runner-current (system-test-runner #$output))
-          (test-begin "install-bootloader")
-
-          (test-assert "no prior menu entry for system generation"
-            (not (member #$os (generations-in-grub-cfg marionette))))
-
-          (test-assert "script successfully evaluated"
-            (marionette-eval
-             '(primitive-load #$script)
-             marionette))
-
-          (test-assert "menu entry created for system generation"
-            (member #$os (generations-in-grub-cfg marionette)))
-
-          (test-end))))
-
-  (let* ((bootloader ((compose bootloader-configuration-bootloader
-                               operating-system-bootloader)
-                      os))
-         ;; The typical use-case for 'install-bootloader-program' is to read
-         ;; the boot parameters for the existing menu entries on the system,
-         ;; parse them with 'boot-parameters->menu-entry', and pass the
-         ;; results to 'operating-system-bootcfg'. However, to obtain boot
-         ;; parameters, we would need to start the marionette, which we should
-         ;; ideally avoid doing outside of the 'test' G-Expression. Thus, we
-         ;; generate a bootloader configuration for the script as if there
-         ;; were no existing menu entries. In the grand scheme of things, this
-         ;; matters little -- these tests should not make assertions about the
-         ;; behavior of 'operating-system-bootcfg'.
-         (bootcfg (operating-system-bootcfg os '()))
-         (bootcfg-file (bootloader-configuration-file bootloader)))
-    (gexp->derivation
-     "install-bootloader"
-     ;; Due to the read-only nature of the virtual machines used in the system
-     ;; test suite, the bootloader installer script is omitted. 'grub-install'
-     ;; would attempt to write directly to the virtual disk if the
-     ;; installation script were run.
-     (test
-      (install-bootloader-program #f #f #f bootcfg bootcfg-file '(#f) "/")))))
-
-
 (define %test-switch-to-system
   (system-test
    (name "switch-to-system")
@@ -267,9 +189,3 @@ (define %test-upgrade-services
    (description "Upgrade the Shepherd by unloading obsolete services and
 loading new services.")
    (value (run-upgrade-services-test))))
-
-(define %test-install-bootloader
-  (system-test
-   (name "install-bootloader")
-   (description "Install a bootloader and its configuration file.")
-   (value (run-install-bootloader-test))))
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 04/14] guix: scripts: Remove unused code.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:03 +0000
Resent-Message-ID: <handler.73202.B73202.172734548613230 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734548613230
          (code B ref 73202); Thu, 26 Sep 2024 10:12:03 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:26 +0000
Received: from localhost ([127.0.0.1]:55485 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlT3-0003R5-1d
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:26 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSw-0003PA-Ly
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345438;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=3I+yfSwWj9UyTUe0RKzr9e7/82nPpeF/ED4ioJMhm4w=;
 b=uyqSTkUSdO2LgsIkyjmgQTZPrb/wmG5rcuq8/Xm52dO6mlGaR/9QFGLl2nygsGALSlOTQD
 SEXijftCcSpMM8epHvzLgGYpQ39pEumk3T5h1Md87ey3Kk3p3ZP1O0YsORgNugCWCNs1CX
 BaniqyEbV4qFLDjpfA1htzGiIOMnKYQ63kCguC7792S50GyhN5zVoZz7Dc5VHkOb6l8UN/
 gPE4Ta8+ea2TkRr1JZJM7aDltjDjdJyXwQmkCguDI1E3ot1EG6DLkhGEqTP4e2mFtTyuVu
 IFs3hpMbZ8dDQGl+aJ5S1lWJvmS+fO4XPMJsQH68/r9MwdwADrtdi0dVKdrl3g==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 6bf0b552
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:38 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:01 +0200
Message-ID: <219bd42a8b9bdb6c8c2c6181538c2e06d5c2c8f6.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 guix/scripts/system.scm
 (bootloader-installer-script): Delete. Change-Id:
 Ic1e0a523c814e4f1bf44b2721f5658f00066b0ab
 --- guix/scripts/system.scm | 22 1 file changed, 22 deletions(-) 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * guix/scripts/system.scm
    (bootloader-installer-script): Delete. Change-Id: Ic1e0a523c814e4f1bf44b2721f5658f00066b0ab
    --- guix/scripts/system.scm | 22 1 file changed, 22 deletions(-) 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* guix/scripts/system.scm (bootloader-installer-script): Delete.

Change-Id: Ic1e0a523c814e4f1bf44b2721f5658f00066b0ab
---
 guix/scripts/system.scm | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 0fd153a278..881f2de104 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -754,28 +754,6 @@ (define (maybe-suggest-running-guix-pull)
     (warning (G_ "Consider running 'guix pull' before 'reconfigure'.~%"))
     (warning (G_ "Failing to do that may downgrade your system!~%"))))
 
-(define (bootloader-installer-script installer
-                                     bootloader device target)
-  "Return a file calling INSTALLER gexp with given BOOTLOADER, DEVICE
-and TARGET arguments."
-  (scheme-file "bootloader-installer"
-               (with-imported-modules '((gnu build bootloader)
-                                        (guix build utils))
-                 #~(begin
-                     (use-modules (gnu build bootloader)
-                                  (guix build utils)
-                                  (ice-9 binary-ports)
-                                  (srfi srfi-34)
-                                  (srfi srfi-35))
-
-                     (guard (c ((message-condition? c) ;XXX: i18n
-                                (format (current-error-port) "error: ~a~%"
-                                        (condition-message c))
-                                (exit 1)))
-                       (#$installer #$bootloader #$device #$target)
-                       (info (G_ "bootloader successfully installed on '~a'~%")
-                             #$device))))))
-
 (define (local-eval exp)
   "Evaluate EXP, a G-Expression, in-place."
   (mlet* %store-monad ((lowered (lower-gexp exp))
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, lilah@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 05/14] guix: scripts: Rewrite reinstall-bootloader to use provenance data.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, lilah@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:04 +0000
Resent-Message-ID: <handler.73202.B73202.172734548713252 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734548713252
          (code B ref 73202); Thu, 26 Sep 2024 10:12:04 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:27 +0000
Received: from localhost ([127.0.0.1]:55489 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlT4-0003RL-37
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:27 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSx-0003PA-Bw
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345438;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=TIV9r0fR/7ADV2dR0dxOhiTkX2HwIVGBAggUOpD02gY=;
 b=KhpQrnMlDW+ZfZcC2yXGB2DerVGgdFHFKscIlveBRNe//Ce47XdFbPiyocZwScjw6aNCUy
 yRWUBMouxPEZurAh8M43a831M6+8nIVZ/2bI/2fygEZQsQKOyYy9g0DRyI8WxmGtff8iJv
 uVJlh967E0CZ/pzzDqpO83sB1J4ltIthLqiuoa8ZkGRv1s08zoBfGoUNix4IjKX7uuPirt
 bUZ3IdyljNwimoOHbG0hTk+pKQor0tLRUd+u5/PP4uyXdkEigFql76KVgCgh20XukXOcPF
 yb4eQS9Xu/PkzEys1zKYhshyv9I9xizZPL1dDQxnb+E1BoTiKkmwTpLdFXs9oQ==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 30ea07c1
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:38 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:02 +0200
Message-ID: <de896f29150ecc2d0bc731ddb571296f94ca5b15.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> Looking up
 bootloaders
 by name is broken because (extlinux) bootloaders share a name. Also,
 bootloader-configuration
 data is significant to bootloader installation, so it shouldn't just use
 the defaul [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> Looking up bootloaders
    by name is broken because (extlinux) bootloaders share a name. Also, bootloader-configuration
    data is significant to bootloader installation, so it shouldn't just use
   the defaul [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

Looking up bootloaders by name is broken because (extlinux) bootloaders
share a name.  Also, bootloader-configuration data is significant to
bootloader installation, so it shouldn't just use the default values.
Installation can rely on the provenance service instead, which should be
present for the vast majority of systems.

* gnu/bootloader.scm (%bootloaders): Delete variable.
(lookup-bootloader-by-name, bootloader-modules): Delete procedures.
* guix/scripts/system.scm (install-bootloader-from-os,
install-bootloader-from-provenance): Add procedures.
(reinstall-bootloader): Remove procedure.
(switch-to-system-generation, process-command): Use
install-bootloader-from-provenance.

Change-Id: I5713a43ad4f9f32a129d980db06d70de16b03f27
---
 gnu/bootloader.scm      | 26 ---------------
 guix/scripts/system.scm | 73 ++++++++++++++++-------------------------
 2 files changed, 28 insertions(+), 71 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 865521e6e5..3ea50a4004 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -26,7 +26,6 @@
 (define-module (gnu bootloader)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
-  #:use-module (guix discovery)
   #:use-module (guix gexp)
   #:use-module (guix profiles)
   #:use-module (guix records)
@@ -79,8 +78,6 @@ (define-module (gnu bootloader)
             bootloader-configuration-device-tree-support?
             bootloader-configuration-extra-initrd
 
-            %bootloaders
-            lookup-bootloader-by-name
 
             efi-bootloader-chain))
 
@@ -287,29 +284,6 @@ (define (bootloader-configuration-targets config)
 ;;; Bootloaders.
 ;;;
 
-(define (bootloader-modules)
-  "Return the list of bootloader modules."
-  (all-modules (map (lambda (entry)
-                      `(,entry . "gnu/bootloader"))
-                    %load-path)
-               #:warn warn-about-load-error))
-
-(define %bootloaders
-  ;; The list of publically-known bootloaders.
-  (delay (fold-module-public-variables (lambda (obj result)
-                                         (if (bootloader? obj)
-                                             (cons obj result)
-                                             result))
-                                       '()
-                                       (bootloader-modules))))
-
-(define (lookup-bootloader-by-name name)
-  "Return the bootloader called NAME."
-  (or (find (lambda (bootloader)
-              (eq? name (bootloader-name bootloader)))
-            (force %bootloaders))
-      (leave (G_ "~a: no such bootloader~%") name)))
-
 (define (efi-bootloader-profile packages files hooks)
   "Creates a profile from the lists of PACKAGES and FILES from the store.
 This profile is meant to be used by the bootloader-installer.
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 881f2de104..6b6bb46975 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -11,6 +11,8 @@
 ;;; Copyright © 2021 Brice Waegeneire <brice@HIDDEN>
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@HIDDEN>
 ;;; Copyright © 2022 Tobias Geerinckx-Rice <me@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
+;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -88,6 +90,7 @@ (define-module (guix scripts system)
   #:use-module (srfi srfi-37)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
+  #:use-module (ice-9 receive)
   #:use-module (rnrs bytevectors)
   #:export (guix-system
             read-operating-system
@@ -375,60 +378,39 @@ (define (switch-to-system-generation store spec)
          (activate (string-append generation "/activate")))
     (if number
         (begin
-          (reinstall-bootloader store number)
+          (install-bootloader-from-provenance store number)
           (switch-to-generation* %system-profile number)
           (unless-file-not-found (primitive-load activate)))
         (leave (G_ "cannot switch to system generation '~a'~%") spec))))
 
-(define* (system-bootloader-name #:optional (system %system-profile))
-  "Return the bootloader name stored in SYSTEM's \"parameters\" file."
-  (let ((params (unless-file-not-found
-                 (read-boot-parameters-file system))))
-    (boot-parameters-bootloader-name params)))
-
-(define (reinstall-bootloader store number)
-  "Re-install bootloader for existing system profile generation NUMBER.
-STORE is an open connection to the store."
-  (let* ((generation (generation-file-name %system-profile number))
-         ;; Detect the bootloader used in %system-profile.
-         (bootloader (lookup-bootloader-by-name (system-bootloader-name)))
-
-         ;; Use the detected bootloader with default configuration.
-         ;; It will be enough to allow the system to boot.
-         (bootloader-config (bootloader-configuration
-                             (bootloader bootloader)))
-
-         ;; Make the specified system generation the default entry.
-         (chosen-alternative (generation->boot-alternative
-                              %system-profile number))
-         (params (boot-alternative-parameters chosen-alternative))
-         (locale (boot-parameters-locale params))
-         (store-crypto-devices (boot-parameters-store-crypto-devices params))
-         (store-directory-prefix
-          (boot-parameters-store-directory-prefix params))
-         (old-generations
-          (delv number (reverse (generation-numbers %system-profile))))
-         (previous-boot-alternatives (profile->boot-alternatives
-                                      %system-profile old-generations))
-         (entries (list (boot-parameters->menu-entry params)))
-         (old-entries (map boot-alternative->menu-entry
-                           previous-boot-alternatives)))
+(define (install-bootloader-from-os store number os)
+  "Re-install an old bootloader defined in <operating-system> record OS,
+for system profile generation NUMBER, with store STORE."
+  (let* ((os (read-operating-system os))
+         (bootloader-config (operating-system-bootloader os))
+         (numbers (generation-numbers %system-profile))
+         (numbers (delv number (reverse numbers)))
+         (old (profile->boot-alternatives %system-profile numbers))
+         (bootcfg (operating-system-bootcfg os old)))
     (run-with-store store
-      (mlet* %store-monad
-          ((bootcfg (lower-object
-                     ((bootloader-configuration-file-generator bootloader)
-                      bootloader-config entries
-                      #:locale locale
-                      #:store-crypto-devices store-crypto-devices
-                      #:store-directory-prefix store-directory-prefix
-                      #:old-entries old-entries)))
-           (drvs -> (list bootcfg)))
+      (mlet* %store-monad ((bootcfg (lower-object bootcfg))
+                           (drvs -> (list bootcfg)))
         (mbegin %store-monad
           (built-derivations drvs)
           ;; Only install bootloader configuration file.
           (install-bootloader local-eval bootloader-config bootcfg
                               #:run-installer? #f))))))
 
+(define (install-bootloader-from-provenance store number)
+  "Re-install an old bootloader using provenance data for system profile
+generation NUMBER with store STORE."
+  (receive (_ os)
+      (system-provenance (generation-file-name %system-profile number))
+    (if os
+        (install-bootloader-from-os store number os)
+        (leave (G_ "cannot rollback to generation '~a': no provenance~%")
+               number))))
+
 
 ;;;
 ;;; Graphs.
@@ -1387,10 +1369,11 @@ (define (process-command command args opts)
      (let ((pattern (match args
                       (() #f)
                       ((pattern) pattern)
-                      (x (leave (G_ "wrong number of arguments~%"))))))
+                      (_ (leave (G_ "wrong number of arguments~%")))))
+           (number (generation-number %system-profile)))
        (with-store* store
          (delete-matching-generations store %system-profile pattern)
-         (reinstall-bootloader store (generation-number %system-profile)))))
+         (install-bootloader-from-provenance store number))))
     ((switch-generation)
      (let ((pattern (match args
                       ((pattern) pattern)
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 06/14] guix: utils: Add flatten and flat-map from haunt.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:04 +0000
Resent-Message-ID: <handler.73202.B73202.172734548813259 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734548813259
          (code B ref 73202); Thu, 26 Sep 2024 10:12:04 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:28 +0000
Received: from localhost ([127.0.0.1]:55493 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlT5-0003Rg-Jp
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:27 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53171
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSy-0003PN-Av
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:20 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345439;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=WHUatHCEKa7jz6Gfk1bYsIZYqcMbf7e0yhQ/cl/jGpE=;
 b=jA2rOqcgFQ8XX0jzW8cUH4iuSav+kEPsioL9/L8t/FpAJtwimJJHuVJPVhLa1Rl3Ej1zlU
 K6tIKhdyXsGOvb7wVy93FziPNLeVeYBY0HeqgT0YB/cmPo0k6iOyKrdn364J6iolonahN9
 CRKQ1+2PjfB8Cex7gH2uaqaJ85IBuJk2edEMPLZLYgvP1C82594pt5Jg/PyErpZ8VU27pP
 keNrugRrwP0yTFjwKJhu0g8uRcj1LcCC1b9a6NfaHCVGvsZBIBPkcR4xwGxPmBra1xxsM1
 j5nI+1H7h/GuxD/dhpPXoAcIdYDcTt0LdQV3iEmn9U8GOagcQPTJv3RJe06i6Q==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 972bb699
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO)
 for <73202 <at> debbugs.gnu.org>; Thu, 26 Sep 2024 10:10:39 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:03 +0200
Message-ID: <fd8c84f59bae1ee4122809f164b851633089dd82.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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:  * guix/utils.scm (flatten,
 flat-map): Add procedures. Change-Id:
 I1d7d49fd02115e3de09ed69bcf5f55a10423162e --- guix/utils.scm | 26
 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm
 index f161cb4ef3..2740552a75 100644 --- a/guix/utils.scm +++ b/guix/utils.scm
 @@ -139,6 +139,9 @@ (define-module (guix utils) with-environment-variables
 ar [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  * guix/utils.scm (flatten, flat-map): Add procedures. Change-Id:
    I1d7d49fd02115e3de09ed69bcf5f55a10423162e --- guix/utils.scm | 26 ++++++++++++++++++++++++++
    1 file changed, 26 insertions(+) diff --git a/guix/utils.scm b/guix/utils.scm
    index f161cb4ef3..2740552a75 100644 --- a/guix/utils.scm +++ b/guix/utils.scm
    @@ -139,6 +139,9 @@ (define-module (guix utils) with-environment-variables
    ar [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

* guix/utils.scm (flatten, flat-map): Add procedures.

Change-Id: I1d7d49fd02115e3de09ed69bcf5f55a10423162e
---
 guix/utils.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/guix/utils.scm b/guix/utils.scm
index f161cb4ef3..2740552a75 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -139,6 +139,9 @@ (define-module (guix utils)
             with-environment-variables
             arguments-from-environment-variable
 
+            flatten
+            flat-map
+
             config-directory
             cache-directory
 
@@ -1028,6 +1031,29 @@ (define (with-atomic-file-output file proc)
         (false-if-exception (delete-file template))
         (close-port out)))))
 
+;; TODO: bring over other utility procedures from (haunt utils).
+(define* (flatten lst #:optional depth)
+  "Return a list that recursively concatenates the sub-lists of LST,
+up to DEPTH levels deep.  When DEPTH is #f, the entire tree is
+flattened."
+  (if (and (number? depth) (zero? depth))
+      lst
+      (fold-right (match-lambda*
+                   (((sub-list ...) memo)
+                    (append (flatten sub-list (and depth (1- depth)))
+                            memo))
+                   ((elem memo)
+                    (cons elem memo)))
+                  '()
+                  lst)))
+
+(define (flat-map proc . lsts)
+  "Apply PROC to each element of each list in LSTS and return a new
+list in which nested lists are concatenated into the result.
+
+For example, the list (1 2 (3)) would be flattened to (1 2 3)."
+  (flatten (apply map proc lsts) 1))
+
 (define* (xdg-directory variable suffix #:key (ensure? #t))
   "Return the name of the XDG directory that matches VARIABLE and SUFFIX,
 after making sure that it exists if ENSURE? is true.  VARIABLE is an
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 07/14] guix: records: Add wrap-element procedure.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:05 +0000
Resent-Message-ID: <handler.73202.B73202.172734548813265 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734548813265
          (code B ref 73202); Thu, 26 Sep 2024 10:12:05 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:28 +0000
Received: from localhost ([127.0.0.1]:55495 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlT6-0003Rp-2w
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:28 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSy-0003PA-Mq
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345439;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=ncPhGvvLij3mJW3Pl60KSTuVhclk2lIYNppvNs/WgWk=;
 b=QHT2qpjnwJh4I5ULA9c4aYGuJIVl1+Q5oYar3Yv0gHGE0/3/lXBk3HD2UxfilBPuXqCnkB
 s3FlxA3r0xC2huFPsrWfSbpBokNBhWICtkQx4hUCgi5lkdlOGLByGJEbWydVnAsWsJfaQL
 dntFX2zxv4RxRxsiq9y5WbJAgx6acG8lUIkYhN9tqi8OpCVU6Wnqvii4A/ALKGKQuNICg3
 9fliJ+JL8h5f7QhchUesQDy1FF3KPny9aUQiSJfsqF7OmShZh5NBIMOAaIit7Uu7k9LjCo
 7PeG7wW3jCOvqEi2agt3PgUT9OnkEQVXE1GGaEleIEUODyGDgKNlYVCdvJcHhQ==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 1a999e53
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO)
 for <73202 <at> debbugs.gnu.org>; Thu, 26 Sep 2024 10:10:39 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:04 +0200
Message-ID: <016d2352f78fa879b32d3794f74082fadfe89285.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: * guix/records.scm (wrap-element): Add procedure. Change-Id:
 If121c5d856e815776830282a0701a73e5ae2a7e7 --- guix/records.scm | 7 +++++++
 1 file changed,
 7 insertions(+) diff --git a/guix/records.scm b/guix/records.scm
 index c084441441..b521a59257 100644 --- a/guix/records.scm +++
 b/guix/records.scm
 @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GN [...]
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  * guix/records.scm (wrap-element): Add procedure. Change-Id:
    If121c5d856e815776830282a0701a73e5ae2a7e7 --- guix/records.scm | 7 +++++++
    1 file changed, 7 insertions(+) diff --git a/guix/records.scm b/guix/records.scm
    index c084441441..b521a59257 100644 --- a/guix/records.scm +++ b/guix/records.scm
    @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GN [...]
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

* guix/records.scm (wrap-element): Add procedure.

Change-Id: If121c5d856e815776830282a0701a73e5ae2a7e7
---
 guix/records.scm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/guix/records.scm b/guix/records.scm
index c084441441..b521a59257 100644
--- a/guix/records.scm
+++ b/guix/records.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012-2024 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2018 Mark H Weaver <mhw@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -31,6 +32,8 @@ (define-module (guix records)
             alist->record
             object->fields
             recutils->alist
+            wrap-element
+
             match-record
             match-record-lambda))
 
@@ -606,6 +609,10 @@ (define (recutils->alist port)
               (else
                (error "unmatched line" line))))))))
 
+(define (wrap-element x)
+  "Sanitize a record field value X to a list."
+  (if (list? x) x (list x)))
+
 
 ;;;
 ;;; Pattern matching.
-- 
2.45.2





Message sent to guix@HIDDEN, dev@HIDDEN, lilah@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 08/14] gnu: bootloader: Add bootloader-target record and infastructure.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix@HIDDEN, dev@HIDDEN, lilah@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:05 +0000
Resent-Message-ID: <handler.73202.B73202.172734550513303 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
X-Debbugs-Original-Xcc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734550513303
          (code B ref 73202); Thu, 26 Sep 2024 10:12:05 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:45 +0000
Received: from localhost ([127.0.0.1]:55498 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlTM-0003ST-GT
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:45 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53171
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSz-0003PN-3Q
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:22 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345440;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=uo7S4ucruDPB9WMbXGJxtKmL+muhmw/dHd4Iz8LonXI=;
 b=nqtLLVHw7MEsJMktcC1FVDCFandxYnFiAOcNsej9p5aiEkRmaevEj8g7TlPwIyY8m8Ufep
 HXrEpJef54ToX3BNw07dHJaC3zrrTsSAbFpRQ03x2I2BjrVZaPNpceePFGBk6a9CyYAMMI
 Q6T1rWhDXcjp8Y4dv2r0iW58wUTeAKI1eSVjozcnPxZDdPLg3EMf77XEifviJL7VDRAsPf
 MaqJQyAbc0XmWbrx3ToWmbW4qcXoGy8hjsizVUR21jGm/dHIHRHt9rxUOSv1TmOYEtyyDy
 sLydgDcWspMUmb3D5A8l/Cu4NthQFvqFXTKCA8+FC8A4ccujl+thLHd3xuld0A==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id b097df94
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:40 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:05 +0200
Message-ID: <d7820e89fbf046495d02e860f015c83fce0a7d18.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (bootloader-target): New record. (&target-error): New condition. (pathcat,
 get-target-of-type, parent-of, unfold-pathcat, target-base?, type-major?,
 ensure, ensure-target-types, e [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (bootloader-target): New record. (&target-error): New condition. (pathcat,
    get-target-of-type, parent-of, unfold-pathcat, target-base?, type-major?,
    ensure, ensure-target-types, e [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (bootloader-target): New record.
(&target-error): New condition.
(pathcat, get-target-of-type, parent-of, unfold-pathcat, target-base?,
type-major?, ensure, ensure-target-types, ensure-majors, gbegin): New
procedures.
(define-literal, with-targets, :path, :devpath, :device, :fs, :label,
:uuid): New macros.
* guix/ui.scm (call-with-error-handling)[target-error?]: Handle
target-errors.

Change-Id: I3f07c9096dd8b91c04449b6360b3b7d21640da14
---
 gnu/bootloader.scm | 229 ++++++++++++++++++++++++++++++++++++++++++++-
 guix/ui.scm        |   9 ++
 2 files changed, 233 insertions(+), 5 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 3ea50a4004..0c24996205 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2022 Josselin Poiret <dev@HIDDEN>
 ;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@HIDDEN>
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,19 +25,28 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu bootloader)
+  #:autoload   (gnu build file-systems)
+               (read-partition-label read-partition-uuid
+                find-partition-by-label find-partition-by-uuid)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
-  #:use-module (guix gexp)
-  #:use-module (guix profiles)
-  #:use-module (guix records)
+  #:autoload   (guix build syscalls)
+               (mounts mount-source mount-point mount-type)
   #:use-module (guix deprecation)
-  #:use-module ((guix ui) #:select (warn-about-load-error))
   #:use-module (guix diagnostics)
+  #:use-module (guix gexp)
   #:use-module (guix i18n)
+  #:use-module (guix modules)
+  #:use-module (guix profiles)
+  #:use-module (guix records)
+  #:use-module (guix utils)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 receive)
+  #:use-module (rnrs bytevectors)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-35)
-  #:use-module (ice-9 match)
   #:export (menu-entry
             menu-entry?
             menu-entry-label
@@ -62,6 +72,25 @@ (define-module (gnu bootloader)
             bootloader-configuration-file
             bootloader-configuration-file-generator
 
+            bootloader-target
+            bootloader-target?
+            bootloader-target-type
+            bootloader-target-expected?
+            bootloader-target-path
+            bootloader-target-offset
+            bootloader-target-device
+            bootloader-target-file-system
+            bootloader-target-label
+            bootloader-target-uuid
+
+            target-error?
+            target-error-type
+            target-error-targets
+
+            gbegin
+            :path :devpath :device :fs :label :uuid
+            with-targets
+
             bootloader-configuration
             bootloader-configuration?
             bootloader-configuration-bootloader
@@ -232,6 +261,196 @@ (define-record-type* <bootloader>
   (configuration-file              bootloader-configuration-file)
   (configuration-file-generator    bootloader-configuration-file-generator))
 
+
+;;;
+;;; Bootloader target record.
+;;;
+
+;; <bootloader-target> represents different kinds of targets in a
+;; normalized form.
+
+(define-record-type* <bootloader-target>
+  bootloader-target make-bootloader-target bootloader-target?
+  (type bootloader-target-type)                            ; symbol
+  (expected? bootloader-target-expected? (default #f))     ; bool
+
+  (path bootloader-target-path (default #f))               ; string|#f
+  (offset bootloader-target-offset (thunked)               ; symbol|#f
+          (default (and (bootloader-target-path this-record)
+                        (not (eq? (bootloader-target-type this-record) 'root))
+                        'root)))
+  (device bootloader-target-device (default #f))           ; string|#f
+  (file-system bootloader-target-file-system (default #f)) ; string|#f
+  (label bootloader-target-label (default #f))             ; string|#f
+  (uuid bootloader-target-uuid (default #f)))              ; uuid|#f
+
+(define-condition-type &target-error &error target-error?
+  (type target-error-type)
+  (targets target-error-targets))
+
+(define (pathcat p1 p2)
+  (string-append (string-trim-right p1 #\/) "/" (string-trim p2 #\/)))
+
+(define* (get-target-of-type type targets #:optional require?)
+  "Finds a target in TARGETS of type TYPE, returns REQUIRE? if #false,
+or provides an error otherwise."
+  (define (type? target)
+    (eq? type (bootloader-target-type target)))
+  (match (filter type? targets)
+    ((target _ ...) target)
+    (_ (and require?
+            (raise
+              (condition
+                (&message (message (G_ "required, but not provided")))
+                (&target-error (type type) (targets targets))))))))
+
+(define (parent-of target targets)
+  "Resolve the parent of TARGET in TARGETS, return #f if orphan."
+  (and=> (bootloader-target-offset target)
+         (cut get-target-of-type <> targets #t)))
+
+(define (unfold-pathcat target targets)
+  "Find the full VFS path of TARGET."
+  (let ((quit (lambda (t) (not (and=> t bootloader-target-path))))
+        (parent-of (cut parent-of <> targets)))
+    (reduce pathcat #f
+      (unfold quit bootloader-target-path parent-of target))))
+
+(define (target-base? t)
+  (or (not t) (match-record t <bootloader-target>
+                (expected? offset device label uuid)
+                (or device label uuid (not offset) expected?))))
+
+(define (type-major? target) (memq target '(root esp disk)))
+
+(define (ensure types targets end)
+  (let* ((used-in (cute unfold end identity (cut parent-of <> targets) <>))
+         (cons-in (lambda (t) (cons t (used-in t))))
+         (ensure (map (cut get-target-of-type <> targets #t) types)))
+    (filter identity (apply append (map cons-in ensure)))))
+
+(define* (ensure-target-types types targets #:optional (base? #f))
+  "Ensures all TYPES are provided in TARGETS.  Returns #t iff every ensured
+target and its requirements are fully provided.  Errors out when a required TYPE
+isn't provided.  When BASE?, only ensure path requirements up to a device."
+  (not (any bootloader-target-expected?
+         (ensure types targets (if base? target-base? not)))))
+
+(define (ensure-majors types targets)
+  "Errors out when a required TYPE isn't provided, or when use of multiple major
+targets is detected."
+  (let* ((all (map bootloader-target-type (ensure types targets target-base?)))
+         (majors (delete-duplicates (filter type-major? all) eq?)))
+    (if (< (length majors) 2) #t
+      (raise (condition (&message (message (G_ "multiple major targets used")))
+                        (&target-error (type majors) (targets targets)))))))
+
+
+
+(define (gbegin . gex)
+  "Sequence provided g-expressions."
+  (case (length gex) ((0) #f) ((1) (car gex)) (else #~(begin #$@gex))))
+
+;; syntax matching on free literals breaks easily, so bind them
+(define-syntax-rule (define-literal id) (define-syntax id (syntax-rules ())))
+(define-literal :path)
+(define-literal :devpath)
+(define-literal :device)
+(define-literal :fs)
+(define-literal :label)
+(define-literal :uuid)
+
+(define-syntax with-targets
+  (cut syntax-case <> ()
+    ((_ targets-expr block ...)
+     (let* ((genvars (compose generate-temporaries make-list))
+            (targets (car (genvars 1))))
+       (define (resolve in target base)
+         (with-syntax ((target target) (base base) (targets targets))
+           (syntax-case in
+             (:path :devpath :device :fs :label :uuid)
+             ((name _) (not (identifier? #'name))
+              #`(_ (syntax-error "binds must be to identifiers" #,in)))
+             ((name :device) #'(name (bootloader-target-device base)))
+             ((name :label) #'(name (bootloader-target-label base)))
+             ((name :uuid) #'(name (bootloader-target-uuid base)))
+             ((name :fs) #'(name (bootloader-target-file-system base)))
+             ((name :path) #'(name (unfold-pathcat target targets)))
+             ((name :devpath)
+              #'(name (if (target-base? target)
+                          "/"
+                          (pathcat "/" (bootloader-target-path target)))))
+             (_ #`(_ (syntax-error "invalid binding spec" #,in))))))
+
+       (define (binds spec)
+         (syntax-case spec (=>)
+           ((type => binds ...)
+            (with-syntax (((target base) (genvars 2)) (targets targets))
+              (append
+                #`((get (lambda (t) (get-target-of-type t targets #t)))
+                   (target (get type))
+                   (base (if (target-base? target)
+                             target
+                             (get (bootloader-target-offset target)))))
+                (map (cut resolve <> #'target #'base) #'(binds ...)))))
+           (_ #f)))
+
+       (define blocks
+         (cut syntax-case <> ()
+           ((spec ... expr)
+            (let* ((path? (cut syntax-case <> (:path) ((_ :path) #t) (_ #f)))
+                   (qualified? (cut syntax-case <> (=>)
+                                 ((_ => spec ...) (any path? #'(spec ...)))
+                                 (_ #f)))
+                   (specs #'(spec ...))
+                   (lets (apply append (filter-map binds specs)))
+                   (type (cut syntax-case <> (=>)
+                           ((t => _ ...) #'t) (t #'t))))
+              (receive (full part) (partition qualified? specs)
+                #`(and (ensure-majors (list #,@(map type specs)) #,targets)
+                       (ensure-target-types (list #,@(map type part))
+                                            #,targets #t)
+                       (ensure-target-types (list #,@(map type full))
+                                            #,targets #f)
+                       (let* #,lets expr)))))
+           (bad #'(syntax-error "malformed block" bad))))
+       "Using the list TARGETS, evaluate and sequence each BLOCK to produce a
+gexp.  BLOCK is a set of SPECs followed by an EXPR (evaluating to a gexp).
+Each SPEC denotes a type of target to guard EXPR on their existance and
+full-qualification.  This procedure is linear in regard to BLOCKs.
+
+SPEC may be of the following forms:
+@itemize
+@item 'TYPE Requires TYPE to be fully present or promised. Errors otherwise.
+@item ('TYPE => (VAR COMPONENT) ...): As type, but also binds variables. TYPE's
+      COMPONENT is bound to the variable VAR as described below.
+@end itemize
+
+Available COMPONENTs are:
+@itemize
+@item :path (fully-qualified)
+@item :devpath (relative from device)
+@item :device (auto-detected from uuid and label if not user-provided)
+@item :fs
+@item :label
+@item :uuid
+@end itemize
+
+Note that installers may be called multiple times with different targets being
+fully-qualified.  To ensure that targets aren't installed multiple times, make sure
+that each BLOCK ensures at least one major target, either directly or indirectly.
+Likewise, at most one major target should be ensured per BLOCK, under the same
+conditions.  Major targets originate from disk image handling, and are currently:
+@itemize
+@item disk
+@item root
+@item esp
+@end itemize"
+       #`(let ((#,targets targets-expr))
+           (apply gbegin (filter identity
+                                 (list #,@(map blocks #'(block ...))))))))
+    (bad #'(syntax-error "must provide targets" bad))))
+
 
 ;;;
 ;;; Bootloader configuration record.
diff --git a/guix/ui.scm b/guix/ui.scm
index fe059ba089..663b814da6 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -19,6 +19,7 @@
 ;;; Copyright © 2018 Steve Sprang <scs@HIDDEN>
 ;;; Copyright © 2022 Taiju HIGASHI <higashi@HIDDEN>
 ;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,6 +37,8 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (guix ui)                       ;import in user interfaces only
+  #:use-module ((gnu bootloader)
+                #:select (target-error? target-error-type target-error-targets))
   #:use-module (guix i18n)
   #:use-module (guix colors)
   #:use-module (guix diagnostics)
@@ -862,6 +865,12 @@ (define (call-with-error-handling thunk)
                      (invoke-error-stop-signal c)
                      (cons (invoke-error-program c)
                            (invoke-error-arguments c))))
+              ((target-error? c)
+               (leave (G_ "bootloader-target '~a'~@[: ~a~] ~
+                          among the following targets:~%~{~y~}")
+                      (target-error-type c)
+                      (and (message-condition? c) (condition-message c))
+                      (target-error-targets c)))
 
              ((formatted-message? c)
               (apply report-error
-- 
2.45.2





Message sent to lilah@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 09/14] gnu: bootloader: Add bootloader-configurations->gexp.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: lilah@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:06 +0000
Resent-Message-ID: <handler.73202.B73202.172734550613310 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>
X-Debbugs-Original-Xcc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734550613310
          (code B ref 73202); Thu, 26 Sep 2024 10:12:06 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:46 +0000
Received: from localhost ([127.0.0.1]:55500 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlTN-0003SW-El
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:45 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlSz-0003PA-Jv
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345441;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=qBNIh/kScwIFDm4cVMybJISLgB15iFQHhIQqqC68N6I=;
 b=sLeo8E8sZ/0XupqHGNTwOgS9j4GP2M8oqJ68gB2baZjQ4u8xMSLZ/XFnHgOgIKI0sAfxqX
 gRM3hBTCs1gc+zYwIcSV1NxGJxuzCX9SUCeeXuWnusycxVupMvtVN2fz+HOBcSUAbjfXS4
 jCZdolEzEsSkr7ov1mYsmhyL2RMGt6VPO+IRlnLBhtOx8UnmLb0zFQep+Vxv+4BsGMjvL9
 x1ycxG6DD43br44DtfSYwJjueTDPngP54CCs3N4n9jFeHfaBLvHUBl1rnfE1hxTaJvcuz2
 vD4GleQcslNuPQUK1fxWZunJAApE4QC3CJSfvJwCu9VL3c4o/cGh412Ldhwqew==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 03d74ee7
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:41 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:06 +0200
Message-ID: <2ce2a5d1b077a35dcfc95c707703f8c0a11bf3b2.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (bootloader)[default-targets]: Add field. (target-overrides, normalize,
 bootloader-configuration->gexp, 
 bootloader-configurations->gexp): New procedures. 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (bootloader)[default-targets]: Add field. (target-overrides, normalize, bootloader-configuration->gexp,
    bootloader-configurations->gexp): New procedures. 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (bootloader)[default-targets]: Add field.
(target-overrides, normalize, bootloader-configuration->gexp,
bootloader-configurations->gexp): New procedures.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/bootloader.scm | 108 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 108 insertions(+)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 0c24996205..c77de6f55e 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -67,6 +67,7 @@ (define-module (gnu bootloader)
             bootloader?
             bootloader-name
             bootloader-package
+            bootloader-default-targets
             bootloader-installer
             bootloader-disk-image-installer
             bootloader-configuration-file
@@ -107,6 +108,8 @@ (define-module (gnu bootloader)
             bootloader-configuration-device-tree-support?
             bootloader-configuration-extra-initrd
 
+            bootloader-configuration->gexp
+            bootloader-configurations->gexp
 
             efi-bootloader-chain))
 
@@ -255,6 +258,7 @@ (define-record-type* <bootloader>
   bootloader?
   (name                            bootloader-name)
   (package                         bootloader-package)
+  (default-targets bootloader-default-targets (default '()))
   (installer                       bootloader-installer)
   (disk-image-installer            bootloader-disk-image-installer
                                    (default #f))
@@ -498,6 +502,110 @@ (define (bootloader-configuration-targets config)
       ;; hence the default value of '(#f) rather than '().
       (list #f)))
 
+
+;;;
+;;; Bootloader installation paths.
+;;;
+
+(define (target-overrides . layers)
+  (let* ((types (flat-map (cute map bootloader-target-type <>) layers))
+         ;; TODO: use loop instead of fold for early termination.
+         (pred (lambda (type layer found)
+                 (or found (get-target-of-type type layer))))
+         (find (lambda (type) (fold (cute pred type <> <>) #f layers))))
+    (filter identity (map find (delete-duplicates types)))))
+
+(define (normalize targets)
+  "Augments TARGETS with filesystem information at runtime, allowing
+users to specify a lot less information.  Puts TARGETS into a normal
+form, where each path is fully specified up to a device offset."
+  (define (mass m)
+    `((,(mount-source m) . ,m)
+      (,(mount-point m) . ,m)))
+
+  (define (accessible=> d f)
+    (and d (access? d R_OK) (f d)))
+
+  (define (fixuuid target)
+    (match-record target <bootloader-target> (uuid file-system)
+      (let ((type (cond ((not file-system) 'dce)
+                        ((member file-system '("vfat" "fat32")) 'fat)
+                        ((string=? file-system "ntfs") 'ntfs)
+                        ((string=? file-system "iso9660") 'iso9660)
+                        (else 'dce))))
+        (bootloader-target (inherit target)
+          (uuid (cond ((uuid? uuid) uuid)
+                  ((bytevector? uuid) (bytevector->uuid uuid type))
+                  ((string? uuid) (string->uuid uuid type))
+                  (else #f)))))))
+
+  (define (arborify target targets)
+    (let* ((up (lambda (t) (and t (parent-of t targets))))
+           (proto (unfold target-base? identity up (up target) list))
+           (chain (reverse (cons target proto))))
+      (bootloader-target
+        (inherit target)
+        (offset (and=> (car chain) bootloader-target-type))
+        (path (reduce pathcat #f (map bootloader-target-path (cdr chain)))))))
+
+  (let ((amounts (delay (apply append (map mass (mounts))))))
+    (define (assoc-mnt f)
+      (lambda (v) (and=> (assoc-ref (force amounts) v) f)))
+
+    (define (scrape target)
+      (match-record target <bootloader-target>
+        (expected? path offset device label uuid file-system)
+        (if expected? target
+          (bootloader-target
+            (inherit target)
+            (device (or device
+                        (false-if-exception
+                          (or (and=> uuid find-partition-by-uuid)
+                              (and=> label find-partition-by-label)))
+                        (and path ((assoc-mnt mount-source)
+                                   (unfold-pathcat target targets)))))
+            (label (or label (accessible=> device read-partition-label)))
+            (uuid (or uuid (accessible=> device read-partition-uuid)))
+            (file-system (or file-system (and=> device (assoc-mnt mount-type))))
+            (offset (and path offset))
+            (path (or path (and=> device (assoc-mnt mount-point))))))))
+
+    (let ((mid (map (compose fixuuid scrape) targets)))
+      (map (cut arborify <> mid) mid))))
+
+(define* (bootloader-configuration->gexp bootloader-config args #:key
+                                          (root-offset "/") (overrides '()))
+  "Returns a gexp to install BOOTLOADER-CONFIG to its targets, passing ARGS
+to each installer alongside the additional #:bootloader-config keyword
+arguments.  Target OVERRIDES are applied and all path targets have ROOT-OFFSET
+applied.  The following keyword arguments are expected in ARGS:
+@enumerate
+@item current-boot-alternative
+@item old-boot-alternatives
+@item locale (from bootmeta)
+@item store-directory-prefix (from bootmeta)
+@item store-crypto-devices (from bootmeta)
+@end enumerate"
+  (let* ((bootloader (bootloader-configuration-bootloader bootloader-config))
+         (installer (bootloader-installer bootloader))
+         (auto-targets (list (bootloader-target
+                               (type 'root)
+                               (path root-offset)
+                               (offset #f))))
+         (targets (target-overrides
+                    overrides
+                    (bootloader-configuration-targets bootloader-config)
+                    auto-targets
+                    (bootloader-default-targets bootloader)))
+         (conf (bootloader-configuration
+                 (inherit bootloader-config)
+                 (targets (normalize targets)))))
+    (apply installer #:bootloader-config conf args)))
+
+(define (bootloader-configurations->gexp bootloader-configs . rest)
+  (apply gbegin (filter-map (cut apply bootloader-configuration->gexp <> rest)
+                            bootloader-configs)))
+
 
 ;;;
 ;;; Bootloaders.
-- 
2.45.2





Message sent to lilah@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 10/14] gnu: bootloader: Add device-subvol field to menu-entry record.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: lilah@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:06 +0000
Resent-Message-ID: <handler.73202.B73202.172734550613318 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>
X-Debbugs-Original-Xcc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734550613318
          (code B ref 73202); Thu, 26 Sep 2024 10:12:06 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:46 +0000
Received: from localhost ([127.0.0.1]:55502 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlTN-0003Sd-W5
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:46 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53171
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlT0-0003PN-N9
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345441;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=0CaZ9OnPl3/7G2AVIzFTBFAwD5Y8HdNbaKxoXkEs1cA=;
 b=oHsBDNbo9zsYzY5wl6UGUWFYBDWzaMVU78yNAvX7nrvXzPzjTUPztp1HTlGaIgycYZkeC6
 f/YEjFKUb9AWndNu8QnjSx2zwoNsOiX5XA0dz0sQI4+zHtYkRUhyONNNW4aqQ6rvts80iq
 +MNBkaPMVvQNGxPJH00ATf7rE4EB02XHOZzqbtIqOtpjzDYxZeWhHQQeO5sXkQDd0E2wLf
 8FF14MHqLRl7xLcHzDd0CVW9Y4LbsBXxidGKq+phc/YmnVrKBc4P2kJguZCbdfBCIKDtv+
 rUtxYdxMyGULTZNxHU0ZE+kR07qjTuKs3sYIrxNl67VUbEEDfdGL2natief0Mw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 8c230017
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:41 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:07 +0200
Message-ID: <33b51456dc709d17c8be3776471e0599f83eaec1.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (menu-entry-device-subvol): Add and export field. (normalize-file): Add
 procedure.
 (device->sexp): Match device-subvol and include in S-expression.
 (sexp->menu-entry): Try match d [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (menu-entry-device-subvol): Add and export field. (normalize-file): Add procedure.
    (device->sexp): Match device-subvol and include in S-expression. (sexp->menu-entry):
    Try match d [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (menu-entry-device-subvol): Add and export field.
(normalize-file): Add procedure.
(device->sexp): Match device-subvol and include in S-expression.
(sexp->menu-entry): Try match device-subvol and include in menu-entry.
* gnu/system/boot.scm (boot-parameters->menu-entry): Add device-subvol
value to menu-entry.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/bootloader.scm  | 51 ++++++++++++++++++++++++++++++++++-----------
 gnu/system/boot.scm |  1 +
 2 files changed, 40 insertions(+), 12 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index c77de6f55e..f1352122a9 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -51,15 +51,17 @@ (define-module (gnu bootloader)
             menu-entry?
             menu-entry-label
             menu-entry-device
+            menu-entry-device-mount-point
+            menu-entry-device-subvol
             menu-entry-linux
             menu-entry-linux-arguments
             menu-entry-initrd
-            menu-entry-device-mount-point
             menu-entry-multiboot-kernel
             menu-entry-multiboot-arguments
             menu-entry-multiboot-modules
             menu-entry-chain-loader
 
+            normalize-file
             menu-entry->sexp
             sexp->menu-entry
 
@@ -126,6 +128,8 @@ (define-record-type* <menu-entry>
                    (default #f))
   (device-mount-point menu-entry-device-mount-point
                    (default #f))
+  (device-subvol menu-entry-device-subvol
+                   (default #f))
   (linux           menu-entry-linux
                    (default #f))
   (linux-arguments menu-entry-linux-arguments
@@ -142,6 +146,18 @@ (define-record-type* <menu-entry>
   (chain-loader     menu-entry-chain-loader
                     (default #f)))         ; string, path of efi file
 
+(define (normalize-file entry file)
+  "Normalize a file FILE stored in a menu entry into one suitable for a
+bootloader.  Realizes device-mount-point and device-subvol."
+  (match-menu-entry entry (device-mount-point device-subvol)
+    ;; Avoid using cut procedure from SRFI-26 inside G-exp.
+    (let ((mount (and=> device-mount-point (cut string-trim <> #\/))))
+      #~(let* ((file (string-trim #$file #\/))
+               (file (if (and #$mount (string-prefix? #$mount file))
+                         (substring file (string-length #$mount))
+                         file)))
+          (string-append (or #$device-subvol "") "/" file)))))
+
 (define (report-menu-entry-error menu-entry)
   (raise
    (condition
@@ -169,7 +185,7 @@ (define (menu-entry->sexp entry)
        `(label ,(file-system-label->string label)))
       (_ device)))
   (match entry
-    (($ <menu-entry> label device mount-point
+    (($ <menu-entry> label device mount-point subvol
                      (? identity linux) linux-arguments (? identity initrd)
                      #f () () #f)
      `(menu-entry (version 0)
@@ -178,8 +194,9 @@ (define (menu-entry->sexp entry)
                   (device-mount-point ,mount-point)
                   (linux ,linux)
                   (linux-arguments ,linux-arguments)
-                  (initrd ,initrd)))
-    (($ <menu-entry> label device mount-point #f () #f
+                  (initrd ,initrd)
+                  (device-subvol ,subvol)))
+    (($ <menu-entry> label device mount-point subvol #f () #f
                      (? identity multiboot-kernel) multiboot-arguments
                      multiboot-modules #f)
      `(menu-entry (version 0)
@@ -188,19 +205,23 @@ (define (menu-entry->sexp entry)
                   (device-mount-point ,mount-point)
                   (multiboot-kernel ,multiboot-kernel)
                   (multiboot-arguments ,multiboot-arguments)
-                  (multiboot-modules ,multiboot-modules)))
-    (($ <menu-entry> label device mount-point #f () #f #f () ()
+                  (multiboot-modules ,multiboot-modules)
+                  (device-subvol ,subvol)))
+    (($ <menu-entry> label device mount-point subvol #f () #f #f () ()
                      (? identity chain-loader))
      `(menu-entry (version 0)
                   (label ,label)
                   (device ,(device->sexp device))
                   (device-mount-point ,mount-point)
-                  (chain-loader ,chain-loader)))
+                  (chain-loader ,chain-loader)
+                  (device-subvol ,subvol)))
     (_ (report-menu-entry-error entry))))
 
 (define (sexp->menu-entry sexp)
   "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a <menu-entry>
 record."
+  ;; XXX: The match ORs shadow subvol.
+  (define subvol #f)
   (define (sexp->device device-sexp)
     (match device-sexp
       (('uuid type uuid-string)
@@ -213,35 +234,41 @@ (define (sexp->menu-entry sexp)
                   ('label label) ('device device)
                   ('device-mount-point mount-point)
                   ('linux linux) ('linux-arguments linux-arguments)
-                  ('initrd initrd) _ ...)
+                  ('initrd initrd)
+                  (or ('device-subvol subvol _ ...) (_ ...)))
      (menu-entry
       (label label)
       (device (sexp->device device))
       (device-mount-point mount-point)
+      (device-subvol subvol)
       (linux linux)
       (linux-arguments linux-arguments)
       (initrd initrd)))
     (('menu-entry ('version 0)
                   ('label label) ('device device)
-                  ('device-mount-point mount-point)
+                  ('device-mount-point mount-point) ('device-subvol subvol)
                   ('multiboot-kernel multiboot-kernel)
                   ('multiboot-arguments multiboot-arguments)
-                  ('multiboot-modules multiboot-modules) _ ...)
+                  ('multiboot-modules multiboot-modules)
+                  (or ('device-subvol subvol _ ...) (_ ...)))
      (menu-entry
       (label label)
       (device (sexp->device device))
       (device-mount-point mount-point)
+      (device-subvol subvol)
       (multiboot-kernel multiboot-kernel)
       (multiboot-arguments multiboot-arguments)
       (multiboot-modules multiboot-modules)))
     (('menu-entry ('version 0)
                   ('label label) ('device device)
-                  ('device-mount-point mount-point)
-                  ('chain-loader chain-loader) _ ...)
+                  ('device-mount-point mount-point) ('device-subvol subvol)
+                  ('chain-loader chain-loader)
+                  (or ('device-subvol subvol _ ...) (_ ...)))
      (menu-entry
       (label label)
       (device (sexp->device device))
       (device-mount-point mount-point)
+      (device-subvol subvol)
       (chain-loader chain-loader)))))
 
 
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 54e5673a54..98fcd2b3a0 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -328,6 +328,7 @@ (define (boot-parameters->menu-entry conf)
      (label (boot-parameters-label conf))
      (device (boot-parameters-store-device conf))
      (device-mount-point (boot-parameters-store-mount-point conf))
+     (device-subvol (boot-parameters-store-directory-prefix conf))
      (linux (and (not multiboot?) kernel))
      (linux-arguments (if (not multiboot?)
                           (boot-parameters-kernel-arguments conf)
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 11/14] gnu: build: bootloader: Add efi-bootnums procedure.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:07 +0000
Resent-Message-ID: <handler.73202.B73202.172734550713325 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734550713325
          (code B ref 73202); Thu, 26 Sep 2024 10:12:07 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:47 +0000
Received: from localhost ([127.0.0.1]:55504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlTO-0003Sl-Ic
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:47 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlT1-0003PA-UU
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345442;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=ahYOiYejvGUtNAnSjkb6HMGrj1pd/GqjJ61kZBWbi9A=;
 b=kU3dDqEfP9KtYV9MUCOVtlUrxaVlbzJapexMpfSVIGQ0VhImnM4V7amipd9ZyXbz7wKk5B
 Y9xZWmgLx53/R5xplTki+yq0Gtp4xd056SnNydyML//gj/Ys7n5I+Et1fPShUuk8rASITK
 GxXSjOhA/mXCCXAOR+nthleF82d1QSd6vc0PweF9OIHnvmggTKtV4hLnAFupN73vMK5kMN
 55tqzboXThqYyYtpKSE4pf/SU4qXRKHnmYFiE36QBkcO4rA7cxZXwJsmpdlFvuwPeL7JYE
 1jymYI4l/Y8TmV9/cT1tEJ0f//8pXYtEvxkPSdsiajPg/S+EJIUUnXNttYw7wA==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id fa5314c6
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:42 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:08 +0200
Message-ID: <3063da96c7b9dc3db63dbc96d2238f6ed742b857.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/build/bootloader.scm
 (atomic-copy, efi-bootnums): Add procedures. (in-temporary-directory): Add
 macro. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 ---
 gnu/build/bootloader.scm
 | 48 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+),
 1 deletion(-) 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/build/bootloader.scm
    (atomic-copy, efi-bootnums): Add procedures. (in-temporary-directory): Add
    macro. Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739 --- gnu/build/bootloader.scm
    | 48 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+),
    1 deletion(-) 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/build/bootloader.scm (atomic-copy, efi-bootnums): Add procedures.
(in-temporary-directory): Add macro.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 gnu/build/bootloader.scm | 48 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 47 insertions(+), 1 deletion(-)

diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scm
index af6063a884..3934e03aee 100644
--- a/gnu/build/bootloader.scm
+++ b/gnu/build/bootloader.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2019 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@HIDDEN>
 ;;; Copyright © 2022 Timothy Sample <samplet@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,13 +21,25 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu build bootloader)
+  #:autoload   (guix build syscalls) (free-disk-space)
   #:use-module (guix build utils)
   #:use-module (guix utils)
   #:use-module (ice-9 binary-ports)
+  #:use-module (guix diagnostics)
+  #:use-module (guix i18n)
   #:use-module (ice-9 format)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 popen)
+  #:use-module (ice-9 receive)
+  #:use-module (ice-9 regex)
   #:use-module (rnrs io ports)
   #:use-module (rnrs io simple)
-  #:export (write-file-on-device
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-35)
+  #:export (atomic-copy
+            in-temporary-directory
+            write-file-on-device
             install-efi-loader))
 
 
@@ -34,6 +47,21 @@ (define-module (gnu build bootloader)
 ;;; Writing utils.
 ;;;
 
+(define (atomic-copy from to)
+  (let ((pivot (string-append to ".new")))
+    (copy-file from pivot)
+    (rename-file pivot to)))
+
+(define-syntax-rule (in-temporary-directory blocks ...)
+  "Run BLOCKS while chdir'd into a temporary directory."
+  ;; Under POSIX.1-2008, mkdtemp must make the dir with 700 perms.
+  (let* ((tmp (or (getenv "TMPDIR") "/tmp"))
+         (dir (mkdtemp (string-append tmp "/guix-bootloader.XXXXXX")))
+         (cwd (getcwd)))
+    (dynamic-wind (lambda () (chdir dir))
+                  (lambda () blocks ...)
+                  (lambda () (chdir cwd) (delete-file-recursively dir)))))
+
 (define (write-file-on-device file size device offset)
   "Write SIZE bytes from FILE to DEVICE starting at OFFSET."
   (call-with-input-file file
@@ -56,6 +84,24 @@ (define (write-file-on-device file size device offset)
 ;;; EFI bootloader.
 ;;;
 
+;; XXX: Parsing efibootmgr output may be kinda jank.  A better way may exist.
+(define (efi-bootnums efibootmgr)
+  "Returns '(path . bootnum) pairs for each EFI boot entry.  bootnum is
+a string, and path is backslash-deliminated and relative to the ESP."
+  (let* ((pipe (open-pipe* OPEN_READ efibootmgr))
+         (text (get-string-all pipe))
+         (status (status:exit-val (close-pipe pipe)))
+         (bootnum-pattern
+           "^Boot([0-9a-fA-F]+).*[^A-Za-z]File\\(([^)]+)\\)$"))
+    (unless (zero? status)
+      (raise-exception
+        (formatted-message (G_ "efibootmgr exited with error code ~a") status)))
+    (fold-matches (make-regexp bootnum-pattern regexp/newline) text '()
+                  (lambda (match acc)
+                    (let* ((path (match:substring match 2))
+                           (bootnum (match:substring match 1)))
+                      (cons (cons path bootnum) acc))))))
+
 (define* (install-efi grub grub-config esp #:key targets)
   "Write a self-contained GRUB EFI loader to the mounted ESP using
 GRUB-CONFIG.
-- 
2.45.2





Message sent to lilah@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 13/14] gnu: bootloader: Match records outside the module.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: lilah@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:07 +0000
Resent-Message-ID: <handler.73202.B73202.172734551013336 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
X-Debbugs-Original-Xcc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734551013336
          (code B ref 73202); Thu, 26 Sep 2024 10:12:07 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:50 +0000
Received: from localhost ([127.0.0.1]:55506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlTP-0003Ss-1z
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:50 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:36821
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlT2-0003Q9-NC
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:25 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345443;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=MGXJGMlBS2JxeQ9UHG5y4t5h/ac6O9cs+W8GkavSdxg=;
 b=Wgf78P0DG+HMYyj7x6MBKHBsb+fbJMpySIJkRY9i6ugSHPWkp4aWdVAxUuYyCHdwbz2WUx
 C1ZB6SY4YC8KkFf35UwtjwuU7OL8KE+cMVxj0nHgZ7KYYBvQQ40gT+e7iYyll+33AB9Et4
 kTwA46rWcraRpmoKv9L5TYhCkBxApkhO+WsHSgQwN9ub8VaYWldJU8scggprW98sDLL8eN
 BPXKf2YJlXE7DLPLDBY+ryIh4ai/xuUW3ZyAzLyeAMtGQ1rtwuQRfrCZ0bKYHWuSDsC+T1
 T6NS7b20gfidsveq/PQox9h6DkKBRx53IAwd7tfI1Ur6dFqbEu43/HbI3qaMvw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 2f74c9e7
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO)
 for <73202 <at> debbugs.gnu.org>; Thu, 26 Sep 2024 10:10:43 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:10 +0200
Message-ID: <b04fb48f74331addc5eb380e46ccb8750d8545b5.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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:  * gnu/bootloader.scm (match-bootloader-configuration,
 match-menu-entry):
 Add macros. Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b ---
 gnu/bootloader.scm
 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.6 (++)
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:  * gnu/bootloader.scm (match-bootloader-configuration, match-menu-entry):
    Add macros. Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b --- gnu/bootloader.scm
    | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
  0.0 T_SPF_TEMPERROR        SPF: test of record failed (temperror)
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

* gnu/bootloader.scm (match-bootloader-configuration, match-menu-entry):
Add macros.

Change-Id: I42cb7541045314c37ffef98fe6efe7f46acd9d9b
---
 gnu/bootloader.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 6b08e61492..b1ed187aa2 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2022 Reza Alizadeh Majd <r.majd@HIDDEN>
 ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz>
 ;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
+;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -115,6 +116,9 @@ (define-module (gnu bootloader)
             bootloader-configuration->gexp
             bootloader-configurations->gexp
 
+            match-bootloader-configuration
+            match-menu-entry
+
             %efi-supported-systems
             efi-arch
             install-efi
@@ -642,6 +646,20 @@ (define (bootloader-configurations->gexp bootloader-configs . rest)
   (apply gbegin (filter-map (cut apply bootloader-configuration->gexp <> rest)
                             bootloader-configs)))
 
+;; In lieu of exporting bootloader-configuration and menu-entry RTDs.
+(define-syntax match-bootloader-configuration
+  (syntax-rules ()
+    "Bind each BOOTLOADER-CONFIGURATION field in FIELDS."
+    ((_ bootloader-configuration (fields ...) body ...)
+     (match-record bootloader-configuration <bootloader-configuration>
+                   (fields ...) body ...))))
+
+(define-syntax match-menu-entry
+  (syntax-rules ()
+    "Bind each MENU-ENTRY field in FIELDS."
+    ((_ menu-entry (fields ...) body ...)
+     (match-record menu-entry <menu-entry> (fields ...) body ...))))
+
 
 ;;;
 ;;; Bootloader installation to ESP.
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 14/14] teams: Add bootloading team.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:08 +0000
Resent-Message-ID: <handler.73202.B73202.172734551113343 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734551113343
          (code B ref 73202); Thu, 26 Sep 2024 10:12:08 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:51 +0000
Received: from localhost ([127.0.0.1]:55508 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlTS-0003T3-JL
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:50 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39475
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlT3-0003PA-F9
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345444;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=JMyL6wxv0K/n+14BL5MIqksXAnqONeJGjRnmYYtwgQo=;
 b=daGDRvLIlvLyINXjWzr7yx7DGfWVIhksBFIlESvM2uKWtw3cIhzfDPQt+vz5O9NKF/r0XL
 qx5cR+y1TNhqNp4IFil/FNOPajCnOZnDvnfGDCcRqF4UVd3Ettwa55/GeUaFzQD8cvotO+
 9XIYQDvApJEBzc5QsDYq5t08+2tbRA4BqK6h/LUOHDJjLOBiJnCCsWjiZJ7pr9Zyh8BFuK
 AHaIiQGCZkkOK7aaabkx++z/NEPvWG3oolwZwVx/KaPqM2R41XKHfkaW3VvHa6rzd4snQl
 LmHmUuMNE4JDw2zDSQ1uxSspMk+K7YKfEaNGxklf2ago9TzQIJOAjkveqs5kqw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 1e582227
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:43 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:11 +0200
Message-ID: <5bca06489688f23265bec3e96fb94412acd05b0f.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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:  From: Lilah Tascheter <lilah@HIDDEN> Might as well,
 to help ease the transition. * etc/teams.scm (bootloaders): New team. (Lilah
 Tascheter): Create and add to above. 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> Might as well,
    to help ease the transition. * etc/teams.scm (bootloaders): New team. (Lilah
    Tascheter): Create and add to above. 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

Might as well, to help ease the transition.

* etc/teams.scm (bootloaders): New team.
(Lilah Tascheter): Create and add to above.

Change-Id: I63620f4e3151bb8e3d0bdf619fc70501af6397a0
---
 etc/teams.scm | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/etc/teams.scm b/etc/teams.scm
index 9239021b39..2150a7aad1 100755
--- a/etc/teams.scm
+++ b/etc/teams.scm
@@ -328,6 +328,12 @@ (define-team embedded
         #:scope (list "gnu/packages/bootloaders.scm"
                       "gnu/packages/firmware.scm")))
 
+(define-team bootloaders
+  (team 'bootloaders
+        #:name "Bootloaders"
+        #:scope (list "gnu/bootloader.scm"
+                      (make-regexp* "^gnu/bootloader/"))))
+
 (define-team rust
   (team 'rust
         #:name "Rust"
@@ -749,6 +755,10 @@ (define-member (person "André Batista"
                        "nandre@HIDDEN")
   mozilla)
 
+(define-member (person "Lilah Tascheter"
+                       "lilah@HIDDEN")
+  bootloaders)
+
 
 (define (find-team name)
   (or (hash-ref %teams (string->symbol name))
-- 
2.45.2





Message sent to pelzflorian@HIDDEN, lilah@HIDDEN, ludo@HIDDEN, maxim.cournoyer@HIDDEN, guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH v3 12/14] gnu: bootloader: Install any bootloader to ESP.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: pelzflorian@HIDDEN, lilah@HIDDEN, ludo@HIDDEN, maxim.cournoyer@HIDDEN, guix-patches@HIDDEN
Resent-Date: Thu, 26 Sep 2024 10:12:08 +0000
Resent-Message-ID: <handler.73202.B73202.172734551213352 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Florian Pelz <pelzflorian@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
X-Debbugs-Original-Xcc: Florian Pelz <pelzflorian@HIDDEN>, Lilah Tascheter <lilah@HIDDEN>, Ludovic =?UTF-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172734551213352
          (code B ref 73202); Thu, 26 Sep 2024 10:12:08 +0000
Received: (at 73202) by debbugs.gnu.org; 26 Sep 2024 10:11:52 +0000
Received: from localhost ([127.0.0.1]:55510 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1stlTS-0003TA-U5
	for submit <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:52 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:53171
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1stlT2-0003PN-0w
 for 73202 <at> debbugs.gnu.org; Thu, 26 Sep 2024 06:11:27 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727345442;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=csNazSvP3ae1xauuntLPk/lAGEr/O6mK3d5r2OhmmqI=;
 b=mAYY/1tynbY055e7KTID/PFS3KFYw1pgTvt15TdrKa1APm4v9iSBlOS7k85oREvCydM8YR
 2MUTYDFfZ4bwwwggT/hlXAJy0SbSTXtrxLJoahRoqhzn6yggISENFkDAKHDSD/JCjoguLR
 Z/9PivdlCbHbT8tPhDUb8g4mbzuygQ0a4RWMzGFUG3yOGmVuFBRKq9yZ/9lcOBvoZWgUFf
 uixYWdKKoOcGD5IB5jdy8S8WaOV+5Y6oDn6+y7mrpBzyrk4HQ720L0CnP3SubKTE5wt2Y7
 2IHnWKPnVsk+W6sonbW2bY7SVVu3x0YA1MVZh8W1P8pkhE/aUJiSlmX5GWKLog==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id d85f1347
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 26 Sep 2024 10:10:42 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
Date: Thu, 26 Sep 2024 12:09:09 +0200
Message-ID: <e5a67b99cf8792af7870903e8517bc42b60c9528.1727345067.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
References: <74c789e74594d538308d33633ed8540283dcde49.1727345067.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.6 (+++)
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: From: Lilah Tascheter <lilah@HIDDEN> *
 gnu/bootloader.scm
 (efi-arch, install-efi): New procedures. (%efi-supported-systems,
 lazy-efibootmgr):
 New variables. (bootloader-configuration)[efi-removable?, 32bit?]: New fields.
 (match-bootloade [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
 The query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
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: 2.5 (++)
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:  From: Lilah Tascheter <lilah@HIDDEN> * gnu/bootloader.scm
    (efi-arch, install-efi): New procedures. (%efi-supported-systems, lazy-efibootmgr):
    New variables. (bootloader-configuration)[efi-removable?, 32bit?]: New fields.
    (match-bootloade [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE:
                             The query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Lilah Tascheter <lilah@HIDDEN>

* gnu/bootloader.scm (efi-arch, install-efi): New procedures.
(%efi-supported-systems, lazy-efibootmgr): New variables.
(bootloader-configuration)[efi-removable?, 32bit?]: New fields.
(match-bootloader-configuration, match-menu-entry): New macros.
* gnu/build/bootloader.scm (install-efi-loader): Delete procedure.
(install-efi): Rewrite to support installation of any efi bootloader.
* gnu/build/image.scm (initialize-efi32-partition): Deprecate.
(initialize-efi-partitition): Only create EFI directory.
* gnu/image.scm (partition)[target]: New field in order to support
dynamic provision of image partitions as bootloader targets.
* gnu/system/image.scm (root-partition, esp-partition): Use target
field.
* gnu/system/image.scm (esp32-partition, efi32-disk-partition,
efi32-raw-image-type): Deprecate.
* doc/guix.texi (Creating System Images)[image Reference]<partition
Reference>: Add target field.
[Instantiate an Image]: Update examples and update formatting.
<efi32-disk-image, efi32-raw-image-type>: Delete.
<pinebook-pro-image-type, rock64-image-type>: Reword slightly.

Change-Id: I3654d160f7306bb45a78b82ea6b249ff4281f739
---
 doc/guix.texi            |  34 ++++++------
 gnu/bootloader.scm       |  56 ++++++++++++++++++-
 gnu/build/bootloader.scm | 115 ++++++++++++++++++++-------------------
 gnu/build/image.scm      |  23 ++------
 gnu/image.scm            |   4 ++
 gnu/system/image.scm     |  22 +++-----
 6 files changed, 150 insertions(+), 104 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 38a4650977..2f6d72f793 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -130,6 +130,7 @@
 Copyright @copyright{} 2024 Dariqq@*
 Copyright @copyright{} 2024 Denis 'GNUtoo' Carikli@*
 Copyright @copyright{} 2024 Fabio Natali@*
+Copyright @copyright{} 2024 Lilah Tascheter@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -48163,6 +48164,12 @@ partition Reference
 this flag set, usually the root one. The @code{'esp} flag identifies a
 UEFI System Partition.
 
+@item @code{target} (default: @var{#f})
+If provided, this partition provides itself as a bootloader target
+(@pxref{Bootloader Configuration}).  Most commonly, this is used to provide the
+@code{'root} and @code{'esp} targets, with the root partition and EFI System
+Partition, respectively, though this can provide any target necessary.
+
 @item @code{initializer} (default: @code{#false})
 The partition initializer procedure as a gexp.  This procedure is called
 to populate a partition.  If no initializer is passed, the
@@ -48211,6 +48218,7 @@ Instantiate an Image
     (label "GNU-ESP")
     (file-system "vfat")
     (flags '(esp))
+    (target 'esp)
     (initializer (gexp initialize-efi-partition)))
    (partition
     (size (* 50 MiB))
@@ -48227,15 +48235,17 @@ Instantiate an Image
     (label root-label)
     (file-system "ext4")
     (flags '(boot))
+    (target 'root)
     (initializer (gexp initialize-root-partition))))))
 @end lisp
 
-Note that the first and third partitions use generic initializers
-procedures, initialize-efi-partition and initialize-root-partition
-respectively.  The initialize-efi-partition installs a GRUB EFI loader
-that is loading the GRUB bootloader located in the root partition.  The
-initialize-root-partition instantiates a complete system as defined by
-the @code{%simple-os} operating-system.
+Note that the first and third partitions use generic initializer
+procedures, @code{initialize-efi-partition} and
+@code{initialize-root-partition} respectively.
+@code{initialize-efi-partition} simply creates the directory structure
+for an EFI bootloader to install itself to.
+@code{initialize-root-partition} instantiates a complete system as
+defined by the @code{%simple-os} operating-system.
 
 You can now run:
 
@@ -48292,10 +48302,6 @@ Instantiate an Image
 @code{i686} machines, supporting BIOS or UEFI booting.
 @end defvar
 
-@defvar efi32-disk-image
-Same as @code{efi-disk-image} but with a 32 bits EFI partition.
-@end defvar
-
 @defvar iso9660-image
 An ISO-9660 image composed of a single bootable partition.  This image
 can also be used on most @code{x86_64} and @code{i686} machines.
@@ -48386,10 +48392,6 @@ image-type Reference
 Build an image based on the @code{efi-disk-image} image.
 @end defvar
 
-@defvar efi32-raw-image-type
-Build an image based on the @code{efi32-disk-image} image.
-@end defvar
-
 @defvar qcow2-image-type
 Build an image based on the @code{mbr-disk-image} image but with the
 @code{compressed-qcow2} image format.
@@ -48417,14 +48419,14 @@ image-type Reference
 @defvar pinebook-pro-image-type
 Build an image that is targeting the Pinebook Pro machine.  The MBR
 image contains a single partition starting at a @code{9MiB} offset.  The
-@code{u-boot-pinebook-pro-rk3399-bootloader} bootloader will be
+@code{u-boot-pinebook-pro-rk3399-bootloader} bootloader can be
 installed in this gap.
 @end defvar
 
 @defvar rock64-image-type
 Build an image that is targeting the Rock64 machine.  The MBR image
 contains a single partition starting at a @code{16MiB} offset.  The
-@code{u-boot-rock64-rk3328-bootloader} bootloader will be installed in
+@code{u-boot-rock64-rk3328-bootloader} bootloader can be installed in
 this gap.
 @end defvar
 
diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index f1352122a9..6b08e61492 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -100,6 +100,8 @@ (define-module (gnu bootloader)
             bootloader-configuration-targets
             bootloader-configuration-menu-entries
             bootloader-configuration-default-entry
+            bootloader-configuration-efi-removable?
+            bootloader-configuration-32bit?
             bootloader-configuration-timeout
             bootloader-configuration-keyboard-layout
             bootloader-configuration-theme
@@ -113,6 +115,9 @@ (define-module (gnu bootloader)
             bootloader-configuration->gexp
             bootloader-configurations->gexp
 
+            %efi-supported-systems
+            efi-arch
+            install-efi
             efi-bootloader-chain))
 
 
@@ -502,6 +507,10 @@ (define-record-type* <bootloader-configuration>
                          (default '()))   ;list of <menu-entry>
   (default-entry         bootloader-configuration-default-entry
                          (default 0))     ;integer
+  (efi-removable?        bootloader-configuration-efi-removable?
+                         (default #f))    ;bool
+  (32bit?                bootloader-configuration-32bit?
+                         (default #f))    ;bool
   (timeout               bootloader-configuration-timeout
                          (default 5))     ;seconds as integer
   (keyboard-layout       bootloader-configuration-keyboard-layout
@@ -635,9 +644,54 @@ (define (bootloader-configurations->gexp bootloader-configs . rest)
 
 
 ;;;
-;;; Bootloaders.
+;;; Bootloader installation to ESP.
 ;;;
 
+;; systems currently supported by efi-arch. should be used for packages relying
+;; on it.
+(define %efi-supported-systems
+  '("i686-linux" "x86_64-linux" "armhf-linux" "aarch64-linux" "riscv64-linux"))
+
+(define* (efi-arch #:key (target (or (%current-target-system) (%current-system)))
+                         (32? #f))
+  "Returns the UEFI architecture name for the current target, in lowercase."
+  (cond ((target-x86-32? target)  "ia32")
+        ((target-x86-64? target)  (if 32? "ia32" "x64"))
+        ((target-arm32? target)   "arm")
+        ((target-aarch64? target) (if 32? "arm" "aa64"))
+        ((target-riscv64? target) (if 32? "riscv32" "riscv64"))
+        (else (raise (formatted-message (G_ "no UEFI standard arch for ~a!")
+                                        target)))))
+
+(define (lazy-efibootmgr)
+  "Lazy-loaded efibootmgr package, in order to prevent circular refs."
+  (module-ref (resolve-interface '(gnu packages linux)) 'efibootmgr))
+
+(define (install-efi bootloader-config plan)
+  "Returns a gexp installing PLAN to the ESP, as denoted by the 'vendir target.
+PLAN is a gexp of a list of '(BUILDER DEST-BASENAME . LABEL) triples, that
+should be in boot order.  If the user selects a removable bootloader, only the
+first entry in PLAN is used."
+  (match-record bootloader-config <bootloader-configuration>
+    (targets efi-removable? 32bit?)
+    (if efi-removable?
+      ;; Hard code the output location to a well-known path recognized by
+      ;; compliant firmware.  See "3.5.1.1 Removable Media Boot Behaviour":
+      ;; http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf
+      (with-targets targets
+        (('esp => (path :path))
+         #~(let ((boot #$(string-append path "/EFI/BOOT"))
+                 (arch #$(string-upcase (efi-arch #:32? 32bit?)))
+                 (builder (car (car #$plan))))
+             (mkdir-p boot)
+             ;; Only realize the first planspec.
+             (builder (string-append boot "/BOOT" arch ".EFI")))))
+      ;; Install normally if not configured as removable.
+      (with-targets targets
+        (('vendir => (vendir :path) (loader :devpath) (disk :device))
+         #~(install-efi #+(file-append (lazy-efibootmgr) "/sbin/efibootmgr")
+                        #$vendir #$loader #$disk #$plan))))))
+
 (define (efi-bootloader-profile packages files hooks)
   "Creates a profile from the lists of PACKAGES and FILES from the store.
 This profile is meant to be used by the bootloader-installer.
diff --git a/gnu/build/bootloader.scm b/gnu/build/bootloader.scm
index 3934e03aee..064466bd33 100644
--- a/gnu/build/bootloader.scm
+++ b/gnu/build/bootloader.scm
@@ -23,8 +23,6 @@
 (define-module (gnu build bootloader)
   #:autoload   (guix build syscalls) (free-disk-space)
   #:use-module (guix build utils)
-  #:use-module (guix utils)
-  #:use-module (ice-9 binary-ports)
   #:use-module (guix diagnostics)
   #:use-module (guix i18n)
   #:use-module (ice-9 format)
@@ -40,7 +38,7 @@ (define-module (gnu build bootloader)
   #:export (atomic-copy
             in-temporary-directory
             write-file-on-device
-            install-efi-loader))
+            install-efi))
 
 
 ;;;
@@ -102,57 +100,62 @@ (define (efi-bootnums efibootmgr)
                            (bootnum (match:substring match 1)))
                       (cons (cons path bootnum) acc))))))
 
-(define* (install-efi grub grub-config esp #:key targets)
-  "Write a self-contained GRUB EFI loader to the mounted ESP using
-GRUB-CONFIG.
-
-If TARGETS is set, use its car as the GRUB image format and its cdr as
-the output filename.  Otherwise, use defaults for the host platform."
-  (let* ((system %host-type)
-         ;; Hard code the output location to a well-known path recognized by
-         ;; compliant firmware. See "3.5.1.1 Removable Media Boot Behaviour":
-         ;; http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_6.pdf
-         (grub-mkstandalone (string-append grub "/bin/grub-mkstandalone"))
-         (efi-directory (string-append esp "/EFI/BOOT"))
-         ;; Map grub target names to boot file names.
-         (efi-targets (or targets
-                          (cond ((string-prefix? "x86_64" system)
-                                 '("x86_64-efi" . "BOOTX64.EFI"))
-                                ((string-prefix? "i686" system)
-                                 '("i386-efi" . "BOOTIA32.EFI"))
-                                ((string-prefix? "armhf" system)
-                                 '("arm-efi" . "BOOTARM.EFI"))
-                                ((string-prefix? "aarch64" system)
-                                 '("arm64-efi" . "BOOTAA64.EFI"))))))
-    ;; grub-mkstandalone requires a TMPDIR to prepare the firmware image.
-    (setenv "TMPDIR" esp)
-
-    (mkdir-p efi-directory)
-    (invoke grub-mkstandalone "-O" (car efi-targets)
-            "-o" (string-append efi-directory "/"
-                                (cdr efi-targets))
-            ;; Graft the configuration file onto the image.
-            (string-append "boot/grub/grub.cfg=" grub-config))))
-
-(define* (install-efi-loader grub-efi esp #:key targets)
-  "Install in ESP directory the given GRUB-EFI bootloader.  Configure it to
-load the Grub bootloader located in the 'Guix_image' root partition.
-
-If TARGETS is set, use its car as the GRUB image format and its cdr as
-the output filename.  Otherwise, use defaults for the host platform."
-  (let ((grub-config "grub.cfg"))
-    (call-with-output-file grub-config
-      (lambda (port)
-        ;; Create a tiny configuration file telling the embedded grub where to
-        ;; load the real thing.  XXX This is quite fragile, and can prevent
-        ;; the image from booting when there's more than one volume with this
-        ;; label present.  Reproducible almost-UUIDs could reduce the risk
-        ;; (not eliminate it).
-        (format port
-                "insmod part_msdos~@
-               insmod part_gpt~@
-               search --set=root --label Guix_image~@
-               configfile /boot/grub/grub.cfg~%")))
-    (install-efi grub-efi grub-config esp #:targets targets)
-    (delete-file grub-config)))
+(define (install-efi efibootmgr vendir loader* disk plan)
+  "See also install-efi in (gnu bootloader)."
+  (let* ((loader (string-map (match-lambda (#\/ #\\) (x x)) loader*))
+         (bootnums (filter (compose (cut string-prefix? loader <>) car)
+                     (efi-bootnums efibootmgr)))
+         (plan-files (map cadr plan)))
+    (define (size file) (if (file-exists? file) (stat:size (stat file)) 0))
+    (define (vendirof file) (string-append vendir "/" file))
+    (define (loaderof file) (string-append loader "\\" file))
+    (define (delete-boot num file)
+      (invoke efibootmgr "--quiet" "--bootnum" num "--delete-bootnum")
+      (when (file-exists? file) (delete-file file)))
 
+    (mkdir-p vendir)
+    ;; Delete old entries first, to clear up space.
+    (for-each (lambda (spec) ; '(path . bootnum)
+                (let* ((s (substring (car spec) (string-length loader)))
+                       (file (substring s (if (string-prefix? "\\" s) 1 0))))
+                  (unless (member file plan-files)
+                    (delete-boot (cdr spec) (vendirof file)))))
+      bootnums)
+    ;; New and updated entries.
+    (in-temporary-directory
+      (for-each
+        (lambda (spec)
+          (let* ((builder (car spec)) (name (cadr spec))
+                 (dest (vendirof name)) (loadest (loaderof name))
+                 (rest (reverse (cdr (member name plan-files)))))
+            ;; Build to a temporary file so we can check its size.
+            (builder name)
+            ;; Disk space is usually limited on ESPs.
+            ;; Try to clear space as we install new bootloaders.
+            (if (while (> (- (size name) (size dest)) (free-disk-space vendir))
+                  (let ((del (find (compose file-exists? vendirof) rest)))
+                    (if del (delete-file (vendirof del)) (break #t))))
+                (begin
+                  (and=> (assoc-ref bootnums loadest) (cut delete-boot <> dest))
+                  (warning (G_ "ESP too small for bootloader ~a!~%") name))
+                ;; The ESP is too small for atomic copy.
+                (begin
+                  (copy-file name dest)
+                  (unless (assoc loadest bootnums)
+                    (invoke
+                      efibootmgr "--quiet" "--create-only" "--label"
+                      (cddr spec) "--disk" disk "--loader" loadest))))
+            (delete-file name)))
+        plan))
+    ;; Verify that at least the first entry was installed.
+    (unless (file-exists? (vendirof (cadr (car plan))))
+      ;; Extremely fatal error so we use leave instead of raise.
+      (leave (G_ "not enough space in ESP to install bootloader!
+ SYSTEM WILL NOT BOOT UNLESS THIS IS FIXED!~%")))
+    ;; Some UEFI systems will refuse to acknowledge the existence of boot
+    ;; entries unless they're in bootorder, so just shove everything in there.
+    (invoke
+      efibootmgr "--quiet" "--bootorder"
+      ;; Recall efi-bootnums to get a fresh list with new installs.
+      (let ((num (cute assoc-ref (efi-bootnums efibootmgr) <>))) ; cute is eager
+        (string-join (filter-map (compose num loaderof) plan-files) ",")))))
diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index 6ca0a428e0..1b2d4da814 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -8,6 +8,7 @@
 ;;; Copyright © 2022 Pavel Shlyak <p.shlyak@HIDDEN>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@HIDDEN>
 ;;; Copyright © 2023 Efraim Flashner <efraim@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -28,6 +29,7 @@ (define-module (gnu build image)
   #:use-module (guix build store-copy)
   #:use-module (guix build syscalls)
   #:use-module (guix build utils)
+  #:use-module (guix deprecation)
   #:use-module (guix store database)
   #:use-module (guix utils)
   #:use-module (gnu build bootloader)
@@ -181,23 +183,10 @@ (define* (register-closure prefix closure
                        #:prefix prefix
                        #:registration-time %epoch)))))
 
-(define* (initialize-efi-partition root
-                                   #:key
-                                   grub-efi
-                                   #:allow-other-keys)
-  "Install in ROOT directory, an EFI loader using GRUB-EFI."
-  (install-efi-loader grub-efi root))
-
-(define* (initialize-efi32-partition root
-                                     #:key
-                                     grub-efi32
-                                     #: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")))))
+(define (initialize-efi-partition root . rest)
+  (mkdir-p (string-append root "/EFI")))
+
+(define-deprecated/alias initialize-efi32-partition initialize-efi-partition)
 
 (define* (initialize-root-partition root
                                     #:key
diff --git a/gnu/image.scm b/gnu/image.scm
index 7fb06dec10..c6cc264147 100644
--- a/gnu/image.scm
+++ b/gnu/image.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020, 2022 Mathieu Othacehe <othacehe@HIDDEN>
 ;;; Copyright © 2023 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -35,6 +36,7 @@ (define-module (gnu image)
             partition-label
             partition-uuid
             partition-flags
+            partition-target
             partition-initializer
 
             image
@@ -131,6 +133,8 @@ (define-record-type* <partition> partition make-partition
   (flags                partition-flags
                         (default '())  ;list of symbols
                         (sanitize validate-partition-flags))
+  (target               partition-target ; bootloader target type: symbol | #f
+                        (default #f))
   (initializer          partition-initializer
                         (default #false))) ;gexp | #false
 
diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index b0c96c60f0..8ac91800ad 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2022 Alex Griffin <a@HIDDEN>
 ;;; Copyright © 2023 Efraim Flashner <efraim@HIDDEN>
 ;;; Copyright © 2023 Oleg Pykhalov <go.wigust@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -23,6 +24,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu system image)
+  #:use-module (guix deprecation)
   #:use-module (guix diagnostics)
   #:use-module (guix discovery)
   #:use-module (guix gexp)
@@ -133,12 +135,10 @@ (define esp-partition
    ;; FAT-ness is based on file system size (16 in this case).
    (file-system "vfat")
    (flags '(esp))
-   (initializer (gexp initialize-efi-partition))))
+   (target 'esp)
+   (initializer #~initialize-efi-partition)))
 
-(define esp32-partition
-  (partition
-   (inherit esp-partition)
-   (initializer (gexp initialize-efi32-partition))))
+(define-deprecated/alias esp32-partition esp-partition)
 
 (define root-partition
   (partition
@@ -149,6 +149,7 @@ (define root-partition
    ;; with U-Boot.
    (file-system-options (list "-O" "^metadata_csum,^64bit"))
    (flags '(boot))
+   (target 'root)
    (initializer (gexp initialize-root-partition))))
 
 (define mbr-disk-image
@@ -173,11 +174,7 @@ (define efi-disk-image
    (partition-table-type 'gpt)
    (partitions (list esp-partition root-partition))))
 
-(define efi32-disk-image
-  (image-without-os
-   (format 'disk-image)
-   (partition-table-type 'gpt)
-   (partitions (list esp32-partition root-partition))))
+(define-deprecated/alias efi32-disk-image efi-disk-image)
 
 (define iso9660-image
   (image-without-os
@@ -238,10 +235,7 @@ (define efi-raw-image-type
    (name 'efi-raw)
    (constructor (cut image-with-os efi-disk-image <>))))
 
-(define efi32-raw-image-type
-  (image-type
-   (name 'efi32-raw)
-   (constructor (cut image-with-os efi32-disk-image <>))))
+(define-deprecated/alias efi32-raw-image-type efi-raw-image-type)
 
 (define qcow2-image-type
   (image-type
-- 
2.45.2





Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite.
References: <20240912165818.21580-1-herman@HIDDEN>
In-Reply-To: <20240912165818.21580-1-herman@HIDDEN>
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Thu, 03 Oct 2024 20:37:01 +0000
Resent-Message-ID: <handler.73202.B73202.17279877967947 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17279877967947
          (code B ref 73202); Thu, 03 Oct 2024 20:37:01 +0000
Received: (at 73202) by debbugs.gnu.org; 3 Oct 2024 20:36:36 +0000
Received: from localhost ([127.0.0.1]:33935 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1swSYt-000247-IM
	for submit <at> debbugs.gnu.org; Thu, 03 Oct 2024 16:36:35 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:39705
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1swSYr-00023o-9Y
 for 73202 <at> debbugs.gnu.org; Thu, 03 Oct 2024 16:36:34 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1727987591;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type;
 bh=Bo6OHCS3lFY5CYtOUSrzKkdVBBR+NJCM07Pxx4qPOIE=;
 b=XfcoUSxEDkQ0Dp8/1DeArTTjh3SSyjgj/YY+J/sJC9KDhMwbhLlhhWcOPV4ZF3Pd1q+Zwu
 QB4Ma8v/ZU4NC0xfQCBMc24rQAO9tpUIPOMUrSqvg+W4PhRFS2MgbDqdD5qw5QrEbzyPZz
 qraYJnSRwNO3ZhbVKhYmPKlg6DDudHEoWSKsiz58nQ/3NMy8maK6o2oBdUcV+SpisKOi/W
 SXlzrAZk7YCBFCqkQzhqBDo7USBFEdbWvc2nQNrB+f6TU9acZoXbKMxcUZvQG7mWphwcHy
 qu2Z/Lvr9SYs5ymPW8d+BV+JZ3cFFC4p3KzyY1ryAx525SFN+uDAHO+aLfSTKw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id c39b7ece
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 3 Oct 2024 20:33:11 +0000 (UTC)
Date: Thu, 3 Oct 2024 22:32:30 +0200
From: Herman Rimm <herman@HIDDEN>
Message-ID: <4fnudiucjxequd3m4ayy7drqsgjokybfvsu6l2tbssurhlr5wd@odqr53qw5qqz>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Spam-Score: 3.6 (+++)
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:  Hi Lilah, I wrote a series of annotated Guile code snippets, 
 regarding an alternative implementation of bootloader-target, and example
 user configuration (with tftp/NFS). See below, and please let me know what
 [...] Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-accredit.habeas.com]
 -0.0 SPF_PASS               SPF: sender matches SPF record
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: 2.6 (++)
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:  Hi Lilah, I wrote a series of annotated Guile code snippets,
    regarding an alternative implementation of bootloader-target, and example
    user configuration (with tftp/NFS). See below, and please let me know what
    [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Hi Lilah,

I wrote a series of annotated Guile code snippets, regarding an
alternative implementation of bootloader-target, and example user
configuration (with tftp/NFS).  See below, and please let me know what
you think.

Cheers,
Herman

;; In (gnu bootloader grub):
(define (grub-efi-default-targets esp)
  (tree->target ; like arborify
                (bootloader-target
                  (type 'esp)
                  (path esp)
                  (targets ; counterpart of offset
                           (list (bootloader-target
                                   (type 'vendir)
                                   (path "EFI/Guix"))
                                 (bootloader-target
                                   (type 'install)
                                   (path "grub")))))))

;; This is the same as (grub-efi-default-targets "boot").  It could be
;; exported standalone, instead of using bootloader default-targets.
(define %grub-efi-default-targets
  '((esp     . "/boot")
    (install . "/boot/EFI/Guix")
    (vendir  . "/boot/grub")))

;; A simple consequence of this change is that this:
(with-targets %grub-efi-default-targets
  (('install => (path :path))
   ...))
;; becomes:
(let ((install-path (assoc-ref %grub-efi-default-targets 'install)))
  ...)

;; But e.g. device is provided separately (or derived from path):
(with-targets %grub-efi-default-targets
  (('esp => (device :device))
   ...))
;; becomes:
(let* ((path (assoc-ref %grub-efi-default-targets 'esp))
       ;; A single root-device is provided in addition to targets.
       (device (root-device->block-device root-device path)))
  ...)

;; This procedure is in (gnu bootloader).  Something like:
(define (root-device->block-device device path)
  (match device
    ((? block-device?) device) ; string with /dev/ prefix
    ((? uuid?) (find-partition-for-uuid device))
    ((? string?) (find-partition-for-label device))
    ;; This might be necessary, but should not be relied on.
    (_ (mount-source (find-mount path)))))

;; Example user configuration:
(define %grub-efi-bootloader
  (bootloader-configuration
    (bootloader grub-efi-bootloader)
    ;; This is for bootloader configuration (not installation), e.g.
    ;; GRUB search or install-efi disk argument.
    (root-device "UUID, label, or block device.")
    ;; This is complementary to root-device.  It will configure some
    ;; files to be fetched remotely instead of installed.
    (tftp "Varies for UEFI/GRUB/U-Boot.")))

(operating-system
  (bootloader (list %grub-efi-bootloader))
  ;; This is shared between bootloaders.  Ideally, it does not affect
  ;; which files are installed or their contents, but only the location.
  (bootloader-targets (grub-efi-default-targets "boot")))




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite.
Resent-From: Lilah Tascheter <lilah@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 04 Oct 2024 05:08:02 +0000
Resent-Message-ID: <handler.73202.B73202.172801845016641 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Herman Rimm <herman@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172801845016641
          (code B ref 73202); Fri, 04 Oct 2024 05:08:02 +0000
Received: (at 73202) by debbugs.gnu.org; 4 Oct 2024 05:07:30 +0000
Received: from localhost ([127.0.0.1]:34238 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1swaXJ-0004KK-GN
	for submit <at> debbugs.gnu.org; Fri, 04 Oct 2024 01:07:29 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:35780)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1swaXH-0004K7-Fx
 for 73202 <at> debbugs.gnu.org; Fri, 04 Oct 2024 01:07:28 -0400
DKIM-Signature: a=rsa-sha256;
 b=ie+eT7ZZYw2A9zzLl7eilYAHg0Y4XzJpTqZxE8a29VY4zLh3z8uTovaSSNqY83kKLxcvaVVKuGbb132WGlrepO/r+ks8nmdWbqiZ+FvNDEiQHUyavD0aEYPxyX/9eLCS1XAubRxRSc9yUv8l3ObBPOg/+ZsNsJ0dzVwClgZbarbQIrXJbpHkF4+P5ujlHhF7wdAtuJTMfutyYVsp7pB/CyYv+whqcKj0XojrDzz/2FhFC5rMUmzDfVYAGFgmfIYaD1AfH/wsQpVLPyX7eSKs5zHN2AMwVNVpiBUKEDqeyNw6xxpb9a9vsZpltBD7pw5BNHIL1NUI8OG9DQybbScX5A==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=xMC9hbmPJ+rFWRfUUjNd1c9n1aujQBlyu1713pExJ0E=;
 h=Received:Subject:From:To:Date; 
DKIM-Signature: a=rsa-sha256;
 b=jiuCeF/1QfAJ3yaA5i1/pNA1BnmsdxJrBLr7KSp8prKjfCD9tCwjOIzzz/E2yS8BSGxdUVBd+Mx1Zl/jIwqLrMLlvBox79Jp5idnauXylE5i1GbZwTTIOpUwyphnMk0vd+LPv0RxqVQai38HqyVT/k4kt4iL/4VxbsB+NQ+GaB+H2sYrGevhXceKjhHnS6vBc1aJ7BSU5dzJHT9exoNrtyifgXo/DLAGzmC4NkAYS0Yz07NhKIQrcDJVafBqRjE9W6C9hbQNk5ieEZdl9FMEXtD33TpnPn3VAcy3b7E6+7YOIRdZSjd2M7qwp1TvK6zKgcyU7Fw9vGGuNIleS7BU8g==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=xMC9hbmPJ+rFWRfUUjNd1c9n1aujQBlyu1713pExJ0E=;
 h=Feedback-ID:Received:Subject:From:To:Date; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 73202 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 404818011; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 04 Oct 2024 05:07:17 +0000 (UTC)
Message-ID: <bf58219d6ebb940af92cbbc4f8a735b873a88964.camel@HIDDEN>
From: Lilah Tascheter <lilah@HIDDEN>
Date: Fri, 04 Oct 2024 00:07:16 -0500
In-Reply-To: <4fnudiucjxequd3m4ayy7drqsgjokybfvsu6l2tbssurhlr5wd@odqr53qw5qqz>
References: <4fnudiucjxequd3m4ayy7drqsgjokybfvsu6l2tbssurhlr5wd@odqr53qw5qqz>
Organization: Dissociation for Heresiographal Computation
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 
MIME-Version: 1.0
X-Spam-Score: 0.0 (/)
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 (-)

hey herman!

> ;; In (gnu bootloader grub):
> (define (grub-efi-default-targets esp)
> =C2=A0 (tree->target ; like arborify
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 (bootloader-target
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (type 'esp)
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (path esp)
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (targets ; counterpart of offset
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 (list (bootloader-target
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (type 'vendir)
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (path "EFI/Guix")=
)
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (bootloader-target
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (type 'install)
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (path "grub")))))=
))
how would this handle root offsets, eg by guix system init? is
everything assumed to be offset from root? I'm also worried about
indentation growing too quickly. otherwise, though, it's definately an
improvement over offset!

> ;; This is the same as (grub-efi-default-targets "boot").=C2=A0 It could
> be
> ;; exported standalone, instead of using bootloader default-targets.
> (define %grub-efi-default-targets
> =C2=A0 '((esp=C2=A0=C2=A0=C2=A0=C2=A0 . "/boot")
> =C2=A0=C2=A0=C2=A0 (install . "/boot/EFI/Guix")
> =C2=A0=C2=A0=C2=A0 (vendir=C2=A0 . "/boot/grub")))
>=20
> ;; A simple consequence of this change is that this:
> (with-targets %grub-efi-default-targets
> =C2=A0 (('install =3D> (path :path))
> =C2=A0=C2=A0 ...))
> ;; becomes:
> (let ((install-path (assoc-ref %grub-efi-default-targets 'install)))
> =C2=A0 ...)
>=20
> ;; But e.g. device is provided separately (or derived from path):
> (with-targets %grub-efi-default-targets
> =C2=A0 (('esp =3D> (device :device))
> =C2=A0=C2=A0 ...))
> ;; becomes:
> (let* ((path (assoc-ref %grub-efi-default-targets 'esp))
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; A single root-device is provided =
in addition to targets.
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (device (root-device->block-device r=
oot-device path)))
> =C2=A0 ...)
>=20
> ;; This procedure is in (gnu bootloader).=C2=A0 Something like:
> (define (root-device->block-device device path)
> =C2=A0 (match device
> =C2=A0=C2=A0=C2=A0 ((? block-device?) device) ; string with /dev/ prefix
> =C2=A0=C2=A0=C2=A0 ((? uuid?) (find-partition-for-uuid device))
> =C2=A0=C2=A0=C2=A0 ((? string?) (find-partition-for-label device))
> =C2=A0=C2=A0=C2=A0 ;; This might be necessary, but should not be relied o=
n.
> =C2=A0=C2=A0=C2=A0 (_ (mount-source (find-mount path)))))
how are you replacing device-local paths? some bootloaders need that
information to access files before fully loading. also, if the path,
device, label, and uuid fields are combined, the guix system image
won't be able to get all the info it needs to the bootloader
installers. uuid or label needs to be there to identify the device on-
boot, but also path, device, and devpath are required to actually
install bootloader files.

also, one reason with-targets exists is as a safeguard for future
people writing bootloaders. guix system image tends to be overlooked,
so it performs checks to make sure the bootloader targets requested are
available during image generation.


> ;; Example user configuration:
> (define %grub-efi-bootloader
> =C2=A0 (bootloader-configuration
> =C2=A0=C2=A0=C2=A0 (bootloader grub-efi-bootloader)
> =C2=A0=C2=A0=C2=A0 ;; This is for bootloader configuration (not installat=
ion), e.g.
> =C2=A0=C2=A0=C2=A0 ;; GRUB search or install-efi disk argument.
> =C2=A0=C2=A0=C2=A0 (root-device "UUID, label, or block device.")
> =C2=A0=C2=A0=C2=A0 ;; This is complementary to root-device.=C2=A0 It will=
 configure some
> =C2=A0=C2=A0=C2=A0 ;; files to be fetched remotely instead of installed.
> =C2=A0=C2=A0=C2=A0 (tftp "Varies for UEFI/GRUB/U-Boot.")))
>=20
> (operating-system
> =C2=A0 (bootloader (list %grub-efi-bootloader))
> =C2=A0 ;; This is shared between bootloaders.=C2=A0 Ideally, it does not =
affect
> =C2=A0 ;; which files are installed or their contents, but only the
> location.
> =C2=A0 (bootloader-targets (grub-efi-default-targets "boot")))
I do really like the conceptual separation between configuration and
installation! though, users would now need to enter the root device
details three times, potentially in inconsistant formats.

- lilah




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Fri, 04 Oct 2024 13:57:02 +0000
Resent-Message-ID: <handler.73202.B73202.172805018429574 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172805018429574
          (code B ref 73202); Fri, 04 Oct 2024 13:57:02 +0000
Received: (at 73202) by debbugs.gnu.org; 4 Oct 2024 13:56:24 +0000
Received: from localhost ([127.0.0.1]:36148 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1swinA-0007gw-17
	for submit <at> debbugs.gnu.org; Fri, 04 Oct 2024 09:56:24 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:36009
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1swin7-0007go-FY
 for 73202 <at> debbugs.gnu.org; Fri, 04 Oct 2024 09:56:22 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1728050169;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=i6fo2qRTNRAvvyejDkIGvUMNEHovvWnVaqXZP9vEcYw=;
 b=TK47hc+mME8jzZYy+r4URPhj10f1LKzz2LUbnEnI7eDeNHUQZD3WO1XEPWuNVLx8UnH18H
 DND/xruk0s5NLLmCg80DhG7j2ScQTlrTM9PXpTX1dNf7nL4foaWzXT480rOJqfSXXDVKBe
 cDSMPMWFt5pcjJ6Wl5aFpIViIPe+PAR8nKikY3PCmbaftycOykAGE/RguI5IKMXxJDiG2k
 Zzln1PT8ox6aPJlji4kGwoEug9OLZk136vizqHZck/Mg+8dmuL4gw5sgHapdCznIpkVxb5
 EoBGwYNgD8fzaRoWZvLKS34KtobJNUyhE+NF7IRwMmPxn7KbOAaqWeqgq2zfFw==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id d318c624
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 4 Oct 2024 13:56:09 +0000 (UTC)
Date: Fri, 4 Oct 2024 15:55:33 +0200
From: Herman Rimm <herman@HIDDEN>
Message-ID: <sgg7cef5h7fj7sl3ypvy3k77v6zoi2wsvn6zc2mloyvyntce5o@b3anleonz5hf>
References: <4fnudiucjxequd3m4ayy7drqsgjokybfvsu6l2tbssurhlr5wd@odqr53qw5qqz>
 <bf58219d6ebb940af92cbbc4f8a735b873a88964.camel@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <bf58219d6ebb940af92cbbc4f8a735b873a88964.camel@HIDDEN>
X-Spam-Score: 3.6 (+++)
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:  Hello, On Fri, Oct 04, 2024 at 12:07:16AM -0500,
 Lilah Tascheter
 wrote: > > (define (grub-efi-default-targets esp) > how would this handle
 root offsets, eg by guix system init? is > everything assumed to be [...]
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-trusted.bondedsender.org]
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
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: 2.6 (++)
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:  Hello, On Fri, Oct 04, 2024 at 12:07:16AM -0500, Lilah Tascheter
    wrote: > > (define (grub-efi-default-targets esp) > how would this handle
    root offsets, eg by guix system init? is > everything assumed to be [...]
    
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Hello,

On Fri, Oct 04, 2024 at 12:07:16AM -0500, Lilah Tascheter wrote:
> > (define (grub-efi-default-targets esp)
> how would this handle root offsets, eg by guix system init? is
> everything assumed to be offset from root?
For every (key . value) in targets, prefix value with root-offset.  Or
if the target tree is still available, extend it:

  (bootloader-target
    (type 'root)
    (path root-offset)
    (targets (list %target-tree)))

It works under the assumption that bootloader-target paths will not be
referenced in bootloader configuration files.  When that does not hold,
e.g. in the (make-)grub.cfg procedure, then I think either the target
paths (or tree) need to be unprefixed (or unwrapped); or the root should
be offset implicitly, i.e. doing the installation in a chroot.

> I'm also worried about indentation growing too quickly.
Do you have a use case in mind, with more than three levels of nesting?

> otherwise, though, it's definately an improvement over offset!
Thanks.  Using the assumption that Guix only works with UNIX file
systems and not DOS-derivatives or exotic data stores, it only allows
constructing a tree and not a forest or (cyclic) graph, respectively.

> how are you replacing device-local paths? some bootloaders need that
> information to access files before fully loading.
I guess when device-local paths are required, a targets tree should be
provided and queried using the with-targets macro.  They could also be 
cast from target paths, with a warning.

> also, if the path, device, label, and uuid fields are combined, the
> guix system image won't be able to get all the info it needs to the
> bootloader installers. uuid or label needs to be there to identify the
> device on-boot,
So I have tried combining the path field into the device field, but I'm
now in favor of using a target tree/paths field together with a combined
block device, file system label, or UUID field.  Here the assumption is
that any of the aformentioned types can be derived from any other, e.g.
with find-partition-by-uuid and read-partition-label.  If a bootloader
cannot use a provided type, or find other required types, it should
throw an error.  If you have a use case where both a block device and a
(potentially unrelated) UUID are configured, please let me know.

> but also path, device, and devpath are required to actually install
> bootloader files.
I think the device could be installation-agnostic and anything related
to installation could be a different bootloader, or a field like tftp.

> also, one reason with-targets exists is as a safeguard for future
> people writing bootloaders. guix system image tends to be overlooked,
> so it performs checks to make sure the bootloader targets requested
> are available during image generation.
What do you think about having required types per bootloader, and tests
for trees generated from image partitions in (gnu tests image) instead?

That reminds me: I would like to add a supported file systems field to
the bootloader, so that if the file system found for root-device is not
supported, it throws a little error.

> > (operating-system
> >  (bootloader (list %grub-efi-bootloader))
> >  ;; This is shared between bootloaders. Ideally, it does not affect
> >  ;; which files are installed or their contents, but only the
> > location.
> >  (bootloader-targets (grub-efi-default-targets "boot")))
> I do really like the conceptual separation between configuration and
> installation! though, users would now need to enter the root device
> details three times, potentially in inconsistant formats.
Thanks, I think the two examples below could work pretty well.

Cheers,
Herman

(define %boot-fs
  (file-system
    (device (uuid "E6A5-FEBB" 'fat32))
    (mount-point "/boot") ; Taken as ESP.
    ;; Cannot be used to configure e.g. GRUB netboot, but it would be
    ;; nice to assert (support? bootloader type) in fs->bootloader.
    (type "vfat")))
(operating-system 
  (bootloader ;; Procedure defined in (gnu system file-systems).
              (file-system->grub-efi-bootloader %boot-fs))
  ...)

;; bootloader->file-system would not work as well.  An OS field (macro)
;; to define both simultaneously at a high level could be useful though.
(operating-system
  (file-systems-with-bootloader
    ;; Irrelevant for file-systems.
    (bootloader grub-efi-bootloader)
    ;; Relevant as a file-system and bootloader installation.
  (boot-device "UUID, label, or block device.")
    (mount-point "/boot")
  (type "vfat")
    ;; Not relevant to bootloader.  Default values given.
    (root-file-system (mounted-root-fs)) ; Error if not found.
    ;; Cons the generated boot FS and mounted root FS to this.
    (file-systems %base-file-systems))
  ...)




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite.
Resent-From: Herman Rimm <herman@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 07 Oct 2024 19:25:01 +0000
Resent-Message-ID: <handler.73202.B73202.172832905327759 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah@HIDDEN>, Ryan <ryan_devel@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172832905327759
          (code B ref 73202); Mon, 07 Oct 2024 19:25:01 +0000
Received: (at 73202) by debbugs.gnu.org; 7 Oct 2024 19:24:13 +0000
Received: from localhost ([127.0.0.1]:48233 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sxtL2-0007De-S3
	for submit <at> debbugs.gnu.org; Mon, 07 Oct 2024 15:24:13 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:37393
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1sxtKz-0007DL-NX
 for 73202 <at> debbugs.gnu.org; Mon, 07 Oct 2024 15:24:11 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1728329028;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=VoCqwhg+r3+FnfNh7Z8ysFYif9fLc+9v+bq1huISaqw=;
 b=lGyWq4QBQWBSehcyFJVyLka6RVKJCGZibMvUT+7QkN/Twh+nOw/x1YKTEnIGK72pLpCxhK
 5xbH4wn3lWmQI07ClLNluB40bikAMzqgc2Bu9cQXZWmAzWft+yk0S1eN0AGbLRFNfHstUt
 3nwoQAq4aJe8Gd3E0Qo4r3Pn997Ze9sVg7ZibRJSeBy5scDz+3PLOXC5LSaQzai0PXUD1z
 W/2yp+7fmI+lajK7YgYyVyn2o8ELgJzc7KagnbOLOMHjxatZdUTAYDRt+D61dI1jpjSgQ7
 +PnMrMwwKqD+Yuzt3ZKo6LsdJBoO4mGpr6hc3vW1Lv1fMhhxaPwbx00mhz2Phg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 92b221d4
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Mon, 7 Oct 2024 19:23:48 +0000 (UTC)
Date: Mon, 7 Oct 2024 21:23:14 +0200
From: Herman Rimm <herman@HIDDEN>
Message-ID: <3dfiwbdyv2ymwuaeovbhluxm2ozng3iafs73bdw3dsqtnjzjy3@t2qdnxln5n2p>
References: <sgg7cef5h7fj7sl3ypvy3k77v6zoi2wsvn6zc2mloyvyntce5o@b3anleonz5hf>
 <D4PQFMVBOY9A.242RIPH57D7GV@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <D4PQFMVBOY9A.242RIPH57D7GV@HIDDEN>
X-Spam-Score: 3.6 (+++)
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:  Hello Ryan, On Mon, Oct 07, 2024 at 12:59:16PM -0400, Ryan
 wrote: > Right now, I have Guix master branch checked out @7e63a35f, and
 am under the > assumption that the order of patching should be as follows:
 69343 [...] 
 Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in sa-trusted.bondedsender.org]
 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
 query to Validity was blocked.  See
 https://knowledge.validity.com/hc/en-us/articles/20961730681243
 for more information.
 [81.205.150.117 listed in bl.score.senderscore.com]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
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: 2.6 (++)
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:  Hello Ryan, On Mon, Oct 07, 2024 at 12:59:16PM -0400, Ryan
    wrote: > Right now, I have Guix master branch checked out @7e63a35f, and
   am under the > assumption that the order of patching should be as follows:
    69343 [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                             [81.205.150.117 listed in sa-accredit.habeas.com]
  0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The
                             query to Validity was blocked.  See
                             https://knowledge.validity.com/hc/en-us/articles/20961730681243
                              for more information.
                            [81.205.150.117 listed in bl.score.senderscore.com]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Hello Ryan,

On Mon, Oct 07, 2024 at 12:59:16PM -0400, Ryan wrote:
> Right now, I have Guix master branch checked out @7e63a35f, and am under the
> assumption that the order of patching should be as follows: 69343->73202
> ->72457. Is this correct?
Almost, v6 of 72457 additionally requires v2 of 70131.

> I can apply 69343 cleanly, however trying to apply
> the latest patchsets for 73202 or 72457 fail immediately, complaining that
Yeah, applying 73202 after 69343 using 'mumi am' immediately returns:

  Applying: gnu: bootloader: Install any bootloader to ESP.
  error: patch failed: gnu/bootloader.scm:113
  error: gnu/bootloader.scm: patch does not apply
  error: patch failed: gnu/build/bootloader.scm:23
  error: gnu/build/bootloader.scm: patch does not apply
  Patch failed at 0001 gnu: bootloader: Install any bootloader to ESP.

Very strange because this is not [PATCH v3 01/14], but [PATCH v3 12/14].
Manually downloading the patches from [1] and applying them seems to
work, until again [PATCH v3 12/14].  Looking closer at the download of
it (34), it seems to actually be [PATCH v3 14/14]...  Besides that, your
message here does not appear on [1], or [2] for October 07.  Do you know
why that is?

But anyway, Lilah also had trouble applying v6 of 72457.  v7 of 72457
will be independent of 70131, and hopefully possible to apply.  For now,
you can get patches similar to those in 70131, 69343, 73202, 72457, and
68524 (UKI bootloader) from my git repository, by running:

git checkout 7e63a35f
git remote add herman https://codeberg.org/herman_rimm/guix.git
git fetch herman
git cherry-pick herman/lint-order..herman/uki-efi-bootloader-stable

Cheers,
Herman

[1]: https://issues.guix.gnu.org/73202
[2]: https://lists.gnu.org/archive/html/guix-patches/2024-10/index.html 




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite.
References: <20240912165818.21580-1-herman@HIDDEN>
Resent-From: "Ryan" <ryan_devel@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Mon, 07 Oct 2024 22:51:02 +0000
Resent-Message-ID: <handler.73202.B73202.17283414377386 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: <73202 <at> debbugs.gnu.org>
Cc: Lilah Tascheter <lilah@HIDDEN>, Herman Rimm <herman@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.17283414377386
          (code B ref 73202); Mon, 07 Oct 2024 22:51:02 +0000
Received: (at 73202) by debbugs.gnu.org; 7 Oct 2024 22:50:37 +0000
Received: from localhost ([127.0.0.1]:49308 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sxwYm-0001v3-5R
	for submit <at> debbugs.gnu.org; Mon, 07 Oct 2024 18:50:36 -0400
Received: from mail.rschanz.org ([5.161.207.21]:34780)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ryan_devel@HIDDEN>) id 1sxr4z-0007S6-7N
 for 73202 <at> debbugs.gnu.org; Mon, 07 Oct 2024 12:59:30 -0400
Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)
 with ESMTPSA id 86247271BEF; Mon,  7 Oct 2024 12:59:17 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rschanz.org; s=dkim;
 t=1728320360; h=from:subject:date:message-id:to:cc:mime-version:content-type:
 content-transfer-encoding:in-reply-to;
 bh=8gzxikX5rDwLfxPQwpKTg/ptpCxRg+IPJvssthDHvcI=;
 b=KYdhC2lnOI01PKpBnazkIKajFvrzijBjeTGBLYrt9/4vGjTKmYSRjkhHzxBNck6SUidJ6R
 3wvnsiXfk0YJYRa49CPQIUtkjlbV19j3oFOikOMjXbl+HmDJO2B6P0vz/6rBeo146XrIGa
 8fe4ZSEkEs/5TkjTJfsruVriftvQ7dzz1JvUq7qgzPrGczCrKVSOcQuqQczxjqoAz5O8t+
 kp5bLTVNzKoNxVz8SJNLGmvtB0gijkHpyx/G6zDpc4gRE61aFq7AQ3ekKbUVlNx1yfqWLU
 +RKMKXyakk+XyaS1Jz8rYxl7SpyUEL7fxNNLk5lx19AcL11iS3Hd8XXTObojww==
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8; format=Flowed
Date: Mon, 07 Oct 2024 12:59:16 -0400
Message-Id: <D4PQFMVBOY9A.242RIPH57D7GV@HIDDEN>
From: "Ryan" <ryan_devel@HIDDEN>
X-Mailer: aerc 0.17.0
In-Reply-To: <sgg7cef5h7fj7sl3ypvy3k77v6zoi2wsvn6zc2mloyvyntce5o@b3anleonz5hf>
X-Last-TLS-Session-Version: TLSv1.3
X-Spam-Score: 0.0 (/)
X-Mailman-Approved-At: Mon, 07 Oct 2024 18:50:34 -0400
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 (-)

Hi all, question about this entire patchset. I would like to do some testin=
g
and play around with this myself, but I cannot for the life of me figure ou=
t
how it's supposed to be patched on top of the main tree, if someone could
clarify.

Right now, I have Guix master branch checked out @7e63a35f, and am under th=
e
assumption that the order of patching should be as follows: 69343->73202
->72457. Is this correct? I can apply 69343 cleanly, however trying to appl=
y
the latest patchsets for 73202 or 72457 fail immediately, complaining that
either I cannot build fake ancestors (attempting a 3-way merge) or that var=
ious
files do not match the index. I'm assuming I am missing some more patchsets
somewhere, but am unsure which are dependent on one another.

Hoping for some clarification so I can get my local tree all patched and be=
gin
some testing (nothing too special, just want to set up UKIs on x86_64 but i=
t
could be some insight nonetheless!)

Thanks!

---=20
Best,
Ryan S




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite.
References: <20240912165818.21580-1-herman@HIDDEN>
Resent-From: "Ryan" <ryan_devel@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 08 Oct 2024 15:48:01 +0000
Resent-Message-ID: <handler.73202.B73202.172840243625251 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: <73202 <at> debbugs.gnu.org>
Cc: Lilah Tascheter <lilah@HIDDEN>, Herman Rimm <herman@HIDDEN>, Ryan <ryan_devel@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172840243625251
          (code B ref 73202); Tue, 08 Oct 2024 15:48:01 +0000
Received: (at 73202) by debbugs.gnu.org; 8 Oct 2024 15:47:16 +0000
Received: from localhost ([127.0.0.1]:54009 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1syCQc-0006ZC-Vb
	for submit <at> debbugs.gnu.org; Tue, 08 Oct 2024 11:47:15 -0400
Received: from mail.rschanz.org ([5.161.207.21]:34662)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ryan_devel@HIDDEN>) id 1syBLB-0002rW-38
 for 73202 <at> debbugs.gnu.org; Tue, 08 Oct 2024 10:37:34 -0400
Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon)
 with ESMTPSA id 7052A271AEA; Tue,  8 Oct 2024 10:37:21 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rschanz.org; s=dkim;
 t=1728398243; h=from:subject:date:message-id:to:cc:mime-version:content-type:
 content-transfer-encoding:in-reply-to;
 bh=g0Zy+BDmcsEJ0W1Vn+cSdteClqFZQjQWAFgju8Io1sY=;
 b=RBsN0dE5m1WGj99TMgz2xRRXeoFE2I60Pv3HgvGOvs4M0PtA7R0W8aObdQjDWIv/xhRem6
 n5dd33SC2CYOttd8mDyhGNIr436Hf62B0Lnz8YyM70DVzRnIf3uHHV/Cn/Z403N/EU7uYC
 TIC5JlmRuzCxipDQKVFWH3WieAVfAzek09+aqyd4xL5H6xB5eLhDLua6qLd3aHT7dfU7pQ
 N/GlG32889IRbu7PukE3egNlvvW5W7id1ingn/JLpQ0Aw3Jjoth2hj9uVbR3ZiExHeiAEC
 c6D3nfY15uGTUr+QGstqb1FfA8hsjZLcmKUo42Wv8tFz6pVTHtO2RK+1FgI05g==
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8; format=Flowed
Date: Tue, 08 Oct 2024 10:37:20 -0400
Message-Id: <D4QI1I2N5HOS.26ALTDNH2YQZ8@HIDDEN>
From: "Ryan" <ryan_devel@HIDDEN>
X-Mailer: aerc 0.17.0
In-Reply-To: <D4PQFMVBOY9A.242RIPH57D7GV@HIDDEN>
X-Last-TLS-Session-Version: TLSv1.3
X-Spam-Score: 0.0 (/)
X-Mailman-Approved-At: Tue, 08 Oct 2024 11:47:13 -0400
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 (-)

Hi Herman,

> On Mon, Oct 07, 2024 at 09:23:14PM +0200, Herman wrote:
> Very strange because this is not [PATCH v3 01/14], but [PATCH v3 12/14].
> Manually downloading the patches from [1] and applying them seems to
> work, until again [PATCH v3 12/14].  Looking closer at the download of
> it (34), it seems to actually be [PATCH v3 14/14]...  Besides that, your
> message here does not appear on [1], or [2] for October 07.  Do you know
> why that is?

Very odd, do you think this is a bug in mumi of some kind? I'm new to email
based git workflows, so I've been leaning a mumi for a lot of my setup. Did=
n't
even think to look if it was trying to apply patches in the correct order, =
I
just assumed it was and I was doing something wrong.

To your second point, I have the same question. My current theory is that I=
 am
new enough to the mailing lists that I have to go through some sort of appr=
oval
process before my emails appear in the actual list and subsequent mumi site=
,
but I have no proof of this, other than my posts historically taking many h=
ours
to actually appear. Maybe I am doing something wrong?

> But anyway, Lilah also had trouble applying v6 of 72457.  v7 of 72457
> will be independent of 70131, and hopefully possible to apply.  For now,
> you can get patches similar to those in 70131, 69343, 73202, 72457, and
> 68524 (UKI bootloader) from my git repository, by running:
>=20
> git checkout 7e63a35f
> git remote add herman https://codeberg.org/herman_rimm/guix.git
> git fetch herman
> git cherry-pick herman/lint-order..herman/uki-efi-bootloader-stable

Thanks for linking your tree (and adding the helpful instructions!) Glad to
report I cherry-picked the commits without any issues. I'll continue workin=
g
on my changes I am making to my system (that integrates these changes) and
report on the proper issues if I run into anything!

---=20
Best,
Ryan S




Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite.
Resent-From: Lilah Tascheter <lilah@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 08 Oct 2024 17:24:01 +0000
Resent-Message-ID: <handler.73202.B73202.172840821812076 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Herman Rimm <herman@HIDDEN>, Ryan <ryan_devel@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172840821812076
          (code B ref 73202); Tue, 08 Oct 2024 17:24:01 +0000
Received: (at 73202) by debbugs.gnu.org; 8 Oct 2024 17:23:38 +0000
Received: from localhost ([127.0.0.1]:54230 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1syDvt-00038h-Kr
	for submit <at> debbugs.gnu.org; Tue, 08 Oct 2024 13:23:37 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:45894)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1syDvq-00038Q-B7
 for 73202 <at> debbugs.gnu.org; Tue, 08 Oct 2024 13:23:35 -0400
DKIM-Signature: a=rsa-sha256;
 b=kQlvDThS90m5JvZ8FabsBsMFDfk34Yx8FZVluvQvdQW2vuHjMc/ctjevakJ2dibNXf2vlM1eJFweWYJzbhEmacsS00L6WA2RofD1b4KtOnVQAcK9dafSOcMA15wyePnn5nih5fX7Umt9nEpDTCipwdQxd9/lt/ykSPVkl+6EnF3BV6Cae9AursxG7dBm9crwgn2tcfsqikFmcwp3w47uxhxJCkU/86BFtD0TiJHZOWbdZS2XyfxiWTogz1LQgSLnFHc/JNZdlSp9kfaSzKiyewKz8Ww2PLEm8qHO+tpX1B2XpGMgAKEpFBvr6nTn6MgY9w3OZVlGV2t6k7R0WGCSZg==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=GSxzpgXsUwPMH9MGNbaTzjhV4vYjrECzJnqLsTTpVgU=;
 h=Received:Subject:From:To:Date; 
DKIM-Signature: a=rsa-sha256;
 b=fkqnP/iOTY81owFosBlWRQMbTsyKYnXE+QvYMr8Sn+xdvu2eEoMcvoPF9zajrSMCMWyVCMEDJAWOzbeXsrv1hXFi/vDgyy+eWI6wuN9v+y1KVwqmQApIAzMhLDVFunGLRDyXZfN32yogSDkV62M/VmvuToTXfAj8nazP+HPbJGZobxxFRSinxmpUov3MLzyNnKnQBjsZK3SecPsjxVQbbiPzjcJ51HSCqeDQNe6SA6g8ZE3Hu2E3PvRMmA8uk4ODQ48y5psySKQ8BUqZRamIFxBi7d+5LLj9EpOmmSp9gcJ4eiGrVLPRtdvxo6v7GWNtythtD2/Pua5eO8zZxdhcew==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=GSxzpgXsUwPMH9MGNbaTzjhV4vYjrECzJnqLsTTpVgU=;
 h=Feedback-ID:Received:Subject:From:To:Date; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 73202 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -629887051; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 08 Oct 2024 17:23:15 +0000 (UTC)
Message-ID: <41288336fe2cfc4b311b16c704a735c27e776d79.camel@HIDDEN>
From: Lilah Tascheter <lilah@HIDDEN>
Date: Tue, 08 Oct 2024 12:23:14 -0500
In-Reply-To: <D4QI1I2N5HOS.26ALTDNH2YQZ8@HIDDEN>
References: <D4QI1I2N5HOS.26ALTDNH2YQZ8@HIDDEN>
Organization: Dissociation for Heresiographal Computation
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 
MIME-Version: 1.0
X-Spam-Score: 0.0 (/)
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 (-)

ugh forgot to send this to the mailing list, so resending:

> Very odd, do you think this is a bug in mumi of some kind?

yep! I tried to message guix-devel about it but nobody responded. no
clue where to report mumi bugs. a control message I sent caused mumi's
message download links to be offset one back, resulting in a request to
download any email (both in the cli and the web ui) to return the
previous email in order.

it sucks.






Message sent to guix-patches@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: [bug#73202] [PATCH] Preparation for bootloader rewrite.
Resent-From: Lilah Tascheter <lilah@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: guix-patches@HIDDEN
Resent-Date: Tue, 08 Oct 2024 18:06:02 +0000
Resent-Message-ID: <handler.73202.B73202.172841075720967 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 73202
X-GNU-PR-Package: guix-patches
X-GNU-PR-Keywords: patch
To: 73202 <at> debbugs.gnu.org
Cc: Herman Rimm <herman@HIDDEN>
Received: via spool by 73202-submit <at> debbugs.gnu.org id=B73202.172841075720967
          (code B ref 73202); Tue, 08 Oct 2024 18:06:02 +0000
Received: (at 73202) by debbugs.gnu.org; 8 Oct 2024 18:05:57 +0000
Received: from localhost ([127.0.0.1]:54340 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1syEaq-0005S7-P4
	for submit <at> debbugs.gnu.org; Tue, 08 Oct 2024 14:05:57 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:54710)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1syEan-0005Rq-Dw
 for 73202 <at> debbugs.gnu.org; Tue, 08 Oct 2024 14:05:55 -0400
DKIM-Signature: a=rsa-sha256;
 b=NS2TSTWrsiM44JBFi0Otfo+A4pjss0PijRYZxpjjlbpWEz0SoHysEETteksKwWizBZ5yPWRMjtoYbnw6Vj8CXypT3kElRK2VBeJq8sD7GJjbePrknS9MiDn8I2zf9cUGKUzEnfzB315aOiaO8zZlxhiqbDPV2ljvfDhZZ1iHaJBWgnpiFyIRSRD2cR23e87QVQe/YqsVgSXVJwDeTy0wDs0oTymhyuvmF4Lvw3+MMHtXgs2Vc6jraCMMFG/W7P/gNl5KnY1SvOf1evS6qV0LdaT5vG3YA73JJqc+1rc/ouCXCTNks7EPemM1UK1v1tSeGh/sVrXHtenPxBVhT/gwMQ==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=HU04stQHQoqRxgZ6VizLOjqj9Q/R4HepBS4UP4E1k/4=;
 h=Received:Subject:From:To:Date; 
DKIM-Signature: a=rsa-sha256;
 b=QGmLcxiG0F+NtaF63wRgXESW9oZhrsNSEqgRqeVtKpuTdnTZDMI3Lh30P66VNSi/pEWToLs28IzCwW1wYwPFv5K9wdVeZ5vC//qWmdmZfFy869by9KvXQLFUrzeHIoOjf9xO3oDN4DcsBSxyQszcmP7iDgEqd1r8x3DVP9y0zDOjStqdk0FwcdvphosX/nPcnXKwNEn6HOG0t5Ne05jOTphNXwifo8CNvbLRmYBIoxqZhoo57uOyyz7ZZhONN0XEFXPrEYScP+Pzm3qd9nbfNhfN18IxwuaCxqaNSs+ajDw72aqQ00tVh/x90TVGvoA+QCrfnH8ayTnwHLQE+0R7fg==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=HU04stQHQoqRxgZ6VizLOjqj9Q/R4HepBS4UP4E1k/4=;
 h=Feedback-ID:Received:Subject:From:To:Date; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 73202 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id -1089440259; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Tue, 08 Oct 2024 18:05:37 +0000 (UTC)
Message-ID: <3586f7df3cbecf867bc82ac21c46bd067616d3f0.camel@HIDDEN>
From: Lilah Tascheter <lilah@HIDDEN>
Date: Tue, 08 Oct 2024 13:05:36 -0500
In-Reply-To: <sgg7cef5h7fj7sl3ypvy3k77v6zoi2wsvn6zc2mloyvyntce5o@b3anleonz5hf>
References: <4fnudiucjxequd3m4ayy7drqsgjokybfvsu6l2tbssurhlr5wd@odqr53qw5qqz>
 <bf58219d6ebb940af92cbbc4f8a735b873a88964.camel@HIDDEN>
 <sgg7cef5h7fj7sl3ypvy3k77v6zoi2wsvn6zc2mloyvyntce5o@b3anleonz5hf>
Organization: Dissociation for Heresiographal Computation
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.48.4 
MIME-Version: 1.0
X-Spam-Score: 0.0 (/)
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 (-)

hi!!

> > I'm also worried about indentation growing too quickly.
> Do you have a use case in mind, with more than three levels of
> nesting?
yeah good point :p

> > also, if the path, device, label, and uuid fields are combined, the
> > guix system image won't be able to get all the info it needs to the
> > bootloader installers. uuid or label needs to be there to identify
> > the device on-boot,
> So I have tried combining the path field into the device field, but
> I'mnow in favor of using a target tree/paths field together with a
> combined block device, file system label, or UUID field.=C2=A0 Here the
> assumption is that any of the aformentioned types can be derived from
> any other, e.g. with find-partition-by-uuid and read-partition-
> label.=C2=A0 If a bootloader cannot use a provided type, or find other
> required types, it should throw an error.=C2=A0 If you have a use case
> where both a block device and a (potentially unrelated) UUID are
> configured, please let me know.
alright, that sounds great! would work for image gen, and can't think
of a reason why distinct uuids and devices would be supplied.

>=20
> > but also path, device, and devpath are required to actually install
> > bootloader files.
> I think the device could be installation-agnostic and anything
> related
> to installation could be a different bootloader, or a field like
> tftp.

> > also, one reason with-targets exists is as a safeguard for future
> > people writing bootloaders. guix system image tends to be
> > overlooked,
> > so it performs checks to make sure the bootloader targets requested
> > are available during image generation.
> What do you think about having required types per bootloader, and
> tests
> for trees generated from image partitions in (gnu tests image)
> instead?
oh yeah that's a way better idea! offloads the test work from runtime
to, well, testing.


> That reminds me: I would like to add a supported file systems field
> to the bootloader, so that if the file system found for root-device
> is not supported, it throws a little error.
sounds good, make sure the field supports specifying that all
filesystems are supported though (mostly just because of bootloaders
that install a kernel directly, like uki-efi).

> (define %boot-fs
> =C2=A0 (file-system
> =C2=A0=C2=A0=C2=A0 (device (uuid "E6A5-FEBB" 'fat32))
> =C2=A0=C2=A0=C2=A0 (mount-point "/boot") ; Taken as ESP.
> =C2=A0=C2=A0=C2=A0 ;; Cannot be used to configure e.g. GRUB netboot, but =
it would be
> =C2=A0=C2=A0=C2=A0 ;; nice to assert (support? bootloader type) in fs->bo=
otloader.
> =C2=A0=C2=A0=C2=A0 (type "vfat")))
> (operating-system=20
> =C2=A0 (bootloader ;; Procedure defined in (gnu system file-systems).
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 (file-system->grub-efi-bootloader %boot-fs))
> =C2=A0 ...)
>=20
> ;; bootloader->file-system would not work as well.=C2=A0 An OS field
> (macro)
> ;; to define both simultaneously at a high level could be useful
> though.
> (operating-system
> =C2=A0 (file-systems-with-bootloader
> =C2=A0=C2=A0=C2=A0 ;; Irrelevant for file-systems.
> =C2=A0=C2=A0=C2=A0 (bootloader grub-efi-bootloader)
> =C2=A0=C2=A0=C2=A0 ;; Relevant as a file-system and bootloader installati=
on.
> =C2=A0=C2=A0=C2=A0 (boot-device "UUID, label, or block device.")
> =C2=A0=C2=A0=C2=A0 (mount-point "/boot")
> =C2=A0=C2=A0=C2=A0 (type "vfat")
> =C2=A0=C2=A0=C2=A0 ;; Not relevant to bootloader.=C2=A0 Default values gi=
ven.
> =C2=A0=C2=A0=C2=A0 (root-file-system (mounted-root-fs)) ; Error if not fo=
und.
> =C2=A0=C2=A0=C2=A0 ;; Cons the generated boot FS and mounted root FS to t=
his.
> =C2=A0=C2=A0=C2=A0 (file-systems %base-file-systems))
> =C2=A0 ...)
so, the benefit here is that bootloader builds would be deterministic
from the bootloader-configuration, right?  I feel like a new top-level
macro, that requires specific fields for each possible device type is
unwieldly.  it's also potentially important to be able to install
multiple distinct bootloaders with distinct configurations, for eg
u-boot->uefi chainloading or raid arrays. how about something like the
following:

(operating-system
  (bootloader (list (grub-efi-bootloader
                      ;; ... remove the bootloader-configuration record
                      ;; entirely, and have each bootloader take their
                      ;; own config.  apart from targets and
                      ;; menu-entries (which we can split off), there
                      ;; aren't really any shared config opts anyway.
                      ;; assoc-fs assocs a path with a file-system type
                      ;; from the operating-system record (delay
                      ;; or thunk the bootloader field so that images
                      ;; can override file-systems?)
                      (root (assoc-fs file-systems "/")))))
  ;; have your original targets system in place
  (bootloader-targets ...)
  ;; non-grub replacement for menu-entries, potentially with a=20
  ;; %base-boot-options thing for the autogenerated ones per
  ;; guix system generation?
  (boot-options ...))

with a field sanitizer to make singular entries into lists, to simplify
single-bootloader use.  devpaths would then be able to be generated by
the bootloader using the configuration target information.

honestly, then maybe just specify a target field (taking a symbol) in
the file-system record, and have assoc-fs take either a target symbol
or mount path. have bootloader-targets be generated from the file-
systems, with the bootloader-targets field just specifying non-
filesystem block devices.

I think parts of that may be similar to what you were originally
intending? I'm sorry, if so.

- lilah





Last modified: Sun, 12 Jan 2025 05:45:02 UTC

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