GNU bug report logs - #69343
[PATCH 00/12] Simplify bootloader data structures and procedures

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

Package: guix-patches; Reported by: Felix Lechner <felix.lechner@HIDDEN>; Keywords: patch; dated Sat, 24 Feb 2024 01:09:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:57 2024
Received: from localhost ([127.0.0.1]:56424 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVYC-0002cW-IX
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:57 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:50398)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVY5-0002bJ-UQ
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:51 -0500
DKIM-Signature: a=rsa-sha256;
 b=TSrlKwYMvaiAH4jB5Mes/kd5usj3qi4eBxQG+gLqGTBfp32raYaIsvzsJq3lomiKU8Avhh4h8HjW+vo2ukj2YRDOSCmQmB4mA1phIkA8El/9SMsbELpEKdocPR9SstzvU9plAR5K0KnmgPCeym/vh/Tu+7Dgjq2nQQeEvN4/OfLeQzTIHP4qDwQqmVQdFk76zAxO9TWVXEBJzNXDJaXhVIKAIZQSnynY90eAm8mvin9uBq9XO4I3nEJtYDj+lqK1dpUpUCe69isQ3E/Uu61mlxNhbVMYDSKC9x1SEn2KvndadHtfbdpy9kFoYvpWoW4/AsEfiH1jDzWSylJ5FA+7iA==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=NMujglk2l9ZujaqjgcerdFyC1t4oJvu/cL9oS6fEb3E=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=KzSwqPXgJf3LiCNG6XMlI1Ech4CmUw/Fcx1RNPg1WdA62bnAhqkd/Jn3VipTLySaCioGNyuETAEy90hSdVIxVFjuOCRyr+RjPPqDiZTVXiXe6nlgLIan3D2o/CBxN0yTetk5lsva5qrQfmsYuEH3rEPxl4fCtSmKJ+/jRmPzybbuwyLRDusJJ6P+3wTSeraokOMEJUEyncnVuddWAz5suEejcxjxPqJDgxPZ7oO8YgA+cNKfQ4p0PTy6IxVx5Unf7YMqCmkjphkUyTFdYdQ+0CEsie66RJb/ibDJLiNTPcUSWh8tMpyv34xiDkSOtG1Lvy+DJ+GUroJymRarO+ASsA==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=NMujglk2l9ZujaqjgcerdFyC1t4oJvu/cL9oS6fEb3E=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:23 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 12/12] Encapsulate <boot-parameters> to retain generation,
 system-path and epoch.
Date: Fri,  8 Mar 2024 02:12:08 -0600
Message-ID: <1242fe7e331528023c6d2a4768256d8f48607b34.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

* gnu/system/boot.scm (<boot-alternative>): New record.

* gnu/machine/ssh.scm (machine->boot-alternatives): Return a
  boot-alternative encapsulating previous return value.
  (with-roll-back, roll-back-managed-host): Get parameters from
  boot-alternatives.

* guix/scripts/system.scm (generation->boot-parameters): Rename to...
  (generation->boot-alternative): ...this. Return a boot-alternative
  encapsulating previous return value.
  (profile->boot-alternatives): Rename uses as above.
  (reinstall-bootloader, perform-action): Get parameters from
  boot-alternatives.

Change-Id: Iaef0b0a3fa9240ca8315a9699bcf4a7bfe908e33
---
 gnu/machine/ssh.scm     | 32 ++++++++++++++++++++------------
 gnu/system/boot.scm     | 14 ++++++++++++++
 guix/scripts/system.scm | 32 +++++++++++++++++++++-----------
 3 files changed, 55 insertions(+), 23 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 45ab8b9868..61125dddce 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -415,8 +415,8 @@ (define not-config?
     (_ #f)))
=20
 (define (machine->boot-alternatives machine)
-  "Monadic procedure returning a list of 'boot-parameters' for the generat=
ions
-of MACHINE's system profile, ordered from most recent to oldest."
+  "Monadic procedure returning a list of <boot-alternative> records for th=
e
+generations of MACHINE's system profile, ordered from most recent to oldes=
t."
   (define bootable-kernel-arguments
     (@@ (gnu system) bootable-kernel-arguments))
=20
@@ -460,13 +460,18 @@ (define (machine->boot-alternatives machine)
                                 read-boot-parameters))
                       (root (boot-parameters-root-device params))
                       (text (boot-parameters-label params))
-                      (version (boot-parameters-version params)))
-                 (boot-parameters
-                  (inherit params)
-                  (label (decorated-boot-label text generation epoch))
-                  (kernel-arguments
-                   (append (bootable-kernel-arguments system-path root ver=
sion)
-                           (boot-parameters-kernel-arguments params)))))))=
)
+                      (version (boot-parameters-version params))
+                      (parameters (boot-parameters
+                                   (inherit params)
+                                   (label (decorated-boot-label text gener=
ation epoch))
+                                   (kernel-arguments
+                                    (append (bootable-kernel-arguments sys=
tem-path root version)
+                                            (boot-parameters-kernel-argume=
nts params))))))
+                 (boot-alternative
+                  (generation generation)
+                  (system-path system-path)
+                  (epoch epoch)
+                  (parameters parameters))))))
           remote-results))))
=20
 (define-syntax-rule (with-roll-back should-roll-back? mbody ...)
@@ -510,7 +515,8 @@ (define (deploy-managed-host machine)
                    (%current-target-system #f))
       (let* ((os (machine-operating-system machine))
              (eval (cut machine-remote-eval machine <>))
-             (menu-entries (map boot-parameters->menu-entry boot-alternati=
ves))
+             (menu-entries (map boot-parameters->menu-entry
+                                (map boot-alternative-parameters boot-alte=
rnatives)))
              (bootloader-configuration (operating-system-bootloader os))
              (bootcfg (operating-system-bootcfg os menu-entries)))
         (define-syntax-rule (eval/error-handling condition handler ...)
@@ -584,13 +590,15 @@ (define (roll-back-managed-host machine)
   (mlet* %store-monad ((boot-alternatives (machine->boot-alternatives mach=
ine))
                        (_ -> (if (< (length boot-alternatives) 2)
                                  (raise roll-back-failure)))
-                       (parameters (second boot-alternatives))
+                       (chosen-alternative (second boot-alternatives))
+                       (parameters (boot-alternative-parameters chosen-alt=
ernative))
                        (entries -> (list (boot-parameters->menu-entry para=
meters)))
                        (locale -> (boot-parameters-locale parameters))
                        (crypto-dev -> (boot-parameters-store-crypto-device=
s parameters))
                        (store-dir -> (boot-parameters-store-directory-pref=
ix parameters))
                        (old-entries -> (map boot-parameters->menu-entry
-                                            (drop boot-alternatives 2)))
+                                            (map boot-alternative-paramete=
rs
+                                                 (drop boot-alternatives 2=
))))
                        (bootloader -> (operating-system-bootloader
                                        (machine-operating-system machine))=
)
                        (bootcfg (lower-object
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index b39e7d8610..edb4d213b9 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -70,6 +70,13 @@ (define-module (gnu system boot)
             read-boot-parameters
             read-boot-parameters-file
=20
+            boot-alternative
+            boot-alternative?
+            boot-alternative-generation
+            boot-alternative-system-path
+            boot-alternative-epoch
+            boot-alternative-parameters
+
             epoch->date-string
             decorated-boot-label
             boot-parameters->menu-entry
@@ -277,6 +284,13 @@ (define (read-boot-parameters-file system)
      (kernel-arguments (append (bootable-kernel-arguments system root vers=
ion)
                                (boot-parameters-kernel-arguments params)))=
)))
=20
+(define-record-type* <boot-alternative>
+  boot-alternative make-boot-alternative boot-alternative?
+  (generation boot-alternative-generation)
+  (system-path boot-alternative-system-path)
+  (epoch boot-alternative-epoch)
+  (parameters boot-alternative-parameters))
+
 (define (epoch->date-string epoch)
   "Return a string representing the date for EPOCH seconds."
   (let ((time (make-time time-utc 0 epoch)))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 7f6ba20ef9..97804ad736 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,26 +323,31 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
=20
-(define (generation->boot-parameters profile number)
-  "Return the 'boot-parameters' for the generation of PROFILE specified
+(define (generation->boot-alternative profile number)
+  "Return the 'boot-alternative' for the generation of PROFILE specified
 by NUMBER."
   (unless-file-not-found
    (let* ((system (generation-file-name profile number))
           (params (read-boot-parameters-file system))
           (epoch (stat:mtime (lstat system)))
-          (text (boot-parameters-label params)))
-     (boot-parameters
-      (inherit params)
-      (label (decorated-boot-label text number epoch))))))
+          (text (boot-parameters-label params))
+          (parameters (boot-parameters
+                       (inherit params)
+                       (label (decorated-boot-label text number epoch)))))
+     (boot-alternative
+      (generation number)
+      (system-path system)
+      (epoch epoch)
+      (parameters parameters)))))
=20
 (define* (profile->boot-alternatives #:optional (profile %system-profile)
                                      (numbers
                                       (reverse (generation-numbers profile=
))))
-  "Return a list of 'boot-parameters' for the generations of PROFILE speci=
fied
+  "Return a list of 'boot-alternative' for the generations of PROFILE spec=
ified
 by NUMBERS, which is a list of generation numbers. The list is ordered fro=
m
 the most recent to the oldest profiles."
   (filter-map (lambda (number)
-                (generation->boot-parameters profile number))
+                (generation->boot-alternative profile number))
               numbers))
=20
 =0C
@@ -391,7 +396,9 @@ (define (reinstall-bootloader store number)
                              (bootloader bootloader)))
=20
          ;; Make the specified system generation the default entry.
-         (params (generation->boot-parameters %system-profile number))
+         (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 param=
s))
          (store-directory-prefix
@@ -402,7 +409,8 @@ (define (reinstall-bootloader store number)
                                       %system-profile old-generations))
          (entries (list (boot-parameters->menu-entry params)))
          (old-entries (map boot-parameters->menu-entry
-                           previous-boot-alternatives)))
+                           (map boot-alternative-parameters
+                                previous-boot-alternatives))))
     (run-with-store store
       (mlet* %store-monad
           ((bootcfg (lower-object
@@ -818,7 +826,9 @@ (define* (perform-action action image
           os
           (if (eq? action 'init)
               '()
-              (map boot-parameters->menu-entry (profile->boot-alternatives=
))))))
+              (map boot-parameters->menu-entry
+                   (map boot-alternative-parameters
+                        (profile->boot-alternatives)))))))
=20
   (when (eq? action 'reconfigure)
     (maybe-suggest-running-guix-pull)
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:56 2024
Received: from localhost ([127.0.0.1]:56422 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVYC-0002cU-5h
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:56 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:44466)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVY5-0002bK-Uu
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:51 -0500
DKIM-Signature: a=rsa-sha256;
 b=NMoVXHLnPS5hREIX+sKQ34tJ6EqWG+rKKlzj19qlGfUrezUatkBQTte+APW6agaWqaapP7btPZEvi149KZNwSZVjjMaR1BPwSFyVwLBtrqE4nl6WYd+9/e53W59TVrdNr3qeaYOUl0fM5CNwcqxC9j4m9hIO1yA70DCdlrRe8Ik9jiaYNFS11M0UmhUvOgpaOBwFznpJAHOdwXR0ubaF47wCEdIV1kTvxRTM9dOm0+J9i7XXf/vxRCCme/cVWnC4Xaq1pDTwPPfgxdtWnMWHKXq/BDHTAMSPVGJfIJBUB/mzgI+Dgt7nJD8nRewSpopIQqR8wuazZZ6Dkn6LPXKoIQ==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=44udMxD4fW29ObvpvJVxkvSnP+DqxG0lHbpJHjb3WRc=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=yPOZ4PL1K5T8ZSnLTFEXZUgis383kRkzgBM1LnPYndh4KfbKklaKokZF7Tma1/OAjaSmvO24lhQ0B1gcEZ3Kd+DYQfvNKzJYN7DqC0li13+kQFnzA2aLHov1rije1Gf9rY8dIImAzUwkR4Wdk6lVdrtfWizcjuo3v98rAZkYxuc6L66z62LKawLvuUWsIdGWruvFdUB5N8WjN9YT39ElhNHWlyHMxGViiCZLl2FNJQH2LLvETkQkMx6AJxyKMDwZ/A3aCOudpu7JwxM1lg+fz/K4LnuI7Cx0b8WCqBnK6ug5NQYoB8m3xK0q6pTRL3TEVY1pAMDzbTnXdffcSNSGZg==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=44udMxD4fW29ObvpvJVxkvSnP+DqxG0lHbpJHjb3WRc=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:21 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 09/12] Give a separate name to a commonly used expression.
Date: Fri,  8 Mar 2024 02:12:05 -0600
Message-ID: <6b8cc8a8b8b13d0c06ffba22585a485bb96fd562.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

* gnu/machine/ssh.scm (roll-back-managed-host): Factor out a
  subexpression into new variable parameters.

Change-Id: I8d70684142bea736042d6c9dc8276ea7bdb9c181
---
 gnu/machine/ssh.scm | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 9adb5e79b9..45ab8b9868 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -584,14 +584,11 @@ (define (roll-back-managed-host machine)
   (mlet* %store-monad ((boot-alternatives (machine->boot-alternatives mach=
ine))
                        (_ -> (if (< (length boot-alternatives) 2)
                                  (raise roll-back-failure)))
-                       (entries -> (map boot-parameters->menu-entry
-                                        (list (second boot-alternatives)))=
)
-                       (locale -> (boot-parameters-locale
-                                   (second boot-alternatives)))
-                       (crypto-dev -> (boot-parameters-store-crypto-device=
s
-                                       (second boot-alternatives)))
-                       (store-dir -> (boot-parameters-store-directory-pref=
ix
-                                      (second boot-alternatives)))
+                       (parameters (second boot-alternatives))
+                       (entries -> (list (boot-parameters->menu-entry para=
meters)))
+                       (locale -> (boot-parameters-locale parameters))
+                       (crypto-dev -> (boot-parameters-store-crypto-device=
s parameters))
+                       (store-dir -> (boot-parameters-store-directory-pref=
ix parameters))
                        (old-entries -> (map boot-parameters->menu-entry
                                             (drop boot-alternatives 2)))
                        (bootloader -> (operating-system-bootloader
--=20
2.41.0





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

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:53 2024
Received: from localhost ([127.0.0.1]:56420 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVY8-0002cD-JA
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:53 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:50396)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVY5-0002bI-Tg
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:50 -0500
DKIM-Signature: a=rsa-sha256;
 b=hkdDqvCMtz2dd3BAWcoSDDCeDPLZ98bwf2fFwSHThkG25QTkgMyJAKJkiENZE+FW12hSzqUeYjNLUXy4XVLFKasjchc9HYw0q+SOmIKOngW5ZTcKbZgpKjeP/ZxguZ5MUzGr3RS82sJ8LZxiQgo+ZNn7pvbVtTOy9xEIR+p5hu1zE/KWt2tzx7dPCeX3EcJAykq+dQNYqC3QDXZxomiBKSoHraQlwqkVYcDOhnPL5/382sX3fhoMZM4vOZRcGxJdRHI3z3HZnE3566GUtmn53AYZhrmI+2R5zQ5CvPu5C2ZluxRHeigG7MawVk1U6qKU61DXwM9uMb3I3c4E59gc3A==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=xV+lOLd6iNvU3oJkT/bpIgQUVgjNLSk62TWGjnt/+cY=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=CYlIEP51ICodUdpAsQx5NbbR4TSd1s1HE+oWcHIHZ3gankqOJMIOAZ+KzOi3lgW7gaG3Uxja3RiUfIRkcPFRmZF964kaI77ueslXkKmsmlL0HzSBCH5zDmdY5xOxzatklPeWnejkUK2ubtZ1IIhRReTvfhlFTw7kfbUZnLDW7D/K/wWmqRs7hq68/BbziHO60ICSObX7muTx0e9EPs8dXPqYanGBuD0vjgCXonE52leiVNDSy0RWn9tXKmxMLf8RpUvo9oclcmyVIGX0g7SYjjdJ3o+tE4Fu7GWqxUHUCtZ5KC7JYNXsw63J9Tvaq4kPZd+bUcw6tr3paltOFfVA2g==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=xV+lOLd6iNvU3oJkT/bpIgQUVgjNLSk62TWGjnt/+cY=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:23 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 11/12] Split generation->boot-parameters out of
 profile->boot-alternatives.
Date: Fri,  8 Mar 2024 02:12:07 -0600
Message-ID: <05ea87298e8731b00fa7127e97a6b497ae391695.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

* guix/scripts/system.scm
  (profile->boot-alternatives)[generation->boot-parameters]: Move to...
  (generation->boot-parameters): ...here.
  (reinstall-bootloader): Use procedure above.

Change-Id: I51ef1a4fa8fd18104d28a6a845707d7dedde3782
---
 guix/scripts/system.scm | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 3df37e5510..7f6ba20ef9 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,22 +323,27 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
=20
+(define (generation->boot-parameters profile number)
+  "Return the 'boot-parameters' for the generation of PROFILE specified
+by NUMBER."
+  (unless-file-not-found
+   (let* ((system (generation-file-name profile number))
+          (params (read-boot-parameters-file system))
+          (epoch (stat:mtime (lstat system)))
+          (text (boot-parameters-label params)))
+     (boot-parameters
+      (inherit params)
+      (label (decorated-boot-label text number epoch))))))
+
 (define* (profile->boot-alternatives #:optional (profile %system-profile)
                                      (numbers
                                       (reverse (generation-numbers profile=
))))
   "Return a list of 'boot-parameters' for the generations of PROFILE speci=
fied
 by NUMBERS, which is a list of generation numbers. The list is ordered fro=
m
 the most recent to the oldest profiles."
-  (define (generation->boot-parameters number)
-    (unless-file-not-found
-     (let* ((system           (generation-file-name profile number))
-            (params           (read-boot-parameters-file system))
-            (epoch            (stat:mtime (lstat system)))
-            (text             (boot-parameters-label params)))
-       (boot-parameters
-        (inherit params)
-        (label (decorated-boot-label text number epoch))))))
-  (filter-map generation->boot-parameters numbers))
+  (filter-map (lambda (number)
+                (generation->boot-parameters profile number))
+              numbers))
=20
 =0C
 ;;;
@@ -386,8 +391,7 @@ (define (reinstall-bootloader store number)
                              (bootloader bootloader)))
=20
          ;; Make the specified system generation the default entry.
-         (params (first (profile->boot-alternatives %system-profile
-                                                    (list number))))
+         (params (generation->boot-parameters %system-profile number))
          (locale (boot-parameters-locale params))
          (store-crypto-devices (boot-parameters-store-crypto-devices param=
s))
          (store-directory-prefix
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:52 2024
Received: from localhost ([127.0.0.1]:56417 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVY7-0002c7-Uy
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:52 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:44464)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVY5-0002bH-Sr
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:50 -0500
DKIM-Signature: a=rsa-sha256;
 b=kgxa3xss7MFHtzV2fVT/hznNTG3DYmZkmXw0YSacjKY57Qmk8VE3xSdyCRtsf/ljt+Vx36UqaRCYTjiYkGcMTiXvEnmi5Aw6MWIMIqrFYXc3yjnpXTviG0M5WxOQ9UIh3hK6gz/9aJ8rD4ZEk9mHX5K2Yu20Tu6NeRxoZ5oX5QqseRLJHviupBbYwPk6PqjKFRKDGK84Jf3bt3OeupZDsVPQcUJ9+BPOaNuoFaI1ollrG2YxSJRAx18fqOwWuqXxJc9iWDzOGl3ZmwA5Y5ca6wkyqRoH7CebQZ2ttnj/CgkEM6liCEtrV3V2nHe6ejqYrvoNUxXf1yvOag5S/pRsWw==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=KW0ToLgREhXbLWcQyyoGKh1GojWNPReOJ75CIYnPaeE=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=BmPDFmTQDKaWRFWubW9Pymg1kyuBL2rLvWtj/EXLNJyMkS25gEbnqjJlu2/IawY5ACGFdGAK1qAAr5FbQiLXAiw0nQVqYxCdVO8oUcybcSJg0iz0oL3KGIIQ2eCAnuCNBZKvi/G4NGlYy0E+/q3JkEU//Tw5oBsjlOS4/504aTyWml/LgbLNfR+gBjGI1ot/FLQRmqQZTGkX6KCns7hC/T2lHgMNz/3wx5y9xJm48et3E0dVVE/tSeU7ADupPbDkLSQwNKKjuJ42MWLvrx4xwmiJnSyGJfyuTb/sUMdb5K0FB7slaDd2Ok5cOG+VERPu3bBHs13roCxKEhdy1NiZtw==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=KW0ToLgREhXbLWcQyyoGKh1GojWNPReOJ75CIYnPaeE=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:22 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 10/12] Simplify profile->boot-alternatives.
Date: Fri,  8 Mar 2024 02:12:06 -0600
Message-ID: <12f5292170b873f491330a10a048af52232405aa.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

* guix/scripts/system.scm
  (profile->boot-alternatives)[system->boot-parameters]: Rename to
  generation->boot-parameters and factor out processing from...
  (profile->boot-alternatives): ...here.

Change-Id: If31eeb4cef4f5a107a0ee5ad3f117bf38629ac38
---
 guix/scripts/system.scm | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index fd9f0727ee..3df37e5510 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -329,20 +329,16 @@ (define* (profile->boot-alternatives #:optional (prof=
ile %system-profile)
   "Return a list of 'boot-parameters' for the generations of PROFILE speci=
fied
 by NUMBERS, which is a list of generation numbers. The list is ordered fro=
m
 the most recent to the oldest profiles."
-  (define (system->boot-parameters system number epoch)
+  (define (generation->boot-parameters number)
     (unless-file-not-found
-     (let* ((params           (read-boot-parameters-file system))
+     (let* ((system           (generation-file-name profile number))
+            (params           (read-boot-parameters-file system))
+            (epoch            (stat:mtime (lstat system)))
             (text             (boot-parameters-label params)))
        (boot-parameters
         (inherit params)
         (label (decorated-boot-label text number epoch))))))
-  (let* ((systems (map (cut generation-file-name profile <>)
-                       numbers))
-         (times   (map (lambda (system)
-                         (unless-file-not-found
-                          (stat:mtime (lstat system))))
-                       systems)))
-    (filter-map system->boot-parameters systems numbers times)))
+  (filter-map generation->boot-parameters numbers))
=20
 =0C
 ;;;
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:47 2024
Received: from localhost ([127.0.0.1]:56399 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVXs-0002ay-0D
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:47 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:44440)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVXl-0002ZZ-RS
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:31 -0500
DKIM-Signature: a=rsa-sha256;
 b=VCBDmbAzDpm1+GscOp0HM5+FD1tjKb5jWK495M+btMuQmzfg4bRS50cXPzB01TK5d0HxQ7d+Cs91nfDx6MJIkoD44iiTrqY4J3i+kRbl28ApD5ov5NOGajg/TsUNbZG6Z/w5F05LgqhMeIskzaQ9OR4mFMFMkqOejkjo0C/GWrwSQKZgMtZvcTXGswFyYWMnmRrNVkhaWiokYqrl0bvQnw9PRwk8YtB/c5upVKrR/Y3IT17U0OnYpoZfhX4E2FTO+bsgxrbcptQpDlM/3InhczuUpleYdMWWeoOGeBsdv0TXglDVNIEqKPchDQdW9hv5vNkZx23hJmOnX5ybSvUn0w==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=rFFcUIqkRFPoM5KPTV8rG+ifOA7euPpBC2XLOfoRREs=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=r8+Wa08tsjVUxHc8wh9GOc56Vpu4oWBFwe2RHajK075P/mf47QPKHQzvrzxXzxbnxkUn1lHDjN+SYn+mgCtCU3RfXY4bSZAjvcZG+B/+2cUUpXYH0g9dHCsW0oAbOB64xJ332o32hK0h/Vv0bj4z7alYn1mCSSO0YhdM3dyNdT1wTXXmJSRwd2hWg69TCxLfFknmooFumv5bKUFB+UotVA5W8VkSbdJZkhBg328WUmQtc+61bYe4o4LQmO45BppJtpL4lHz1l53vdGqFU4E2liaYMSAgbeEUtKxDN3uRYWxEd7hjUHfyIqFvQF/fEpC63ZCAHRk9NlHOqte+bMc6kQ==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=rFFcUIqkRFPoM5KPTV8rG+ifOA7euPpBC2XLOfoRREs=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:20 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 07/12] Rename boot-parameters to boot-alternatives when
 appropriate.
Date: Fri,  8 Mar 2024 02:12:03 -0600
Message-ID: <7c47238a38488fdb2f509c2a021c183f645cbc11.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

Throughout the code base, the token 'boot-parameters' refers to collection =
of
data that is stored on disk for each system generation. It was confusing to
use it for a list of such records. This comment imposes an alternative name=
.

* gnu/machine/ssh.scm (machine-boot-parameters): Rename to
  machine->boot-alternatives.
  (machine->boot-alternatives, roll-back-managed-host): Use
  boot-alternatives instead of boot-parameters as appropriate.
* guix/scripts/system.scm (profile-boot-parameters): Rename to
  profile->boot-alternatives.
  (reinstall-bootloader, perform-action): Use boot-alternatives instead
  of boot-parameters as appropriate.

Change-Id: Iabb04dbb39f42f989692bede7304f20a69bef9fb
---
 gnu/machine/ssh.scm     | 20 ++++++++++----------
 guix/scripts/system.scm | 19 ++++++++++---------
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index fe47474470..11534c6740 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -414,7 +414,7 @@ (define not-config?
     (('gnu _ ...) #t)
     (_ #f)))
=20
-(define (machine-boot-parameters machine)
+(define (machine->boot-alternatives machine)
   "Monadic procedure returning a list of 'boot-parameters' for the generat=
ions
 of MACHINE's system profile, ordered from most recent to oldest."
   (define bootable-kernel-arguments
@@ -503,14 +503,14 @@ (define (deploy-managed-host machine)
                                   (machine-become-command machine)))
=20
   (mlet %store-monad ((_ (check-deployment-sanity machine))
-                      (boot-parameters (machine-boot-parameters machine)))
+                      (boot-alternatives (machine->boot-alternatives machi=
ne)))
     ;; Make sure code that check %CURRENT-SYSTEM, such as
     ;; %BASE-INITRD-MODULES, gets to see the right value.
     (parameterize ((%current-system system)
                    (%current-target-system #f))
       (let* ((os (machine-operating-system machine))
              (eval (cut machine-remote-eval machine <>))
-             (menu-entries (map boot-parameters->menu-entry boot-parameter=
s))
+             (menu-entries (map boot-parameters->menu-entry boot-alternati=
ves))
              (bootloader-configuration (operating-system-bootloader os))
              (bootcfg (operating-system-bootcfg os menu-entries)))
         (define-syntax-rule (eval/error-handling condition handler ...)
@@ -581,19 +581,19 @@ (define (roll-back-managed-host machine)
   (define roll-back-failure
     (condition (&message (message (G_ "could not roll-back machine")))))
=20
-  (mlet* %store-monad ((boot-parameters (machine-boot-parameters machine))
-                       (_ -> (if (< (length boot-parameters) 2)
+  (mlet* %store-monad ((boot-alternatives (machine->boot-alternatives mach=
ine))
+                       (_ -> (if (< (length boot-alternatives) 2)
                                  (raise roll-back-failure)))
                        (entries -> (map boot-parameters->menu-entry
-                                        (list (second boot-parameters))))
+                                        (list (second boot-alternatives)))=
)
                        (locale -> (boot-parameters-locale
-                                   (second boot-parameters)))
+                                   (second boot-alternatives)))
                        (crypto-dev -> (boot-parameters-store-crypto-device=
s
-                                       (second boot-parameters)))
+                                       (second boot-alternatives)))
                        (store-dir -> (boot-parameters-store-directory-pref=
ix
-                                      (second boot-parameters)))
+                                      (second boot-alternatives)))
                        (old-entries -> (map boot-parameters->menu-entry
-                                            (drop boot-parameters 2)))
+                                            (drop boot-alternatives 2)))
                        (bootloader -> (operating-system-bootloader
                                        (machine-operating-system machine))=
)
                        (bootcfg (lower-object
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 09d29dbbb1..fd9f0727ee 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,9 +323,9 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
=20
-(define* (profile-boot-parameters #:optional (profile %system-profile)
-                                  (numbers
-                                   (reverse (generation-numbers profile)))=
)
+(define* (profile->boot-alternatives #:optional (profile %system-profile)
+                                     (numbers
+                                      (reverse (generation-numbers profile=
))))
   "Return a list of 'boot-parameters' for the generations of PROFILE speci=
fied
 by NUMBERS, which is a list of generation numbers. The list is ordered fro=
m
 the most recent to the oldest profiles."
@@ -390,18 +390,19 @@ (define (reinstall-bootloader store number)
                              (bootloader bootloader)))
=20
          ;; Make the specified system generation the default entry.
-         (params (first (profile-boot-parameters %system-profile
-                                                 (list number))))
+         (params (first (profile->boot-alternatives %system-profile
+                                                    (list number))))
          (locale (boot-parameters-locale params))
          (store-crypto-devices (boot-parameters-store-crypto-devices param=
s))
          (store-directory-prefix
           (boot-parameters-store-directory-prefix params))
          (old-generations
           (delv number (reverse (generation-numbers %system-profile))))
-         (old-params (profile-boot-parameters
-                       %system-profile old-generations))
+         (previous-boot-alternatives (profile->boot-alternatives
+                                      %system-profile old-generations))
          (entries (list (boot-parameters->menu-entry params)))
-         (old-entries (map boot-parameters->menu-entry old-params)))
+         (old-entries (map boot-parameters->menu-entry
+                           previous-boot-alternatives)))
     (run-with-store store
       (mlet* %store-monad
           ((bootcfg (lower-object
@@ -817,7 +818,7 @@ (define* (perform-action action image
           os
           (if (eq? action 'init)
               '()
-              (map boot-parameters->menu-entry (profile-boot-parameters)))=
)))
+              (map boot-parameters->menu-entry (profile->boot-alternatives=
))))))
=20
   (when (eq? action 'reconfigure)
     (maybe-suggest-running-guix-pull)
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:36 2024
Received: from localhost ([127.0.0.1]:56397 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVXr-0002aq-DF
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:35 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:44438)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVXl-0002ZY-Rj
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:31 -0500
DKIM-Signature: a=rsa-sha256;
 b=a/mtnkgkfR/0eO3QiWJRxvHMOyodg5X5B+DJf6x3uBi8VwO3SUwDjBwtWqxqnodMsVVn16RqvORVnLoUiBfmhqS6FaaJKahVm/cneqfHprFICnyyqou/j6PPbWU2lyFyzRaf3yghLD0wSOMlunxL0OiKUKh370kIwX3TPDYgStRG2tk3kpb642NJTkes25iNomK+Ml+hr2cJk3iDLsn34kDs+rKvZK+uyo5gY/Tp6WaN7bTAxJJQ0LSr8s8lM0EYqyXISznbF0liQGxcaZBZ4pz1qkrRvSI46ONnJez02tY9YqxVL/RXbWAUwNRGAFufV+cvZsUL1kEIeazPw6ZtZQ==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=8pgH/zbPYXM0QMGXUemLtKnPF06UTcb0u9vzXSKrLN0=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=GUsx9cuALA7aHLV3omLNVwySEA5Bgzfw0S9NQTTVTwH7GaUzSlPzxhXGsjov2T87Z7B4rO183CQQed+LJyNliW+TlYEVKRp1XIsTuU9v3lgRJQN/h9DpUlfzt50xB0H//BITIddoxWa0+fPyDkwCJSTcCd67C0+pE1Dj9fznvo5LhsNAUIXfXwps1IOEffQqU3wF4a2xJ4hZez/Ac2f8bqVIBwjF5vmOKb+oV2nE8k1bVfMTPVPU3lV44IIzHuKv8Xgo8kYGw36IgJe4LcL8nD+Z7Q6dGMgUsbjDeEHiHXig6+F3EUacH9sZRpgBDAnafpfQvxsQiYld2ebQzqPmgw==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=8pgH/zbPYXM0QMGXUemLtKnPF06UTcb0u9vzXSKrLN0=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:19 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 05/12] Move epoch->date-string to gnu/system/boot.scm and
 use it elsewhere.
Date: Fri,  8 Mar 2024 02:12:01 -0600
Message-ID: <7adf6f188991d9d7052adb0056c0fb8b618c5059.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

* guix/scripts/system.scm (profile-boot-parameters): Rename time to
  epoch to fit new procedure name.
  (epoch->date-string): Move to...
* gnu/system/boot.scm (epoch->date-string): ...here.
* gnu/machine/ssh.scm (machine-boot-parameters): Rename time to epoch.
  (machine-boot-parameters)[boot-parameters]: Use epoch->date-string.

Change-Id: I6a5f793567221f81edd7b2d8d9f0f3e801d1b113
---
 gnu/machine/ssh.scm     | 10 ++++------
 gnu/system/boot.scm     |  8 ++++++++
 guix/scripts/system.scm | 10 ++--------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 0ffe71367c..449b65dbfb 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -444,10 +444,10 @@ (define (machine-boot-parameters machine)
                                                              generation))
                           (boot-parameters-path (string-append system-path
                                                                "/parameter=
s"))
-                          (time (stat:mtime (lstat system-path))))
+                          (epoch (stat:mtime (lstat system-path))))
                      (list generation
                            system-path
-                           time
+                           epoch
                            (read-file boot-parameters-path))))
                  (reverse (generation-numbers %system-profile)))))))
=20
@@ -455,7 +455,7 @@ (define (machine-boot-parameters machine)
     (return
      (map (lambda (generation)
             (match generation
-              ((generation system-path time serialized-params)
+              ((generation system-path epoch serialized-params)
                (let* ((params (call-with-input-string serialized-params
                                 read-boot-parameters))
                       (root (boot-parameters-root-device params))
@@ -466,9 +466,7 @@ (define (machine-boot-parameters machine)
                   (label
                    (string-append label " (#"
                                   (number->string generation) ", "
-                                  (let ((time (make-time time-utc 0 time))=
)
-                                    (date->string (time-utc->date time)
-                                                  "~Y-~m-~d ~H:~M"))
+                                  (epoch->date-string epoch)
                                   ")"))
                   (kernel-arguments
                    (append (bootable-kernel-arguments system-path root ver=
sion)
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index a3b9cce7d2..972f83febc 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -45,6 +45,7 @@ (define-module (gnu system boot)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-19)
   #:use-module (srfi srfi-34)
   #:use-module (srfi srfi-35)
   #:use-module (rnrs bytevectors)
@@ -69,6 +70,7 @@ (define-module (gnu system boot)
             read-boot-parameters
             read-boot-parameters-file
=20
+            epoch->date-string
             boot-parameters->menu-entry
=20
             ensure-not-/dev
@@ -274,6 +276,12 @@ (define (read-boot-parameters-file system)
      (kernel-arguments (append (bootable-kernel-arguments system root vers=
ion)
                                (boot-parameters-kernel-arguments params)))=
)))
=20
+(define (epoch->date-string epoch)
+  "Return a string representing the date for EPOCH seconds."
+  (let ((time (make-time time-utc 0 epoch)))
+    (date->string (time-utc->date time)
+                  "~Y-~m-~d ~H:~M")))
+
 (define (boot-parameters->menu-entry conf)
   "Return a <menu-entry> instance given CONF, a <boot-parameters> instance=
."
   (let* ((kernel (boot-parameters-kernel conf))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 86ee2ddc76..47c072ba5c 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,19 +323,13 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
=20
-(define (epoch->date-string epoch)
-  "Return a string representing the date for EPOCH seconds."
-  (let ((time (make-time time-utc 0 epoch)))
-    (date->string (time-utc->date time)
-                  "~Y-~m-~d ~H:~M")))
-
 (define* (profile-boot-parameters #:optional (profile %system-profile)
                                   (numbers
                                    (reverse (generation-numbers profile)))=
)
   "Return a list of 'boot-parameters' for the generations of PROFILE speci=
fied
 by NUMBERS, which is a list of generation numbers. The list is ordered fro=
m
 the most recent to the oldest profiles."
-  (define (system->boot-parameters system number time)
+  (define (system->boot-parameters system number epoch)
     (unless-file-not-found
      (let* ((params           (read-boot-parameters-file system))
             (label            (boot-parameters-label params)))
@@ -343,7 +337,7 @@ (define* (profile-boot-parameters #:optional (profile %=
system-profile)
          (inherit params)
          (label (string-append label " (#"
                                (number->string number) ", "
-                               (epoch->date-string time) ")"))))))
+                               (epoch->date-string epoch) ")"))))))
   (let* ((systems (map (cut generation-file-name profile <>)
                        numbers))
          (times   (map (lambda (system)
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:35 2024
Received: from localhost ([127.0.0.1]:56395 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVXr-0002ao-07
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:35 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:50368)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVXl-0002ZX-RH
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:30 -0500
DKIM-Signature: a=rsa-sha256;
 b=yauvRq6S7ong9hwsJ/XkFL29LKQKXxt5mEzes9e65OFhAuWKpTbxapjIsqZD66/prGoKWqYFg1tXz2BdeOrHM4hbpV5f4Gm0mshT7h1N+ivGf46pzJudGorf8XXIY1hucjnTg2DL4IiFH4CqwCSz3Is18IoWIQe2ZzXjvqqAzM2PL/OzrgKfJrME7BTdLz/IiWpIHP6Ixa1ErTLtPwzkDsWy9QOUZopB7Qqpk/kr7iekGM0adG+43g1Vw8RjEECbXJXiBnPVGuINYm2qofWNq48Kz9rLevAmeVYWGDI8o1YUm/Zs9kjyLp0CkdrrptfOx1NjBTSdpDdM1xozmSurHw==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=fPRYDQ1t4FGIKh4qAc65pN2usoZ60twgiozHdseL2O0=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=MvzJidm7h4m60otIxRO2/hkFrTqWzNXV2rCf7OaDpIGgyRgUkoKXvO6Opl5yIPDHoYylnsKmsbWI0clJeM0tRvrbVvCLsT9kpEJ9/imWrrOsWBAZeAUH5IsD8J6Y46FZvyM44hy0JY2CwE4gF8PI1fOMWeHm/RAj4S9EfWKAJelkK+mvLuzSybOiO9Qi1UVW5/Jl79z1TnddqXcrrW9lZShSfRzQxy0IAF0oHgi+OUzFcoL6RNWP/rxIGyfq1eTlL4X9N6tn/enAXdmHNXLGqkp0g2nttFckq079sIdmdQ0ARjbkFE9HKgpYWzq/L+VPxBIC8ynjxPsHOqtk87kL/Q==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=fPRYDQ1t4FGIKh4qAc65pN2usoZ60twgiozHdseL2O0=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:21 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 08/12] Rename two remote variables confusingly named
 'generations'.
Date: Fri,  8 Mar 2024 02:12:04 -0600
Message-ID: <fb0fc5e3cd2ee69221b0e443e9c905e72995cf30.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

Both refer to data sets returned from the remote expression, and one of the=
m
shadowed an element of itself.

* gnu/machine/ssh.scm (machine->boot-alternatives): Rename generations
  to remote-results.

Change-Id: Ibd8a3036126d9da1215cfc191884c0f54df637df
---
 gnu/machine/ssh.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 11534c6740..9adb5e79b9 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -451,10 +451,10 @@ (define (machine->boot-alternatives machine)
                            (read-file boot-parameters-path))))
                  (reverse (generation-numbers %system-profile)))))))
=20
-  (mlet* %store-monad ((generations (machine-remote-eval machine remote-ex=
p)))
+  (mlet* %store-monad ((remote-results (machine-remote-eval machine remote=
-exp)))
     (return
-     (map (lambda (generation)
-            (match generation
+     (map (lambda (remote-result)
+            (match remote-result
               ((generation system-path epoch serialized-params)
                (let* ((params (call-with-input-string serialized-params
                                 read-boot-parameters))
@@ -467,7 +467,7 @@ (define (machine->boot-alternatives machine)
                   (kernel-arguments
                    (append (bootable-kernel-arguments system-path root ver=
sion)
                            (boot-parameters-kernel-arguments params)))))))=
)
-          generations))))
+          remote-results))))
=20
 (define-syntax-rule (with-roll-back should-roll-back? mbody ...)
   "Catch exceptions that arise when binding MBODY, a monadic expression in
--=20
2.41.0





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

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:32 2024
Received: from localhost ([127.0.0.1]:56393 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVXn-0002aM-9M
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:31 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:50366)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVXl-0002ZW-Qo
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:30 -0500
DKIM-Signature: a=rsa-sha256;
 b=mU98KtS29DZEdku2rgYteoeMmM+q/In207TJ8QM4Gg6AqE2272Qc/HJSJJqwvdEvU2w+BO2ocJen0XA3aJV57HXFHGLsKj3a+9BJiuYvlc8L7yjmYiSMCfJbBnSo0dRJ9OHaXhoZm7gLU9jeWEZV4tN4gT2XGJfQv9+Vk2j9H4YM6pFe7CrogTt+mEgLP60O+WfjIAD7TW9CCwBmM4LweEDj2fjkREIM/DvG71+wrz5DN1H28qG2G0sWvxaK5yVDrsrxrxaq2yoqejfBX7D+OrbyMHyoeW3wOp3pILROHKn3go3Mr40M06fUG9U9TmJ1IACekVTWlCqiaImDK4Goyw==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=poPtLk1Ci8MIhvsA44gDhFg36hV5E3a1KO86FEWjKME=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=XCl2T1RDXJpQXc7rVElhMEjjOoFOm/V+a6z7lrtZtKBKA1iMDTW7WctFOyXoiFoziJhDIezquTofrLubekR1gYZ7WoVA7BTYZqj8BOcpE9/U8YRf5s9+EOWY58wvB/rSqA6QaZh1V+JZoSVAO5Zn5l4rmBhf83bQuz0hyzqHnydbjE/JM8HKwaUUTYN7H5mUheR2ISeDiNCOS8tXlA1f3mgHvh18F1Wx5N7/a9Hb+S7oKr1NQpQ7y2MlFdmuH2EEk11eg1R3aE5KyTh+AwgHa4PLEgXWGKj7FLeHRMh0pPDNlUZFXc4SH6ZDy232aWSFp+mqq7OxTDOTmcy18FQC4A==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=poPtLk1Ci8MIhvsA44gDhFg36hV5E3a1KO86FEWjKME=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:19 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 06/12] Offer a uniform decorated-boot-label and use it.
Date: Fri,  8 Mar 2024 02:12:02 -0600
Message-ID: <1aa5fb52ea0aaf3cffc990737140d7c169cb96c2.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

* gnu/system/boot.scm (decorated-boot-label): New procedure.
* gnu/machine/ssh.scm (machine-boot-parameters): Use
  decorated-boot-label.
* guix/scripts/system.scm
  (profile-boot-parameters)[system->boot-parameters]: Use
  decorated-boot-label.

Change-Id: Id348c3047df2353f76b1bad0eb2a3e0fa17e474c
---
 gnu/machine/ssh.scm     |  8 ++------
 gnu/system/boot.scm     | 13 +++++++++++++
 guix/scripts/system.scm |  8 +++-----
 3 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 449b65dbfb..fe47474470 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -459,15 +459,11 @@ (define (machine-boot-parameters machine)
                (let* ((params (call-with-input-string serialized-params
                                 read-boot-parameters))
                       (root (boot-parameters-root-device params))
-                      (label (boot-parameters-label params))
+                      (text (boot-parameters-label params))
                       (version (boot-parameters-version params)))
                  (boot-parameters
                   (inherit params)
-                  (label
-                   (string-append label " (#"
-                                  (number->string generation) ", "
-                                  (epoch->date-string epoch)
-                                  ")"))
+                  (label (decorated-boot-label text generation epoch))
                   (kernel-arguments
                    (append (bootable-kernel-arguments system-path root ver=
sion)
                            (boot-parameters-kernel-arguments params)))))))=
)
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 972f83febc..b39e7d8610 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -71,6 +71,7 @@ (define-module (gnu system boot)
             read-boot-parameters-file
=20
             epoch->date-string
+            decorated-boot-label
             boot-parameters->menu-entry
=20
             ensure-not-/dev
@@ -282,6 +283,18 @@ (define (epoch->date-string epoch)
     (date->string (time-utc->date time)
                   "~Y-~m-~d ~H:~M")))
=20
+(define (decorated-boot-label text generation epoch)
+  "Return a string for a nice boot label that includes TEXT, a numbered GE=
NERATION,
+and a timestamp derived from EPOCH seconds."
+  (let* ((numbered (lambda (number) (string-append "#" (number->string num=
ber))))
+         (count (and=3D> generation numbered))
+         (timestamp (and=3D> epoch epoch->date-string))
+         (extras (filter identity (list count timestamp)))
+         (helpful (if (null? extras)
+                      ""
+                      (string-append "(" (string-join extras ", ") ")"))))
+    (string-join (list text helpful))))
+
 (define (boot-parameters->menu-entry conf)
   "Return a <menu-entry> instance given CONF, a <boot-parameters> instance=
."
   (let* ((kernel (boot-parameters-kernel conf))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 47c072ba5c..09d29dbbb1 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -332,12 +332,10 @@ (define* (profile-boot-parameters #:optional (profile=
 %system-profile)
   (define (system->boot-parameters system number epoch)
     (unless-file-not-found
      (let* ((params           (read-boot-parameters-file system))
-            (label            (boot-parameters-label params)))
+            (text             (boot-parameters-label params)))
        (boot-parameters
-         (inherit params)
-         (label (string-append label " (#"
-                               (number->string number) ", "
-                               (epoch->date-string epoch) ")"))))))
+        (inherit params)
+        (label (decorated-boot-label text number epoch))))))
   (let* ((systems (map (cut generation-file-name profile <>)
                        numbers))
          (times   (map (lambda (system)
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:16 2024
Received: from localhost ([127.0.0.1]:56372 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVXX-0002Yp-MH
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:16 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:44420)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVXR-0002Xh-Pf
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:12 -0500
DKIM-Signature: a=rsa-sha256;
 b=NYjvTWOoNOHhobAvEz2lexrd02AD9HC6rlcjEnVLFvkkOHYsCL+RX1YU3bfvgIAoCgPTGB7WUF/gYr8K3F44C3yRJKSH873Gw1ZvVpGwc1iU0bIhd3xNPBfNX/U/3tG1jW9tq+oaCWgVm522fgXPqnVWCI9qo78supkvdU1GATnjNcfFigK6StSDQIjbKXO2POcN+Q5w4feAVTcgIK/kXqA0OingClJy56YGYPW+FlcKXwx5vqlliU+upajFOVS1dEENuwCr/3wggxaWGwvkIQMoDEp26ihV8zocWsDrnSxhG8pqSz9gIyKMt08HCCI5moqqtpJMhxkBzRlOM1iUNA==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=/VJhDQboy/jow/7qyOsO5u1Zdw4fsR4EolZBMKglkVY=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=IdIhwC0pornuvEjfXN/L3xm+Dx18ygeWnHXFLnABey5XTPsL6+DlMIMyEk2BKvxasB1e/Uhiuwd4G4CJMQE5BQnU/R8kPpHAF3HitSaBlmsaGHlC06qsfdStWEIalvnrjSQ2fTQSlwybPsLNBF9f+16PsbwIsndWRQ8Cj9fWaPRrk/3SuRwNvZz/8JbOm3ScJgvbxqtVsLu2+QelyjojicXXneAnfyrcVqadnsS11qXzvtxOBjgpEzfBIx7Vt+8hcgK8SyykDeCZJS7O43DyU9SYT5FLm3Y6h/hMdH97JDhg+aF1TXR8/8PUYdvld401ZqNpNyeWXv6n3RtX6l1HCw==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=/VJhDQboy/jow/7qyOsO5u1Zdw4fsR4EolZBMKglkVY=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:18 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 03/12] Also move boot-parameters->menu-entry.
Date: Fri,  8 Mar 2024 02:11:59 -0600
Message-ID: <3ea3ac3e5c436726d19ea4df603f88d0bc861c2e.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

* gnu/system.scm (boot-parameters->menu-entry): Move to...
* gnu/system/boot.scm (boot-parameters->menu-entry): ...here.

Change-Id: I794198e074b6d3012526a3056599ee3db1f1cdba
---
 gnu/system.scm      | 28 ----------------------------
 gnu/system/boot.scm | 25 ++++++++++++++++++++++++-
 2 files changed, 24 insertions(+), 29 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 048f9090e0..11f8e06cc0 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -149,8 +149,6 @@ (define-module (gnu system)
=20
             hurd-default-essential-services
=20
-            boot-parameters->menu-entry
-
             local-host-aliases                    ;deprecated
             %root-account
             %setuid-programs
@@ -303,32 +301,6 @@ (define* (operating-system-kernel-arguments
   (append (bootable-kernel-arguments os root-device version)
           (operating-system-user-kernel-arguments os)))
=20
-=0C
-;;;
-;;; Boot parameters
-;;;
-
-(define (boot-parameters->menu-entry conf)
-  "Return a <menu-entry> instance given CONF, a <boot-parameters> instance=
."
-  (let* ((kernel (boot-parameters-kernel conf))
-         (multiboot-modules (boot-parameters-multiboot-modules conf))
-         (multiboot? (pair? multiboot-modules)))
-    (menu-entry
-     (label (boot-parameters-label conf))
-     (device (boot-parameters-store-device conf))
-     (device-mount-point (boot-parameters-store-mount-point conf))
-     (linux (and (not multiboot?) kernel))
-     (linux-arguments (if (not multiboot?)
-                          (boot-parameters-kernel-arguments conf)
-                          '()))
-     (initrd (boot-parameters-initrd conf))
-     (multiboot-kernel (and multiboot? kernel))
-     (multiboot-arguments (if multiboot?
-                              (boot-parameters-kernel-arguments conf)
-                              '()))
-     (multiboot-modules (if multiboot?
-                            (boot-parameters-multiboot-modules conf)
-                            '())))))
=20
 =0C
 ;;;
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 3f227ab801..a3b9cce7d2 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -69,6 +69,8 @@ (define-module (gnu system boot)
             read-boot-parameters
             read-boot-parameters-file
=20
+            boot-parameters->menu-entry
+
             ensure-not-/dev
             system-linux-image-file-name))
=20
@@ -272,6 +274,28 @@ (define (read-boot-parameters-file system)
      (kernel-arguments (append (bootable-kernel-arguments system root vers=
ion)
                                (boot-parameters-kernel-arguments params)))=
)))
=20
+(define (boot-parameters->menu-entry conf)
+  "Return a <menu-entry> instance given CONF, a <boot-parameters> instance=
."
+  (let* ((kernel (boot-parameters-kernel conf))
+         (multiboot-modules (boot-parameters-multiboot-modules conf))
+         (multiboot? (pair? multiboot-modules)))
+    (menu-entry
+     (label (boot-parameters-label conf))
+     (device (boot-parameters-store-device conf))
+     (device-mount-point (boot-parameters-store-mount-point conf))
+     (linux (and (not multiboot?) kernel))
+     (linux-arguments (if (not multiboot?)
+                          (boot-parameters-kernel-arguments conf)
+                          '()))
+     (initrd (boot-parameters-initrd conf))
+     (multiboot-kernel (and multiboot? kernel))
+     (multiboot-arguments (if multiboot?
+                              (boot-parameters-kernel-arguments conf)
+                              '()))
+     (multiboot-modules (if multiboot?
+                            (boot-parameters-multiboot-modules conf)
+                            '())))))
+
 (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
@@ -292,5 +316,4 @@ (define* (system-linux-image-file-name #:optional
    ((string-prefix? "riscv64" target) "Image")
    (else "bzImage")))
=20
-
 ;;; boot.scm ends here
--=20
2.41.0





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

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:15 2024
Received: from localhost ([127.0.0.1]:56370 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVXX-0002Ye-4I
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:15 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:44418)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVXR-0002Xg-Of
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:11 -0500
DKIM-Signature: a=rsa-sha256;
 b=gLVzM1zGhiQ9WgYBAy29LSF4viAbJoH+TXnDBOVDpjTFKbmnnTsI86nGoQwwiJhdhVE1aS4hsR6TkmTjAJH691b1NRKccnosAHmG8OTQNgk0Mm2ch5vkrHgKVJCqkTxUTcRJQD8fq7FWRg+KRH5GWlnYayqWj1pT+RpLWQNVXiovzK9Xy67b7PyIvcvrM14ggnkTSSaHBbLN7PpctB6Uh2F+fK98WCVsrnw+T6/eq0AzRxM/l8Kb7OEoFS1TSt5tfJ4qJQQRuCzQerqdbVd42vcjODKcbqEtW9605EenIHBhy27SWRrCf4sN5z073O9WrmwAa00Kp0ZiA4um1VbN3w==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=yEDLaxiClk5A/4ERY/W66d4e66DIcQftqZRfjB50bwM=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=aP8vWf5YA0ex2gT6ZsOOA3LiN9pAJceEOtSx/MZjRADqqIYVOuhjKEePLCFSHBUPFFAsv/LqLeO8EeZoLGlazoNVW3YMLcjwoDb8mQCdXzuD6c2QGh3jNW7TqJE5SIBuFoQV9so+3KJDb3BMzrbjknybkCO3RyEUIb/s58qT6s0V0b+ON2IEMmWacbQoj1bZKj3bpdjwvkAHLCPlQjZppXeCsFZjIe6K3nW4fazGUBKD5hZp6Kc70FV8nfVcR6QaYltnwdcIiPAj5YufUkKWK4JgLr7Ygc6E39XISg6Wm/LO4hjMMkqQhpI6j9DH7N0gw0sZyjHO0rSdvAKBgFBXAw==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=yEDLaxiClk5A/4ERY/W66d4e66DIcQftqZRfjB50bwM=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:18 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 04/12] Rename seconds->string procedure to
 epoch->date-string.
Date: Fri,  8 Mar 2024 02:12:00 -0600
Message-ID: <df3d6fa439d4ccdcf6b379c1bfa27913ee3e8e90.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

* guix/scripts/system.scm (seconds->string): Rename to
  epoch->date-string.
  (profile-boot-parameters)[boot-parameters]: Update as above.

Change-Id: I2b9aaa816b3ca84c32f7d6fa690245b149228310
---
 guix/scripts/system.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 40df166fd7..86ee2ddc76 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,9 +323,9 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
=20
-(define (seconds->string seconds)
-  "Return a string representing the date for SECONDS."
-  (let ((time (make-time time-utc 0 seconds)))
+(define (epoch->date-string epoch)
+  "Return a string representing the date for EPOCH seconds."
+  (let ((time (make-time time-utc 0 epoch)))
     (date->string (time-utc->date time)
                   "~Y-~m-~d ~H:~M")))
=20
@@ -343,7 +343,7 @@ (define* (profile-boot-parameters #:optional (profile %=
system-profile)
          (inherit params)
          (label (string-append label " (#"
                                (number->string number) ", "
-                               (seconds->string time) ")"))))))
+                               (epoch->date-string time) ")"))))))
   (let* ((systems (map (cut generation-file-name profile <>)
                        numbers))
          (times   (map (lambda (system)
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:15 2024
Received: from localhost ([127.0.0.1]:56368 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVXV-0002Ya-MF
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:15 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:50344)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVXR-0002Xe-OE
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:11 -0500
DKIM-Signature: a=rsa-sha256;
 b=RjSiK+MgUddl1a9F9XMtBhKj/vu9JAbHLRx95ted8ja7xzo5/PfK3YiUZGw35SxHub+5GPPKDf2o0EiXSoOGOIhvMqhYIVfcFoPR6MXTr3cF8IYactiddRs5/cY/GF45zPVx6Z5jMoN9BAizuEyv9z5YXRraCyah6PFPCOyT+QRGsIjHML2MfCP/WhOVA4vctq9rX97849SmT3Nxsh0cp6pg9Byj3Gcj8YPKESYkuHqCIWyvacSOYXkJmf/WEaV/9Rd6FBM5o0dt0RElSY48iDByPyoitX0cZ3U7TNq69JIxlSdna4msyoC0+JDNx3VMakvVNoXWVkFON5rm493TEg==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=LlLVHVpoc6KGb1tSNTAA3cHJ7lukUtLNNYgewojkPGs=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=QSbiSDnpvjPKEg6Yl7zAt5+nyGPx8MSFIoLz1dKwSQWH6iVbclu6NqZMc4XCNpXMdEjHLjqNnc85mHomFJGrRKNu4Jguro4Udh4dCgChcqZ5Y+f0q70fFhY1hSMhmUTZL4FHrBPmO451f7NzydAgUpqYVeGDODDL0FFhPjzXh/VNL0u1MXS3/24FZNRNpcJl2lddmIXPSK58NJi0iSsFccLKCxzzxTnSlKW7NvrvthTtAvC+rhhbK0o7AUjBQ3yY64OBfck8Xo6sKbisax9Ff1eXL1DacPQaFMjekI2hWu1qzcTHepWWvVTYze82bY27B6+5vgU1Z5BrGdasFR8s+w==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=LlLVHVpoc6KGb1tSNTAA3cHJ7lukUtLNNYgewojkPGs=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:17 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 02/12] Move <boot-parameters> record to a separate file.
Date: Fri,  8 Mar 2024 02:11:58 -0600
Message-ID: <3dd7292b65fad15b1f808a22a7cc73560ee7d4b4.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

Required to avoid a missing dependency error on build-side.

* gnu/system.scm (<boot-parameters>): Move this record, and...
  (system-linux-image-file-name, %boot-parameters-version,
  ensure-not-/dev, read-boot-parameters,
  read-boot-parameters-file): ...these procedures, to...

* gnu/system/boot.scm: ...this new file.

* gnu/machine/ssh.scm, gnu/system.scm, guix/scripts/system.scm,
  tests/boot-parameters.scm: Use new module above.

Change-Id: I6944ffd4c323c776005b0cef23218bffae59be23
---
 gnu/machine/ssh.scm       |   1 +
 gnu/system.scm            | 236 +-----------------------------
 gnu/system/boot.scm       | 296 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |   1 +
 tests/boot-parameters.scm |   1 +
 5 files changed, 300 insertions(+), 235 deletions(-)
 create mode 100644 gnu/system/boot.scm

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index b47ce7c225..0ffe71367c 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -23,6 +23,7 @@ (define-module (gnu machine ssh)
   #:use-module (gnu machine)
   #:autoload   (gnu packages gnupg) (guile-gcrypt)
   #:use-module (gnu system)
+  #:use-module (gnu system boot)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
   #:use-module ((gnu services) #:select (sexp->system-provenance))
diff --git a/gnu/system.scm b/gnu/system.scm
index aede35775e..048f9090e0 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -70,6 +70,7 @@ (define-module (gnu system)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services base)
   #:use-module (gnu bootloader)
+  #:use-module (gnu system boot)
   #:use-module (gnu system shadow)
   #:use-module (gnu system nss)
   #:use-module (gnu system locale)
@@ -143,31 +144,11 @@ (define-module (gnu system)
             operating-system-boot-script
             operating-system-uuid
=20
-            system-linux-image-file-name
             operating-system-with-gc-roots
             operating-system-with-provenance
=20
             hurd-default-essential-services
=20
-            boot-parameters
-            boot-parameters?
-            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
-            boot-parameters-store-mount-point
-            boot-parameters-locale
-            boot-parameters-kernel
-            boot-parameters-kernel-arguments
-            boot-parameters-initrd
-            boot-parameters-multiboot-modules
-            boot-parameters-version
-            %boot-parameters-version
-            read-boot-parameters
-            read-boot-parameters-file
             boot-parameters->menu-entry
=20
             local-host-aliases                    ;deprecated
@@ -327,210 +308,6 @@ (define* (operating-system-kernel-arguments
 ;;; Boot parameters
 ;;;
=20
-;;; Version 1 was introduced early 2022 to mark the departure from long op=
tion
-;;; names such as '--load' to the more conventional initrd option names li=
ke
-;;; 'gnu.load'.
-;;;
-;;; When bumping the boot-parameters version, increment it by one (1).
-(define %boot-parameters-version 1)
-
-(define-record-type* <boot-parameters>
-  boot-parameters make-boot-parameters boot-parameters?
-  (label            boot-parameters-label)
-  ;; Because we will use the 'store-device' to create the GRUB search comm=
and,
-  ;; the 'store-device' has slightly different semantics than 'root-device=
'.
-  ;; The 'store-device' can be a file system uuid, a file system label, or=
 #f,
-  ;; but it cannot be a device file name such as "/dev/sda3", since GRUB w=
ould
-  ;; not understand that.  The 'root-device', on the other hand, correspon=
ds
-  ;; exactly to the device field of the <file-system> object representing =
the
-  ;; OS's root file system, so it might be a device file name like
-  ;; "/dev/sda3".  The 'store-directory-prefix' field contains #f or the s=
tore
-  ;; file name inside the 'store-device' as it is seen by GRUB, e.g. it wo=
uld
-  ;; contain "/storefs" if the store is located in that subvolume of a btr=
fs
-  ;; 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)
-  (store-crypto-devices boot-parameters-store-crypto-devices
-                        (default '()))
-  (locale           boot-parameters-locale)
-  (kernel           boot-parameters-kernel)
-  (kernel-arguments boot-parameters-kernel-arguments)
-  (initrd           boot-parameters-initrd)
-  (multiboot-modules boot-parameters-multiboot-modules)
-  (version          boot-parameters-version  ;positive integer
-                    (default %boot-parameters-version)))
-
-(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
-file system labels."
-  (if (and (string? device) (string-prefix? "/" device))
-      #f
-      device))
-
-(define (read-boot-parameters port)
-  "Read boot parameters from PORT and return the corresponding
-<boot-parameters> object.  Raise an error if the format is unrecognized."
-  (define device-sexp->device
-    (match-lambda
-      (('uuid (? symbol? type) (? bytevector? bv))
-       (bytevector->uuid bv type))
-      (('file-system-label (? string? label))
-       (file-system-label label))
-      ((? bytevector? bv)                         ;old format
-       (bytevector->uuid bv 'dce))
-      ((? string? device)
-       (if (string-contains device ":/")
-           device ; nfs-root
-           ;; It used to be that we would not distinguish between labels a=
nd
-           ;; device names.  Try to infer the right thing here.
-           (if (string-prefix? "/" device)
-               device
-               (file-system-label device))))))
-  (define uuid-sexp->uuid
-    (match-lambda
-      (('uuid (? symbol? type) (? bytevector? bv))
-       (bytevector->uuid bv type))
-      (x
-       (warning (G_ "unrecognized uuid ~a at '~a'~%") x (port-filename por=
t))
-       #f)))
-
-  ;; New versions are not backward-compatible, so only accept past and cur=
rent
-  ;; versions, not future ones.
-  (define (version? n)
-    (member n (iota (1+ %boot-parameters-version))))
-
-  (match (read port)
-    (('boot-parameters ('version (? version? version))
-                       ('label label) ('root-device root)
-                       ('kernel kernel)
-                       rest ...)
-     (boot-parameters
-      (version version)
-      (label label)
-      (root-device (device-sexp->device root))
-
-      (bootloader-name
-       (match (assq 'bootloader-name rest)
-         ((_ 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 o=
f
-      ;; the absolute file name of its image.  Detect that and correct it.
-      (kernel (if (string=3D? kernel (direct-store-path kernel))
-                  (string-append kernel "/"
-                                 (system-linux-image-file-name))
-                  kernel))
-
-      (kernel-arguments
-       (match (assq 'kernel-arguments rest)
-         ((_ args) args)
-         (#f       '())))                         ;the old format
-
-      (initrd
-       (match (assq 'initrd rest)
-         (('initrd ('string-append directory file)) ;the old format
-          (string-append directory file))
-         (('initrd (? string? file))
-          file)
-         (#f #f)))
-
-      (multiboot-modules
-       (match (assq 'multiboot-modules rest)
-         ((_ args) args)
-         (#f       '())))
-
-      (locale
-       (match (assq 'locale rest)
-         ((_ locale) locale)
-         (#f         #f)))
-
-      (store-device
-       ;; Linux device names like "/dev/sda1" are not suitable GRUB device
-       ;; identifiers, so we just filter them out.
-       (ensure-not-/dev
-        (match (assq 'store rest)
-          (('store ('device #f) _ ...)
-           root-device)
-          (('store ('device device) _ ...)
-           (device-sexp->device device))
-          (_                                      ;the old format
-           root-device))))
-
-      (store-directory-prefix
-       (match (assq 'store rest)
-         (('store . store-data)
-          (match (assq 'directory-prefix store-data)
-            (('directory-prefix prefix) prefix)
-            ;; No directory-prefix found.
-            (_ #f)))
-         (_
-          ;; No store found, old format.
-          #f)))
-
-      (store-crypto-devices
-       (match (assq 'store rest)
-         (('store . store-data)
-          (match (assq 'crypto-devices store-data)
-            (('crypto-devices (devices ...))
-             (map uuid-sexp->uuid devices))
-            (('crypto-devices dev)
-             (warning (G_ "unrecognized crypto-devices ~S at '~a'~%")
-                      dev (port-filename port))
-             '())
-            (_
-             ;; No crypto-devices found.
-             '())))
-         (_
-          ;; No store found, old format.
-          '())))
-
-      (store-mount-point
-       (match (assq 'store rest)
-         (('store ('device _) ('mount-point mount-point) _ ...)
-          mount-point)
-         (_                                       ;the old format
-          "/")))))
-    (x                                            ;unsupported format
-     (raise
-      (make-compound-condition
-       (formatted-message
-        (G_ "unrecognized boot parameters at '~a'~%")
-        (port-filename port))
-       (condition
-        (&fix-hint (hint (format #f (G_ "This probably means that this ver=
sion
-of Guix is older than the one that created @file{~a}.  To address this, yo=
u
-need to update Guix:
-
-@example
-guix pull
-@end example")
-                                 (port-filename port))))))))))
-
-(define (read-boot-parameters-file system)
-  "Read boot parameters from SYSTEM's (system or generation) \"parameters\=
"
-file and returns the corresponding <boot-parameters> object or #f if the
-format is unrecognized.
-The object has its kernel-arguments extended in order to make it bootable.=
"
-  (let* ((file (string-append system "/parameters"))
-         (params (call-with-input-file file read-boot-parameters))
-         (root (boot-parameters-root-device params))
-         (version (boot-parameters-version params)))
-    (boot-parameters
-     (inherit params)
-     (kernel-arguments (append (bootable-kernel-arguments system root vers=
ion)
-                               (boot-parameters-kernel-arguments params)))=
)))
-
 (define (boot-parameters->menu-entry conf)
   "Return a <menu-entry> instance given CONF, a <boot-parameters> instance=
."
   (let* ((kernel (boot-parameters-kernel conf))
@@ -692,17 +469,6 @@ (define (swap-services os)
   (map (compose swap-service filter-deps)
        (operating-system-swap-devices os)))
=20
-(define* (system-linux-image-file-name #:optional
-                                       (target (or (%current-target-system=
)
-                                                   (%current-system))))
-  "Return the basename of the kernel image file for TARGET."
-  (cond
-   ((string-prefix? "arm" target) "zImage")
-   ((string-prefix? "mips" target) "vmlinuz")
-   ((string-prefix? "aarch64" target) "Image")
-   ((string-prefix? "riscv64" target) "Image")
-   (else "bzImage")))
-
 (define (operating-system-kernel-file os)
   "Return an object representing the absolute file name of the kernel imag=
e of
 OS."
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
new file mode 100644
index 0000000000..3f227ab801
--- /dev/null
+++ b/gnu/system/boot.scm
@@ -0,0 +1,296 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright =C2=A9 2013-2022 Ludovic Court=C3=A8s <ludo@HIDDEN>
+;;; Copyright =C2=A9 2015 Mark H Weaver <mhw@HIDDEN>
+;;; Copyright =C2=A9 2015, 2016 Alex Kost <alezost@HIDDEN>
+;;; Copyright =C2=A9 2016 Chris Marusich <cmmarusich@HIDDEN>
+;;; Copyright =C2=A9 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright =C2=A9 2019 Meiyo Peng <meiyo.peng@HIDDEN>
+;;; Copyright =C2=A9 2019, 2020 Miguel =C3=81ngel Arruga Vivas <rosen64483=
5@HIDDEN>
+;;; Copyright =C2=A9 2020 Danny Milosavljevic <dannym@HIDDEN>
+;;; Copyright =C2=A9 2020, 2021 Brice Waegeneire <brice@HIDDEN>
+;;; Copyright =C2=A9 2020 Florian Pelz <pelzflorian@HIDDEN>
+;;; Copyright =C2=A9 2020, 2022 Maxim Cournoyer <maxim.cournoyer@HIDDEN=
>
+;;; Copyright =C2=A9 2020, 2023 Janneke Nieuwenhuizen <jannek@HIDDEN>
+;;; Copyright =C2=A9 2020, 2022 Efraim Flashner <efraim@HIDDEN>
+;;; Copyright =C2=A9 2021 Maxime Devos <maximedevos@HIDDEN>
+;;; Copyright =C2=A9 2021 raid5atemyhomework <raid5atemyhomework@protonmai=
l.com>
+;;; Copyright =C2=A9 2023 Bruno Victal <mirai@HIDDEN>
+;;; Copyright =C2=A9 2023 Felix Lechner <felix.lechner@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu system boot)
+  #:use-module (guix gexp)
+  #:use-module (guix diagnostics)
+  #:use-module (guix i18n)
+  #:use-module (guix records)
+  #:use-module (guix store)
+  #:use-module (guix utils)
+  #:use-module (gnu bootloader)
+  #:use-module (gnu system file-systems)
+  #:use-module (gnu system uuid)
+  #:use-module (ice-9 format)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-34)
+  #:use-module (srfi srfi-35)
+  #:use-module (rnrs bytevectors)
+  #:export (boot-parameters
+            boot-parameters?
+            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
+            boot-parameters-store-mount-point
+            boot-parameters-locale
+            boot-parameters-kernel
+            boot-parameters-kernel-arguments
+            boot-parameters-initrd
+            boot-parameters-multiboot-modules
+            boot-parameters-version
+            %boot-parameters-version
+
+            read-boot-parameters
+            read-boot-parameters-file
+
+            ensure-not-/dev
+            system-linux-image-file-name))
+
+;;;
+;;; Boot parameters
+;;;
+
+;;; Version 1 was introduced early 2022 to mark the departure from long op=
tion
+;;; names such as '--load' to the more conventional initrd option names li=
ke
+;;; 'gnu.load'.
+;;;
+;;; When bumping the boot-parameters version, increment it by one (1).
+(define %boot-parameters-version 1)
+
+(define-record-type* <boot-parameters>
+  boot-parameters make-boot-parameters boot-parameters?
+  (label            boot-parameters-label)
+  ;; Because we will use the 'store-device' to create the GRUB search comm=
and,
+  ;; the 'store-device' has slightly different semantics than 'root-device=
'.
+  ;; The 'store-device' can be a file system uuid, a file system label, or=
 #f,
+  ;; but it cannot be a device file name such as "/dev/sda3", since GRUB w=
ould
+  ;; not understand that.  The 'root-device', on the other hand, correspon=
ds
+  ;; exactly to the device field of the <file-system> object representing =
the
+  ;; OS's root file system, so it might be a device file name like
+  ;; "/dev/sda3".  The 'store-directory-prefix' field contains #f or the s=
tore
+  ;; file name inside the 'store-device' as it is seen by GRUB, e.g. it wo=
uld
+  ;; contain "/storefs" if the store is located in that subvolume of a btr=
fs
+  ;; 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)
+  (store-crypto-devices boot-parameters-store-crypto-devices
+                        (default '()))
+  (locale           boot-parameters-locale)
+  (kernel           boot-parameters-kernel)
+  (kernel-arguments boot-parameters-kernel-arguments)
+  (initrd           boot-parameters-initrd)
+  (multiboot-modules boot-parameters-multiboot-modules)
+  (version          boot-parameters-version  ;positive integer
+                    (default %boot-parameters-version)))
+
+(define (read-boot-parameters port)
+  "Read boot parameters from PORT and return the corresponding
+<boot-parameters> object.  Raise an error if the format is unrecognized."
+  (define device-sexp->device
+    (match-lambda
+      (('uuid (? symbol? type) (? bytevector? bv))
+       (bytevector->uuid bv type))
+      (('file-system-label (? string? label))
+       (file-system-label label))
+      ((? bytevector? bv)                         ;old format
+       (bytevector->uuid bv 'dce))
+      ((? string? device)
+       (if (string-contains device ":/")
+           device ; nfs-root
+           ;; It used to be that we would not distinguish between labels a=
nd
+           ;; device names.  Try to infer the right thing here.
+           (if (string-prefix? "/" device)
+               device
+               (file-system-label device))))))
+  (define uuid-sexp->uuid
+    (match-lambda
+      (('uuid (? symbol? type) (? bytevector? bv))
+       (bytevector->uuid bv type))
+      (x
+       (warning (G_ "unrecognized uuid ~a at '~a'~%") x (port-filename por=
t))
+       #f)))
+
+  ;; New versions are not backward-compatible, so only accept past and cur=
rent
+  ;; versions, not future ones.
+  (define (version? n)
+    (member n (iota (1+ %boot-parameters-version))))
+
+  (match (read port)
+    (('boot-parameters ('version (? version? version))
+                       ('label label) ('root-device root)
+                       ('kernel kernel)
+                       rest ...)
+     (boot-parameters
+      (version version)
+      (label label)
+      (root-device (device-sexp->device root))
+
+      (bootloader-name
+       (match (assq 'bootloader-name rest)
+         ((_ 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 o=
f
+      ;; the absolute file name of its image.  Detect that and correct it.
+      (kernel (if (string=3D? kernel (direct-store-path kernel))
+                  (string-append kernel "/"
+                                 (system-linux-image-file-name))
+                  kernel))
+
+      (kernel-arguments
+       (match (assq 'kernel-arguments rest)
+         ((_ args) args)
+         (#f       '())))                         ;the old format
+
+      (initrd
+       (match (assq 'initrd rest)
+         (('initrd ('string-append directory file)) ;the old format
+          (string-append directory file))
+         (('initrd (? string? file))
+          file)
+         (#f #f)))
+
+      (multiboot-modules
+       (match (assq 'multiboot-modules rest)
+         ((_ args) args)
+         (#f       '())))
+
+      (locale
+       (match (assq 'locale rest)
+         ((_ locale) locale)
+         (#f         #f)))
+
+      (store-device
+       ;; Linux device names like "/dev/sda1" are not suitable GRUB device
+       ;; identifiers, so we just filter them out.
+       (ensure-not-/dev
+        (match (assq 'store rest)
+          (('store ('device #f) _ ...)
+           root-device)
+          (('store ('device device) _ ...)
+           (device-sexp->device device))
+          (_                                      ;the old format
+           root-device))))
+
+      (store-directory-prefix
+       (match (assq 'store rest)
+         (('store . store-data)
+          (match (assq 'directory-prefix store-data)
+            (('directory-prefix prefix) prefix)
+            ;; No directory-prefix found.
+            (_ #f)))
+         (_
+          ;; No store found, old format.
+          #f)))
+
+      (store-crypto-devices
+       (match (assq 'store rest)
+         (('store . store-data)
+          (match (assq 'crypto-devices store-data)
+            (('crypto-devices (devices ...))
+             (map uuid-sexp->uuid devices))
+            (('crypto-devices dev)
+             (warning (G_ "unrecognized crypto-devices ~S at '~a'~%")
+                      dev (port-filename port))
+             '())
+            (_
+             ;; No crypto-devices found.
+             '())))
+         (_
+          ;; No store found, old format.
+          '())))
+
+      (store-mount-point
+       (match (assq 'store rest)
+         (('store ('device _) ('mount-point mount-point) _ ...)
+          mount-point)
+         (_                                       ;the old format
+          "/")))))
+    (x                                            ;unsupported format
+     (raise
+      (make-compound-condition
+       (formatted-message
+        (G_ "unrecognized boot parameters at '~a'~%")
+        (port-filename port))
+       (condition
+        (&fix-hint (hint (format #f (G_ "This probably means that this ver=
sion
+of Guix is older than the one that created @file{~a}.  To address this, yo=
u
+need to update Guix:
+
+@example
+guix pull
+@end example")
+                                 (port-filename port))))))))))
+
+(define (read-boot-parameters-file system)
+  "Read boot parameters from SYSTEM's (system or generation) \"parameters\=
"
+file and returns the corresponding <boot-parameters> object or #f if the
+format is unrecognized.
+The object has its kernel-arguments extended in order to make it bootable.=
"
+  (let* ((file (string-append system "/parameters"))
+         (params (call-with-input-file file read-boot-parameters))
+         (root (boot-parameters-root-device params))
+         (version (boot-parameters-version params)))
+    (boot-parameters
+     (inherit params)
+     (kernel-arguments (append (bootable-kernel-arguments system root vers=
ion)
+                               (boot-parameters-kernel-arguments params)))=
)))
+
+(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
+file system labels."
+  (if (and (string? device) (string-prefix? "/" device))
+      #f
+      device))
+
+;; XXX: defined here instead of (gnu system) to prevent dependency loop
+(define* (system-linux-image-file-name #:optional
+                                       (target (or (%current-target-system=
)
+                                                   (%current-system))))
+  "Return the basename of the kernel image file for TARGET."
+  (cond
+   ((string-prefix? "arm" target) "zImage")
+   ((string-prefix? "mips" target) "vmlinuz")
+   ((string-prefix? "aarch64" target) "Image")
+   ((string-prefix? "riscv64" target) "Image")
+   (else "bzImage")))
+
+
+;;; boot.scm ends here
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 955dfa618d..40df166fd7 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -66,6 +66,7 @@ (define-module (guix scripts system)
   #:use-module (gnu image)
   #:use-module (gnu system)
   #:use-module (gnu bootloader)
+  #:use-module (gnu system boot)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system image)
   #:use-module (gnu system mapped-devices)
diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm
index 03a1d01aff..2e7976aa6c 100644
--- a/tests/boot-parameters.scm
+++ b/tests/boot-parameters.scm
@@ -27,6 +27,7 @@ (define-module (test-boot-parameters)
   #:use-module (gnu bootloader)
   #:use-module (gnu bootloader grub)
   #:use-module (gnu system)
+  #:use-module (gnu system boot)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
   #:use-module ((guix diagnostics) #:select (formatted-message?))
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:25:12 2024
Received: from localhost ([127.0.0.1]:56366 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVXU-0002YP-AU
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:12 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:50346)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVXR-0002Xf-Of
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:25:11 -0500
DKIM-Signature: a=rsa-sha256;
 b=pdcFJh5Fc8pKi2pNnxOxq5vAZFLBnShAyu4z1xS8PUwIDq45BBpiPSLlS6cMYZHWjSG3oaEtPfJbkKQUWRbw2z+lpVlp1J+LNiskJEFuXBKXJLgLw1w3D/I1dEtJ2ei3g/mS58AyMJv4zBjIyWnVgPEE50zxoCDYtblbD1IoXCD3igUqIGf97W7AzSYs75bdia6iYIWeEvyGEXz3kHW68/47ihDfEm/QdWSXss/4QxSXluEQ3Zzwg009OjkIQCLEYkoCA/XT4Zi5fIxUTL4KyZRPBhwm1A/SbIE9hRrIejKRAha6m+EHvdanv6XlJF8ayaUPj0mpJnVCitm4UJzCog==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=fCEMsAZDlsjjuNAiHe2ZCGN4mX7EqE0z1rJPWXBnl3o=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=KS1khdGaxkbH2I0kmQ/I2NB05kcxslg8Zl5T5oDQsSTBqQAowMUcL0WRd9rGNb6lOU0utJPRLjQ0SsJlyCQIqE+E8O+H46UX2W4648tDAzPAG3/v62ezCnOlVYDTlwNg2lj0Ds5z8K8O1t31WZrN73rimPWmuCZKfyiO9DZh4fVKqZIF8ysW59EJ24OofRAMECUap9vUgHDLYJIU5dPxDKfttUwhDVhVHDCcv5Xw9x1U87aEmSE7Tn8JxwOsaLw/SDN0fYMLFu8LBStTRkipKo7dl8YFZvI299+wCMtkTthXGGYQCwkV5joSje30rCD5VNZs09bz8LOrX570TMe0Kg==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=fCEMsAZDlsjjuNAiHe2ZCGN4mX7EqE0z1rJPWXBnl3o=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:24:16 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 01/12] Fix bug where the extra menu entries for a
 bootloader were shown twice.
Date: Fri,  8 Mar 2024 02:11:57 -0600
Message-ID: <8dc29d9f104ed8b62c7b952b5dcc99de8c216c8a.1709885528.git.lilah@HIDDEN>
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

From: Felix Lechner <felix.lechner@HIDDEN>

The extra menu entries are already being added in each bootloaders, as
applicable.

* guix/scripts/system.scm (reinstall-bootloader)[entries]: Don't
  extraneously include bootloader-configuration-menu-entries here.

Change-Id: I8a600f2a5836ab4f7db5e27e25b0b8f432c3e1e0
---
 guix/scripts/system.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index bf3d2f9044..955dfa618d 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -407,8 +407,7 @@ (define (reinstall-bootloader store number)
           (delv number (reverse (generation-numbers %system-profile))))
          (old-params (profile-boot-parameters
                        %system-profile old-generations))
-         (entries (cons (boot-parameters->menu-entry params)
-                        (boot-parameters-bootloader-menu-entries params)))
+         (entries (list (boot-parameters->menu-entry params)))
          (old-entries (map boot-parameters->menu-entry old-params)))
     (run-with-store store
       (mlet* %store-monad
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:24:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 03:24:33 2024
Received: from localhost ([127.0.0.1]:56339 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1riVWq-0002Vp-Sw
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:24:33 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:50210)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1riVWn-0002VR-VP
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 03:24:31 -0500
Authentication-Results: purelymail.com; auth=pass
DKIM-Signature: a=rsa-sha256;
 b=kpSNmRgJ0MFOo8DkdMxkoo0PZ3wii9E06WMlCJSzAbrDI6FFQJu89niWMuG+7kWwcjsBOuuYpdPeMGjWsbh/HnYNZ98lsmeUTILgHCIihDdP2lacw687m5xYOrFsTZt3pRLvyr0WwqUpMZGcukSq1eu/9KDKjquR77j3Ya7U9TcGr/ESJnEDRLi3lcV7Ekr8kjA81fj8U0Th2TyyW0dOtw0lxKc5lbVBG4TXaeE6gUa/BJXeXU9yPV66ZQcu9ZcuKy847XbeTQLMf9laPu1JHB0U3OJD/giqDFqt6NpKSFD6Prqv1QhmHKaj7BUZdyyECfknl2zsHwppQL5z0LgOwQ==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=rq1YGOQ69j2PKA3HR1cP3JLqkTVj/gY4p7B5/FbTPqE=; h=Received:From:To:Subject; 
DKIM-Signature: a=rsa-sha256;
 b=QAkQORfachqouDD5vRQq31dPShbFApA9V4TooTGIwaUlSlg7nMYJv2aLv47aOq3PlrA2Ske/ZnSDxyAmQ7KqfJt41grl5s0MF8cZkXMiKodxZUo+fHk4kPsSiL/r1gdGaqhLxVNYg2nEqMx1wNhorsZT03IWtxme6T7MJDypm6H94XLlw+/Mc2cKcwo11pIQUXL3FsgUaP/TNk6fBqsFTQ1qgeZ1YmEAkiJnIpJFiL/j4bTkNuXvMLkDGVyISpcxBuRA6meD2w8WhMu/y7eYQAQ6mZObfq7r+6olCXF9NMiVEX/t9e8swKAMmzBlFMuXmwU+CpmbtO8+n3ehs/ReoQ==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=rq1YGOQ69j2PKA3HR1cP3JLqkTVj/gY4p7B5/FbTPqE=;
 h=Feedback-ID:Received:From:To:Subject; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 637763825; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 08 Mar 2024 08:23:39 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v2 00/12] Simplify bootloader data structures and procedures
Date: Fri,  8 Mar 2024 02:11:56 -0600
Message-ID: <cover.1709885528.git.lilah@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>,
 Josselin Poiret <dev@HIDDEN>, Ludovic Court??s <ludo@HIDDEN>,
 Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>,
 Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Purelymail
Content-Type: text/plain; charset=UTF-8
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Lilah Tascheter <lilah@HIDDEN>,
 Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

hey!

this is really useful!! love having access to generation numbers alongside
boot params, and the terminology fixing's great too :)

noticed a few problems - took the liberty to fix them in this v2 patch seri=
es:
* (gnu system boot) was missing a few imports that it needs to work.
* (gnu system boot) requires the procedure system-linux-image-file-name, wh=
ich
  is defined in (gnu system). I moved it over to (gnu system boot).
* generation->boot-alternative in (guix scripts system) had typos in variab=
les
  resulting in them not being used.
* commit messages didn't have relevant gnu changelog info.
* one of those commit messages had a wholeass log that's Way too much extra=
neous
  information and just got in the way when trying to look at the actual pat=
ch

this v2 passes all relevant unit tests, but could still definately use some
verification that the modified paths function properly before I'd say this =
is
ready to be merged. notably, system reconfigure and ssh managed machine
reconfigure should be verified, but then it should be good?

thanks ya!!

- lilah

Felix Lechner (12):
  Fix bug where the extra menu entries for a bootloader were shown
    twice.
  Move <boot-parameters> record to a separate file.
  Also move boot-parameters->menu-entry.
  Rename seconds->string procedure to epoch->date-string.
  Move epoch->date-string to gnu/system/boot.scm and use it elsewhere.
  Offer a uniform decorated-boot-label and use it.
  Rename boot-parameters to boot-alternatives when appropriate.
  Rename two remote variables confusingly named 'generations'.
  Give a separate name to a commonly used expression.
  Simplify profile->boot-alternatives.
  Split generation->boot-parameters out of profile->boot-alternatives.
  Encapsulate <boot-parameters> to retain generation, system-path and
    epoch.

 gnu/machine/ssh.scm       |  74 ++++----
 gnu/system.scm            | 264 +---------------------------
 gnu/system/boot.scm       | 354 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |  71 ++++----
 tests/boot-parameters.scm |   1 +
 5 files changed, 430 insertions(+), 334 deletions(-)
 create mode 100644 gnu/system/boot.scm


base-commit: 9038a46751c5090246e64b63ff752064833c435b
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 2 Mar 2024 23:46:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Mar 02 18:46:50 2024
Received: from localhost ([127.0.0.1]:39442 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rgZ46-0006CO-2q
	for submit <at> debbugs.gnu.org; Sat, 02 Mar 2024 18:46:50 -0500
Received: from sendmail.purelymail.com ([34.202.193.197]:41100)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1rgZ43-0006CA-8V
 for 69343 <at> debbugs.gnu.org; Sat, 02 Mar 2024 18:46:48 -0500
DKIM-Signature: a=rsa-sha256;
 b=Jff3V8NWa8vNPFinXgIGlIWcPTxsvtNJlA58c7aX5o/m2FKAWWFra1DXejmd4glHfB+YV7D7gKx5kIB7AiqIEeW9ecPs6JBINuAt4gQ6ADRQiwvGvEF/Xqlto26N2c8adSNwpA6EOt+7tso4hk3CpqdKggFlzoKLjV60LmhAw70soXGY0mgSYAqYLxT0jJJAZ78eiAJxclMapK8xmh6lo+M9S3P6dDVS/OV6oKuMcvsQvZaUuG9qy7C18iyf5s3slDvM/yOLRn9+w3hsmnMEwYIrpv5swz3XVRMwE4soYLHkqW/JIif6teSiFFV7KIPiDx8wFDL3Oxk8N1uOdtN0cA==;
 s=purelymail1; d=lunabee.space; v=1;
 bh=qLvN9is/McEIubAyVf+v4fETRzbXQ0L73VWQus4nNzU=; h=Received:Subject:From:To; 
DKIM-Signature: a=rsa-sha256;
 b=CPqUuuKvbQFPCQ7hravnP1HApLyTRI6MExBZg7DCmoOSzzloK7bYg+u8kMoCSHU97jYNz2/sXbtQ7QNS4KgaycSECHyEt7PsRyjEFXum5rpZUWzmzf/oeU3dBzSu5Mbg99rpzlHzmOlCq9Fd0nSnyHnHX9UWpCc4ZrrwgOc6CBUt+hH9bOc1wvpNvpUTIGWbrYwaEO2mut5QgTu5Igf2VSGzRuExUHxPWTQfmG2fCm7mvq/Qy8tErDwexZM3xpoCDCoDvZor4WMN3YYo+2j5oCVBeKrIGZjC6whXA0oonL5/6v0z2v6ya1crHhw9ANU2pn+1HugnWfCC5GCWSKD6WQ==;
 s=purelymail1; d=purelymail.com; v=1;
 bh=qLvN9is/McEIubAyVf+v4fETRzbXQ0L73VWQus4nNzU=;
 h=Feedback-ID:Received:Subject:From:To; 
Feedback-ID: 8937:2070:null:purelymail
X-Pm-Original-To: 69343 <at> debbugs.gnu.org
Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 468812799; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sat, 02 Mar 2024 23:46:05 +0000 (UTC)
Message-ID: <8d254c5e232fbe7fcecaa94638dc714b3b5678c8.camel@HIDDEN>
Subject: Re: Simplify bootloader data structures and procedures
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Date: Sat, 02 Mar 2024 17:46:04 -0600
Organization: Dissociation for Heresiographal Computation
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.46.4 
MIME-Version: 1.0
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

In guix/scripts/system.scm(generation->boot-alternative) system-path
isn't defined. Assuming system is supposed to be that?




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

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 02:10:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 21:10:25 2024
Received: from localhost ([127.0.0.1]:37506 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhUc-0004Cw-MI
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 21:10:25 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:37576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJc-0003YB-KO
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:04 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=7mwMWjx9X+yNhTC
 FjbJ6qHa+qRKgO9k1KcpZ4YuX/wU=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=KVSiadOxM769kZnIJ3tDpDdPVxCroCq8OCtFSADs
 2tU6tylZAvqbt5pEOlCTy2a+68U7DaVYVEYsrAxUKe+vvUWEC0uG7eMDogYxpJ8wwvR7xF
 6H61SBIzi1REXBIXYNR0JlBWLdcLOkGtdNoveQ71lGY207N9+gWlVQ7xogq74=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id ac71c734
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:55 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 2966fb71;
 Sat, 24 Feb 2024 01:51:55 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 02/12] Move <boot-parameters> record to a separate file.
Date: Fri, 23 Feb 2024 17:51:35 -0800
Message-ID: <42a9d53a4de3788e22b953927abb1a9723921e87.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Without it, the following commit following this one causes 'guix pull' to f=
ail
with this message:

=0D[  0/ 50] loading...	  0.0% of 25 files=0D[  1/ 50] loading...	  4.0% of=
 25 files=0D[  2/ 50] loading...	  8.0% of 25 files=0D[  3/ 50] loading...	=
 12.0% of 25 files=0D[  4/ 50] loading...	 16.0% of 25 files=0D[  5/ 50] lo=
ading...	 20.0% of 25 files=0D[  6/ 50] loading...	 24.0% of 25 files=0D[  =
7/ 50] loading...	 28.0% of 25 files=0D[  8/ 50] loading...	 32.0% of 25 fi=
les=0D[  9/ 50] loading...	 36.0% of 25 files=0D[ 10/ 50] loading...	 40.0%=
 of 25 files=0D[ 11/ 50] loading...	 44.0% of 25 files=0D[ 12/ 50] loading.=
..	 48.0% of 25 files=0D[ 13/ 50] loading...	 52.0% of 25 files=0D[ 14/ 50]=
 loading...	 56.0% of 25 files=0D[ 15/ 50] loading...	 60.0% of 25 files=0D=
[ 16/ 50] loading...	 64.0% of 25 files=0D[ 17/ 50] loading...	 68.0% of 25=
 files=0D[ 18/ 50] loading...	 72.0% of 25 files=0D[ 19/ 50] loading...	 76=
.0% of 25 files=0D[ 20/ 50] loading...	 80.0% of 25 files=0D[ 21/ 50] loadi=
ng...	 84.0% of 25 files=0D[ 22/ 50] loading...	 88.0% of 25 files=0D[ 23/ =
50] loading...	 92.0% of 25 files=0D[ 24/ 50] loading...	 96.0% of 25 files=
=0D[ 25/ 50] loading...	100.0% of 25 files=0D[ 25/ 50] compiling...	  0.0% =
of 25 files=0D[ 26/ 50] compiling...	  4.0% of 25 files=0D[ 27/ 50] compili=
ng...	  8.0% of 25 files=0D[ 28/ 50] compiling...	 12.0% of 25 files=0D[ 29=
/ 50] compiling...	 16.0% of 25 files=0D[ 30/ 50] compiling...	 20.0% of 25=
 files=0D[ 31/ 50] compiling...	 24.0% of 25 files=0D[ 32/ 50] compiling...=
	 28.0% of 25 files=0D[ 33/ 50] compiling...	 32.0% of 25 files=0D[ 34/ 50]=
 compiling...	 36.0% of 25 files=0D[ 35/ 50] compiling...	 40.0% of 25 file=
s=0D[ 36/ 50] compiling...	 44.0% of 25 files=0D[ 37/ 50] compiling...	 48.=
0% of 25 files=0D[ 38/ 50] compiling...	 52.0% of 25 files=0D[ 39/ 50] comp=
iling...	 56.0% of 25 files=0D[ 40/ 50] compiling...	 60.0% of 25 files=0D[=
 41/ 50] compiling...	 64.0% of 25 files=0D[ 42/ 50] compiling...	 68.0% of=
 25 files=0D[ 43/ 50] compiling...	 72.0% of 25 files=0D[ 44/ 50] compiling=
...	 76.0% of 25 files=0D[ 45/ 50] compiling...	 80.0% of 25 files=0D[ 46/ =
50] compiling...	 84.0% of 25 files=0D[ 47/ 50] compiling...	 88.0% of 25 f=
iles=0D[ 48/ 50] compiling...	 92.0% of 25 files=0D[ 49/ 50] compiling...	 =
96.0% of 25 files=0D[ 50/ 50] compiling...	100.0% of 25 files=0D[  0/ 50] l=
oading...	  0.0% of 25 files=0D[  1/ 50] loading...	  4.0% of 25 files=0D[ =
 2/ 50] loading...	  8.0% of 25 files=0D[  3/ 50] loading...	 12.0% of 25 f=
iles=0D[  4/ 50] loading...	 16.0% of 25 files=0D[  5/ 50] loading...	 20.0=
% of 25 files=0D[  6/ 50] loading...	 24.0% of 25 files=0D[  7/ 50] loading=
...	 28.0% of 25 files=0D[  8/ 50] loading...	 32.0% of 25 files=0D[  9/ 50=
] loading...	 36.0% of 25 files=0D[ 10/ 50] loading...	 40.0% of 25 files=
=0D[ 11/ 50] loading...	 44.0% of 25 files=0D[ 12/ 50] loading...	 48.0% of=
 25 files=0D[ 13/ 50] loading...	 52.0% of 25 files=0D[ 14/ 50] loading...	=
 56.0% of 25 files=0D[ 15/ 50] loading...	 60.0% of 25 files=0D[ 16/ 50] lo=
ading...	 64.0% of 25 files=0D[ 17/ 50] loading...	 68.0% of 25 files=0D[ 1=
8/ 50] loading...	 72.0% of 25 files=0D[ 19/ 50] loading...	 76.0% of 25 fi=
les=0D[ 20/ 50] loading...	 80.0% of 25 files=0D[ 21/ 50] loading...	 84.0%=
 of 25 files=0D[ 22/ 50] loading...	 88.0% of 25 files=0D[ 23/ 50] loading.=
..	 92.0% of 25 files=0D[ 24/ 50] loading...	 96.0% of 25 files=0D[ 25/ 50]=
 loading...	100.0% of 25 files=0D[ 25/ 50] compiling...	  0.0% of 25 files=
=0D[ 26/ 50] compiling...	  4.0% of 25 files=0D[ 27/ 50] compiling...	  8.0=
% of 25 files=0D[ 28/ 50] compiling...	 12.0% of 25 files=0D[ 29/ 50] compi=
ling...	 16.0% of 25 files=0D[ 30/ 50] compiling...	 20.0% of 25 files=0D[ =
31/ 50] compiling...	 24.0% of 25 files=0D[ 32/ 50] compiling...	 28.0% of =
25 files=0D[ 33/ 50] compiling...	 32.0% of 25 files=0D[ 34/ 50] compiling.=
..	 36.0% of 25 files=0D[ 35/ 50] compiling...	 40.0% of 25 files=0D[ 36/ 5=
0] compiling...	 44.0% of 25 files=0D[ 37/ 50] compiling...	 48.0% of 25 fi=
les=0D[ 38/ 50] compiling...	 52.0% of 25 files=0D[ 39/ 50] compiling...	 5=
6.0% of 25 files=0D[ 40/ 50] compiling...	 60.0% of 25 files=0D[ 41/ 50] co=
mpiling...	 64.0% of 25 files=0D[ 42/ 50] compiling...	 68.0% of 25 files=
=0D[ 43/ 50] compiling...	 72.0% of 25 files=0D[ 44/ 50] compiling...	 76.0=
% of 25 files=0D[ 45/ 50] compiling...	 80.0% of 25 files=0D[ 46/ 50] compi=
ling...	 84.0% of 25 files=0D[ 47/ 50] compiling...	 88.0% of 25 files=0D[ =
48/ 50] compiling...	 92.0% of 25 files=0D[ 49/ 50] compiling...	 96.0% of =
25 files=0D[ 50/ 50] compiling...	100.0% of 25 files=0D[  0/ 50] loading...=
	  0.0% of 25 files=0D[  1/ 50] loading...	  4.0% of 25 files=0D[  2/ 50] l=
oading...	  8.0% of 25 files=0D[  3/ 50] loading...	 12.0% of 25 files=0D[ =
 4/ 50] loading...	 16.0% of 25 files=0D[  5/ 50] loading...	 20.0% of 25 f=
iles=0D[  6/ 50] loading...	 24.0% of 25 files=0D[  7/ 50] loading...	 28.0=
% of 25 files=0D[  8/ 50] loading...	 32.0% of 25 files=0D[  9/ 50] loading=
...	 36.0% of 25 files=0D[ 10/ 50] loading...	 40.0% of 25 files=0D[ 11/ 50=
] loading...	 44.0% of 25 files=0D[ 12/ 50] loading...	 48.0% of 25 files=
=0D[ 13/ 50] loading...	 52.0% of 25 files=0D[ 14/ 50] loading...	 56.0% of=
 25 files=0D[ 15/ 50] loading...	 60.0% of 25 files=0D[ 16/ 50] loading...	=
 64.0% of 25 files=0D[ 17/ 50] loading...	 68.0% of 25 files=0D[ 18/ 50] lo=
ading...	 72.0% of 25 files=0D[ 19/ 50] loading...	 76.0% of 25 files=0D[ 2=
0/ 50] loading...	 80.0% of 25 files=0D[ 21/ 50] loading...	 84.0% of 25 fi=
les=0D[ 22/ 50] loading...	 88.0% of 25 files=0D[ 23/ 50] loading...	 92.0%=
 of 25 files=0D[ 24/ 50] loading...	 96.0% of 25 files=0D[ 25/ 50] loading.=
..	100.0% of 25 files=0D[ 25/ 50] compiling...	  0.0% of 25 files=0D[ 26/ 5=
0] compiling...	  4.0% of 25 files=0D[ 27/ 50] compiling...	  8.0% of 25 fi=
les=0D[ 28/ 50] compiling...	 12.0% of 25 files=0D[ 29/ 50] compiling...	 1=
6.0% of 25 files=0D[ 30/ 50] compiling...	 20.0% of 25 files=0D[ 31/ 50] co=
mpiling...	 24.0% of 25 files=0D[ 32/ 50] compiling...	 28.0% of 25 files=
=0D[ 33/ 50] compiling...	 32.0% of 25 files=0D[ 34/ 50] compiling...	 36.0=
% of 25 files=0D[ 35/ 50] compiling...	 40.0% of 25 files=0D[ 36/ 50] compi=
ling...	 44.0% of 25 files=0D[ 37/ 50] compiling...	 48.0% of 25 files=0D[ =
38/ 50] compiling...	 52.0% of 25 files=0D[ 39/ 50] compiling...	 56.0% of =
25 files=0D[ 40/ 50] compiling...	 60.0% of 25 files=0D[ 41/ 50] compiling.=
..	 64.0% of 25 files=0D[ 42/ 50] compiling...	 68.0% of 25 files=0D[ 43/ 5=
0] compiling...	 72.0% of 25 files=0D[ 44/ 50] compiling...	 76.0% of 25 fi=
les=0D[ 45/ 50] compiling...	 80.0% of 25 files=0D[ 46/ 50] compiling...	 8=
4.0% of 25 files=0D[ 47/ 50] compiling...	 88.0% of 25 files=0D[ 48/ 50] co=
mpiling...	 92.0% of 25 files=0D[ 49/ 50] compiling...	 96.0% of 25 files=
=0D[ 50/ 50] compiling...	100.0% of 25 files=0D[  0/ 50] loading...	  0.0% =
of 25 files=0D[  1/ 50] loading...	  4.0% of 25 files=0D[  2/ 50] loading..=
.	  8.0% of 25 files=0D[  3/ 50] loading...	 12.0% of 25 files=0D[  4/ 50] =
loading...	 16.0% of 25 files=0D[  5/ 50] loading...	 20.0% of 25 files=0D[=
  6/ 50] loading...	 24.0% of 25 files=0D[  7/ 50] loading...	 28.0% of 25 =
files=0D[  8/ 50] loading...	 32.0% of 25 files=0D[  9/ 50] loading...	 36.=
0% of 25 files=0D[ 10/ 50] loading...	 40.0% of 25 files=0D[ 11/ 50] loadin=
g...	 44.0% of 25 files=0D[ 12/ 50] loading...	 48.0% of 25 files=0D[ 13/ 5=
0] loading...	 52.0% of 25 files=0D[ 14/ 50] loading...	 56.0% of 25 files=
=0D[ 15/ 50] loading...	 60.0% of 25 files=0D[ 16/ 50] loading...	 64.0% of=
 25 files=0D[ 17/ 50] loading...	 68.0% of 25 files=0D[ 18/ 50] loading...	=
 72.0% of 25 files=0D[ 19/ 50] loading...	 76.0% of 25 files=0D[ 20/ 50] lo=
ading...	 80.0% of 25 files=0D[ 21/ 50] loading...	 84.0% of 25 files=0D[ 2=
2/ 50] loading...	 88.0% of 25 files=0D[ 23/ 50] loading...	 92.0% of 25 fi=
les=0D[ 24/ 50] loading...	 96.0% of 25 files=0D[ 25/ 50] loading...	100.0%=
 of 25 files=0D[ 25/ 50] compiling...	  0.0% of 25 files=0D[ 26/ 50] compil=
ing...	  4.0% of 25 files=0D[ 27/ 50] compiling...	  8.0% of 25 files=0D[ 2=
8/ 50] compiling...	 12.0% of 25 files=0D[ 29/ 50] compiling...	 16.0% of 2=
5 files=0D[ 30/ 50] compiling...	 20.0% of 25 files=0D[ 31/ 50] compiling..=
.	 24.0% of 25 files=0D[ 32/ 50] compiling...	 28.0% of 25 files=0D[ 33/ 50=
] compiling...	 32.0% of 25 files=0D[ 34/ 50] compiling...	 36.0% of 25 fil=
es=0D[ 35/ 50] compiling...	 40.0% of 25 files=0D[ 36/ 50] compiling...	 44=
.0% of 25 files=0D[ 37/ 50] compiling...	 48.0% of 25 files=0D[ 38/ 50] com=
piling...	 52.0% of 25 files=0D[ 39/ 50] compiling...	 56.0% of 25 files=0D=
[ 40/ 50] compiling...	 60.0% of 25 files=0D[ 41/ 50] compiling...	 64.0% o=
f 25 files=0D[ 42/ 50] compiling...	 68.0% of 25 files=0D[ 43/ 50] compilin=
g...	 72.0% of 25 files=0D[ 44/ 50] compiling...	 76.0% of 25 files=0D[ 45/=
 50] compiling...	 80.0% of 25 files=0D[ 46/ 50] compiling...	 84.0% of 25 =
files=0D[ 47/ 50] compiling...	 88.0% of 25 files=0D[ 48/ 50] compiling...	=
 92.0% of 25 files=0D[ 49/ 50] compiling...	 96.0% of 25 files=0D[ 50/ 50] =
compiling...	100.0% of 25 files=0D[  0/ 50] loading...	  0.0% of 25 files=
=0D[  1/ 50] loading...	  4.0% of 25 files=0D[  2/ 50] loading...	  8.0% of=
 25 files=0D[  3/ 50] loading...	 12.0% of 25 files=0D[  4/ 50] loading...	=
 16.0% of 25 files=0D[  5/ 50] loading...	 20.0% of 25 files=0D[  6/ 50] lo=
ading...	 24.0% of 25 files=0D[  7/ 50] loading...	 28.0% of 25 files=0D[  =
8/ 50] loading...	 32.0% of 25 files=0D[  9/ 50] loading...	 36.0% of 25 fi=
les=0D[ 10/ 50] loading...	 40.0% of 25 files=0D[ 11/ 50] loading...	 44.0%=
 of 25 files=0D[ 12/ 50] loading...	 48.0% of 25 files=0D[ 13/ 50] loading.=
..	 52.0% of 25 files=0D[ 14/ 50] loading...	 56.0% of 25 files=0D[ 15/ 50]=
 loading...	 60.0% of 25 files=0D[ 16/ 50] loading...	 64.0% of 25 files=0D=
[ 17/ 50] loading...	 68.0% of 25 files=0D[ 18/ 50] loading...	 72.0% of 25=
 files=0D[ 19/ 50] loading...	 76.0% of 25 files=0D[ 20/ 50] loading...	 80=
.0% of 25 files=0D[ 21/ 50] loading...	 84.0% of 25 files=0D[ 22/ 50] loadi=
ng...	 88.0% of 25 files=0D[ 23/ 50] loading...	 92.0% of 25 files=0D[ 24/ =
50] loading...	 96.0% of 25 files=0D[ 25/ 50] loading...	100.0% of 25 files=
=0D[ 25/ 50] compiling...	  0.0% of 25 files=0D[ 26/ 50] compiling...	  4.0=
% of 25 files=0D[ 27/ 50] compiling...	  8.0% of 25 files=0D[ 28/ 50] compi=
ling...	 12.0% of 25 files=0D[ 29/ 50] compiling...	 16.0% of 25 files=0D[ =
30/ 50] compiling...	 20.0% of 25 files=0D[ 31/ 50] compiling...	 24.0% of =
25 files=0D[ 32/ 50] compiling...	 28.0% of 25 files=0D[ 33/ 50] compiling.=
..	 32.0% of 25 files=0D[ 34/ 50] compiling...	 36.0% of 25 files=0D[ 35/ 5=
0] compiling...	 40.0% of 25 files=0D[ 36/ 50] compiling...	 44.0% of 25 fi=
les=0D[ 37/ 50] compiling...	 48.0% of 25 files=0D[ 38/ 50] compiling...	 5=
2.0% of 25 files=0D[ 39/ 50] compiling...	 56.0% of 25 files=0D[ 40/ 50] co=
mpiling...	 60.0% of 25 files=0D[ 41/ 50] compiling...	 64.0% of 25 files=
=0D[ 42/ 50] compiling...	 68.0% of 25 files=0D[ 43/ 50] compiling...	 72.0=
% of 25 files=0D[ 44/ 50] compiling...	 76.0% of 25 files=0D[ 45/ 50] compi=
ling...	 80.0% of 25 files=0D[ 46/ 50] compiling...	 84.0% of 25 files=0D[ =
47/ 50] compiling...	 88.0% of 25 files=0D[ 48/ 50] compiling...	 92.0% of =
25 files=0D[ 49/ 50] compiling...	 96.0% of 25 files=0D[ 50/ 50] compiling.=
..	100.0% of 25 files=0D[  0/ 50] loading...	  0.0% of 25 files=0D[  1/ 50]=
 loading...	  4.0% of 25 files=0D[  2/ 50] loading...	  8.0% of 25 files=0D=
[  3/ 50] loading...	 12.0% of 25 files=0D[  4/ 50] loading...	 16.0% of 25=
 files=0D[  5/ 50] loading...	 20.0% of 25 files=0D[  6/ 50] loading...	 24=
.0% of 25 files=0D[  7/ 50] loading...	 28.0% of 25 files=0D[  8/ 50] loadi=
ng...	 32.0% of 25 files=0D[  9/ 50] loading...	 36.0% of 25 files=0D[ 10/ =
50] loading...	 40.0% of 25 files=0D[ 11/ 50] loading...	 44.0% of 25 files=
=0D[ 12/ 50] loading...	 48.0% of 25 files=0D[ 13/ 50] loading...	 52.0% of=
 25 files=0D[ 14/ 50] loading...	 56.0% of 25 files=0D[ 15/ 50] loading...	=
 60.0% of 25 files=0D[ 16/ 50] loading...	 64.0% of 25 files=0D[ 17/ 50] lo=
ading...	 68.0% of 25 files=0D[ 18/ 50] loading...	 72.0% of 25 files=0D[ 1=
9/ 50] loading...	 76.0% of 25 files=0D[ 20/ 50] loading...	 80.0% of 25 fi=
les=0D[ 21/ 50] loading...	 84.0% of 25 files=0D[ 22/ 50] loading...	 88.0%=
 of 25 files=0D[ 23/ 50] loading...	 92.0% of 25 files=0D[ 24/ 50] loading.=
..	 96.0% of 25 files=0D[ 25/ 50] loading...	100.0% of 25 files=0D[ 25/ 50]=
 compiling...	  0.0% of 25 files=0D[ 26/ 50] compiling...	  4.0% of 25 file=
s=0D[ 27/ 50] compiling...	  8.0% of 25 files=0D[ 28/ 50] compiling...	 12.=
0% of 25 files=0D[ 29/ 50] compiling...	 16.0% of 25 files=0D[ 30/ 50] comp=
iling...	 20.0% of 25 files=0D[ 31/ 50] compiling...	 24.0% of 25 files=0D[=
 32/ 50] compiling...	 28.0% of 25 files=0D[ 33/ 50] compiling...	 32.0% of=
 25 files=0D[ 34/ 50] compiling...	 36.0% of 25 files=0D[ 35/ 50] compiling=
...	 40.0% of 25 files=0D[ 36/ 50] compiling...	 44.0% of 25 files=0D[ 37/ =
50] compiling...	 48.0% of 25 files=0D[ 38/ 50] compiling...	 52.0% of 25 f=
iles=0D[ 39/ 50] compiling...	 56.0% of 25 files=0D[ 40/ 50] compiling...	 =
60.0% of 25 files=0D[ 41/ 50] compiling...	 64.0% of 25 files=0D[ 42/ 50] c=
ompiling...	 68.0% of 25 files=0D[ 43/ 50] compiling...	 72.0% of 25 files=
=0D[ 44/ 50] compiling...	 76.0% of 25 files=0D[ 45/ 50] compiling...	 80.0=
% of 25 files=0D[ 46/ 50] compiling...	 84.0% of 25 files=0D[ 47/ 50] compi=
ling...	 88.0% of 25 files=0D[ 48/ 50] compiling...	 92.0% of 25 files=0D[ =
49/ 50] compiling...	 96.0% of 25 files=0D[ 50/ 50] compiling...	100.0% of =
25 files=0D[  0/ 50] loading...	  0.0% of 25 files=0D[  1/ 50] loading...	 =
 4.0% of 25 filesBacktrace:
In ice-9/boot-9.scm:
   222:29 19 (map1 (((gnu packages nano)) ((gnu packages nvi)) ((gnu packag=
es package-management)) ((gnu packages pciutils)) ((gnu packages texinfo)) =
((gnu packages text-editors)) ((gnu # wget)) ?))
   222:29 18 (map1 (((gnu packages nvi)) ((gnu packages package-management)=
) ((gnu packages pciutils)) ((gnu packages texinfo)) ((gnu packages text-ed=
itors)) ((gnu packages wget)) ((gnu #)) ((?)) ?))
   222:29 17 (map1 (((gnu packages package-management)) ((gnu packages pciu=
tils)) ((gnu packages texinfo)) ((gnu packages text-editors)) ((gnu package=
s wget)) ((gnu services)) ((gnu services #)) ?))
   222:29 16 (map1 (((gnu packages pciutils)) ((gnu packages texinfo)) ((gn=
u packages text-editors)) ((gnu packages wget)) ((gnu services)) ((gnu serv=
ices shepherd)) ((gnu services base)) ((# ?)) ?))
   222:29 15 (map1 (((gnu packages texinfo)) ((gnu packages text-editors)) =
((gnu packages wget)) ((gnu services)) ((gnu services shepherd)) ((gnu serv=
ices base)) ((gnu bootloader)) ((gnu # #)) # ?))
   222:29 14 (map1 (((gnu packages text-editors)) ((gnu packages wget)) ((g=
nu services)) ((gnu services shepherd)) ((gnu services base)) ((gnu bootloa=
der)) ((gnu system shadow)) ((gnu system #)) ?))
   222:29 13 (map1 (((gnu packages wget)) ((gnu services)) ((gnu services s=
hepherd)) ((gnu services base)) ((gnu bootloader)) ((gnu system shadow)) ((=
gnu system nss)) ((gnu system locale)) ((?)) ?))
   222:17 12 (map1 (((gnu services)) ((gnu services shepherd)) ((gnu servic=
es base)) ((gnu bootloader)) ((gnu system shadow)) ((gnu system nss)) ((gnu=
 system locale)) ((gnu system pam)) ((gnu ?)) ?))
  3327:17 11 (resolve-interface (gnu services) #:select _ #:hide _ #:prefix=
 _ #:renamer _ #:version _)
In ice-9/threads.scm:
    390:8 10 (_ _)
In ice-9/boot-9.scm:
  3253:13  9 (_)
In ice-9/threads.scm:
    390:8  8 (_ _)
In ice-9/boot-9.scm:
  3544:20  7 (_)
   2836:4  6 (save-module-excursion #<procedure 7fffdd1c7660 at ice-9/boot-=
9.scm:3545:21 ()>)
  3564:26  5 (_)
In unknown file:
           4 (primitive-load-path "gnu/services" #<procedure 7fffde800600 a=
t ice-9/boot-9.scm:3551:37 ()>)
In ice-9/eval.scm:
   626:19  3 (_ #<directory (gnu services) 7fffe2b5daa0>)
    159:9  2 (_ #<directory (gnu services) 7fffe2b5daa0>)
   213:37  1 (_ #<directory (gnu services) 7fffe2b5daa0>)
In guix/modules.scm:
   157:28  0 (loop ((gnu build hurd-boot) (guix build syscalls)) ((guix bui=
ld utils)) #<<set> vhash: #<vhash 7fffdcb533e0 1 pairs> insert: #<procedure=
 %insert (t-5ce36f5c768e728-57f t-5ce36f5c768e?>)

guix/modules.scm:157:28: In procedure loop:
ERROR:
  1. &missing-dependency-error:
      module: (gnu build hurd-boot)
      search-path: ("." "/gnu/store/11i4vribdynrxkp4ppilkjp9y9jshaxq-guix-c=
ore-source" "/gnu/store/avd0dsg9rixk3djls8ikzphfjbl227za-guix-extra-source"=
 "/gnu/store/vdi10jyhr1igrkdgnsjj09krjx1jkzkm-guix-packages-base-source" "/=
gnu/store/l8sdgq6cpnxyk732w23p7mhq6sial0vm-guile-gcrypt-0.4.0/share/guile/s=
ite/3.0" "/gnu/store/0i81lpfnn05pmjc5f43q4nfvd27r08f7-guile-gnutls-3.7.12/s=
hare/guile/site/3.0" "/gnu/store/rm803mxjvr9zamg1226dl9zf2275yjzg-guile-git=
-0.5.2/share/guile/site/3.0" "/gnu/store/bxvl7w7q66gbk7qkkhsiq30vl69jj4x7-g=
uile-bytestructures-1.0.10/share/guile/site/3.0" "/gnu/store/q91hbi8yc2jnx0=
hlk6zb6vlkrw3xm0yx-guile-avahi-0.4.1/share/guile/site/3.0" "/gnu/store/p5f0=
06jcr83jc7m731vhvjdkr2j0hnp3-guile-json-4.7.3/share/guile/site/3.0" "/gnu/s=
tore/d75xpk3qxw7na6zgbf2dw3asqhwifd6a-guile-semver-0.1.1/share/guile/site/3=
.0" "/gnu/store/19m9xm33jq34nb64z11q5bph85ff6gyd-guile-ssh-0.16.3/share/gui=
le/site/3.0" "/gnu/store/r8izi6mi1mjl7s1kn20q1hxmy3jg2bxc-guile-sqlite3-0.1=
.3/share/guile/site/3.0" "/gnu/store/bc3zzjych6jyp4ph2af9k3w8qcs3nsn2-guile=
-lib-0.2.7/share/guile/site/3.0" "/gnu/store/w6gpivr3421wbzkjg6qlc95sv1srz1=
5a-guile-zlib-0.1.0/share/guile/site/3.0" "/gnu/store/1zlqd5240mq0dwwig9bv1=
cg4zjf092h9-guile-lzlib-0.0.2/share/guile/site/3.0" "/gnu/store/rqd5wpa09fi=
zcb211p78g6f2f5jb2lwg-guile-zstd-0.1.1/share/guile/site/3.0" "/gnu/store/xf=
d68fq6vmali9wqivg84baqp4n4maqx-guix-packages-source" "/gnu/store/a7sykpl77z=
61sr0dv034rpwby9bz8zwm-module-import" "/gnu/store/4gvgcfdiz67wv04ihqfa8pqwz=
sb0qpv5-guile-3.0.9/share/guile/3.0" "/gnu/store/4gvgcfdiz67wv04ihqfa8pqwzs=
b0qpv5-guile-3.0.9/share/guile/site/3.0" "/gnu/store/4gvgcfdiz67wv04ihqfa8p=
qwzsb0qpv5-guile-3.0.9/share/guile/site" "/gnu/store/4gvgcfdiz67wv04ihqfa8p=
qwzsb0qpv5-guile-3.0.9/share/guile")

Change-Id: I6944ffd4c323c776005b0cef23218bffae59be23
---
 gnu/machine/ssh.scm       |   1 +
 gnu/system.scm            | 224 +-----------------------------
 gnu/system/boot.scm       | 277 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |   1 +
 tests/boot-parameters.scm |   1 +
 5 files changed, 281 insertions(+), 223 deletions(-)
 create mode 100644 gnu/system/boot.scm

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index b47ce7c225..0ffe71367c 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -23,6 +23,7 @@ (define-module (gnu machine ssh)
   #:use-module (gnu machine)
   #:autoload   (gnu packages gnupg) (guile-gcrypt)
   #:use-module (gnu system)
+  #:use-module (gnu system boot)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
   #:use-module ((gnu services) #:select (sexp->system-provenance))
diff --git a/gnu/system.scm b/gnu/system.scm
index aede35775e..a438137731 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -70,6 +70,7 @@ (define-module (gnu system)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services base)
   #:use-module (gnu bootloader)
+  #:use-module (gnu system boot)
   #:use-module (gnu system shadow)
   #:use-module (gnu system nss)
   #:use-module (gnu system locale)
@@ -149,25 +150,6 @@ (define-module (gnu system)
=20
             hurd-default-essential-services
=20
-            boot-parameters
-            boot-parameters?
-            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
-            boot-parameters-store-mount-point
-            boot-parameters-locale
-            boot-parameters-kernel
-            boot-parameters-kernel-arguments
-            boot-parameters-initrd
-            boot-parameters-multiboot-modules
-            boot-parameters-version
-            %boot-parameters-version
-            read-boot-parameters
-            read-boot-parameters-file
             boot-parameters->menu-entry
=20
             local-host-aliases                    ;deprecated
@@ -327,210 +309,6 @@ (define* (operating-system-kernel-arguments
 ;;; Boot parameters
 ;;;
=20
-;;; Version 1 was introduced early 2022 to mark the departure from long op=
tion
-;;; names such as '--load' to the more conventional initrd option names li=
ke
-;;; 'gnu.load'.
-;;;
-;;; When bumping the boot-parameters version, increment it by one (1).
-(define %boot-parameters-version 1)
-
-(define-record-type* <boot-parameters>
-  boot-parameters make-boot-parameters boot-parameters?
-  (label            boot-parameters-label)
-  ;; Because we will use the 'store-device' to create the GRUB search comm=
and,
-  ;; the 'store-device' has slightly different semantics than 'root-device=
'.
-  ;; The 'store-device' can be a file system uuid, a file system label, or=
 #f,
-  ;; but it cannot be a device file name such as "/dev/sda3", since GRUB w=
ould
-  ;; not understand that.  The 'root-device', on the other hand, correspon=
ds
-  ;; exactly to the device field of the <file-system> object representing =
the
-  ;; OS's root file system, so it might be a device file name like
-  ;; "/dev/sda3".  The 'store-directory-prefix' field contains #f or the s=
tore
-  ;; file name inside the 'store-device' as it is seen by GRUB, e.g. it wo=
uld
-  ;; contain "/storefs" if the store is located in that subvolume of a btr=
fs
-  ;; 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)
-  (store-crypto-devices boot-parameters-store-crypto-devices
-                        (default '()))
-  (locale           boot-parameters-locale)
-  (kernel           boot-parameters-kernel)
-  (kernel-arguments boot-parameters-kernel-arguments)
-  (initrd           boot-parameters-initrd)
-  (multiboot-modules boot-parameters-multiboot-modules)
-  (version          boot-parameters-version  ;positive integer
-                    (default %boot-parameters-version)))
-
-(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
-file system labels."
-  (if (and (string? device) (string-prefix? "/" device))
-      #f
-      device))
-
-(define (read-boot-parameters port)
-  "Read boot parameters from PORT and return the corresponding
-<boot-parameters> object.  Raise an error if the format is unrecognized."
-  (define device-sexp->device
-    (match-lambda
-      (('uuid (? symbol? type) (? bytevector? bv))
-       (bytevector->uuid bv type))
-      (('file-system-label (? string? label))
-       (file-system-label label))
-      ((? bytevector? bv)                         ;old format
-       (bytevector->uuid bv 'dce))
-      ((? string? device)
-       (if (string-contains device ":/")
-           device ; nfs-root
-           ;; It used to be that we would not distinguish between labels a=
nd
-           ;; device names.  Try to infer the right thing here.
-           (if (string-prefix? "/" device)
-               device
-               (file-system-label device))))))
-  (define uuid-sexp->uuid
-    (match-lambda
-      (('uuid (? symbol? type) (? bytevector? bv))
-       (bytevector->uuid bv type))
-      (x
-       (warning (G_ "unrecognized uuid ~a at '~a'~%") x (port-filename por=
t))
-       #f)))
-
-  ;; New versions are not backward-compatible, so only accept past and cur=
rent
-  ;; versions, not future ones.
-  (define (version? n)
-    (member n (iota (1+ %boot-parameters-version))))
-
-  (match (read port)
-    (('boot-parameters ('version (? version? version))
-                       ('label label) ('root-device root)
-                       ('kernel kernel)
-                       rest ...)
-     (boot-parameters
-      (version version)
-      (label label)
-      (root-device (device-sexp->device root))
-
-      (bootloader-name
-       (match (assq 'bootloader-name rest)
-         ((_ 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=3D? kernel (direct-store-path kernel))
-                  (string-append kernel "/"
-                                 (system-linux-image-file-name))
-                  kernel))
-
-      (kernel-arguments
-       (match (assq 'kernel-arguments rest)
-         ((_ args) args)
-         (#f       '())))                         ;the old format
-
-      (initrd
-       (match (assq 'initrd rest)
-         (('initrd ('string-append directory file)) ;the old format
-          (string-append directory file))
-         (('initrd (? string? file))
-          file)
-         (#f #f)))
-
-      (multiboot-modules
-       (match (assq 'multiboot-modules rest)
-         ((_ args) args)
-         (#f       '())))
-
-      (locale
-       (match (assq 'locale rest)
-         ((_ locale) locale)
-         (#f         #f)))
-
-      (store-device
-       ;; Linux device names like "/dev/sda1" are not suitable GRUB device
-       ;; identifiers, so we just filter them out.
-       (ensure-not-/dev
-        (match (assq 'store rest)
-          (('store ('device #f) _ ...)
-           root-device)
-          (('store ('device device) _ ...)
-           (device-sexp->device device))
-          (_                                      ;the old format
-           root-device))))
-
-      (store-directory-prefix
-       (match (assq 'store rest)
-         (('store . store-data)
-          (match (assq 'directory-prefix store-data)
-            (('directory-prefix prefix) prefix)
-            ;; No directory-prefix found.
-            (_ #f)))
-         (_
-          ;; No store found, old format.
-          #f)))
-
-      (store-crypto-devices
-       (match (assq 'store rest)
-         (('store . store-data)
-          (match (assq 'crypto-devices store-data)
-            (('crypto-devices (devices ...))
-             (map uuid-sexp->uuid devices))
-            (('crypto-devices dev)
-             (warning (G_ "unrecognized crypto-devices ~S at '~a'~%")
-                      dev (port-filename port))
-             '())
-            (_
-             ;; No crypto-devices found.
-             '())))
-         (_
-          ;; No store found, old format.
-          '())))
-
-      (store-mount-point
-       (match (assq 'store rest)
-         (('store ('device _) ('mount-point mount-point) _ ...)
-          mount-point)
-         (_                                       ;the old format
-          "/")))))
-    (x                                            ;unsupported format
-     (raise
-      (make-compound-condition
-       (formatted-message
-        (G_ "unrecognized boot parameters at '~a'~%")
-        (port-filename port))
-       (condition
-        (&fix-hint (hint (format #f (G_ "This probably means that this ver=
sion
-of Guix is older than the one that created @file{~a}.  To address this, you
-need to update Guix:
-
-@example
-guix pull
-@end example")
-                                 (port-filename port))))))))))
-
-(define (read-boot-parameters-file system)
-  "Read boot parameters from SYSTEM's (system or generation) \"parameters\"
-file and returns the corresponding <boot-parameters> object or #f if the
-format is unrecognized.
-The object has its kernel-arguments extended in order to make it bootable."
-  (let* ((file (string-append system "/parameters"))
-         (params (call-with-input-file file read-boot-parameters))
-         (root (boot-parameters-root-device params))
-         (version (boot-parameters-version params)))
-    (boot-parameters
-     (inherit params)
-     (kernel-arguments (append (bootable-kernel-arguments system root vers=
ion)
-                               (boot-parameters-kernel-arguments params)))=
)))
-
 (define (boot-parameters->menu-entry conf)
   "Return a <menu-entry> instance given CONF, a <boot-parameters> instance=
."
   (let* ((kernel (boot-parameters-kernel conf))
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
new file mode 100644
index 0000000000..87b0184f98
--- /dev/null
+++ b/gnu/system/boot.scm
@@ -0,0 +1,277 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright =C2=A9 2013-2022 Ludovic Court=C3=A8s <ludo@HIDDEN>
+;;; Copyright =C2=A9 2015 Mark H Weaver <mhw@HIDDEN>
+;;; Copyright =C2=A9 2015, 2016 Alex Kost <alezost@HIDDEN>
+;;; Copyright =C2=A9 2016 Chris Marusich <cmmarusich@HIDDEN>
+;;; Copyright =C2=A9 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright =C2=A9 2019 Meiyo Peng <meiyo.peng@HIDDEN>
+;;; Copyright =C2=A9 2019, 2020 Miguel =C3=81ngel Arruga Vivas <rosen64483=
5@HIDDEN>
+;;; Copyright =C2=A9 2020 Danny Milosavljevic <dannym@HIDDEN>
+;;; Copyright =C2=A9 2020, 2021 Brice Waegeneire <brice@HIDDEN>
+;;; Copyright =C2=A9 2020 Florian Pelz <pelzflorian@HIDDEN>
+;;; Copyright =C2=A9 2020, 2022 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;; Copyright =C2=A9 2020, 2023 Janneke Nieuwenhuizen <jannek@HIDDEN>
+;;; Copyright =C2=A9 2020, 2022 Efraim Flashner <efraim@HIDDEN>
+;;; Copyright =C2=A9 2021 Maxime Devos <maximedevos@HIDDEN>
+;;; Copyright =C2=A9 2021 raid5atemyhomework <raid5atemyhomework@protonmai=
l.com>
+;;; Copyright =C2=A9 2023 Bruno Victal <mirai@HIDDEN>
+;;; Copyright =C2=A9 2023 Felix Lechner <felix.lechner@HIDDEN>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu system boot)
+  #:use-module (guix store)
+  #:use-module (guix gexp)
+  #:use-module (guix records)
+  #:use-module (gnu bootloader)
+  #:use-module (gnu system file-systems)
+  #:use-module (ice-9 format)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-35)
+  #:use-module (rnrs bytevectors)
+  #:export (boot-parameters
+            boot-parameters?
+            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
+            boot-parameters-store-mount-point
+            boot-parameters-locale
+            boot-parameters-kernel
+            boot-parameters-kernel-arguments
+            boot-parameters-initrd
+            boot-parameters-multiboot-modules
+            boot-parameters-version
+            %boot-parameters-version
+
+            read-boot-parameters
+            read-boot-parameters-file
+
+            ensure-not-/dev))
+
+;;;
+;;; Boot parameters
+;;;
+
+;;; Version 1 was introduced early 2022 to mark the departure from long op=
tion
+;;; names such as '--load' to the more conventional initrd option names li=
ke
+;;; 'gnu.load'.
+;;;
+;;; When bumping the boot-parameters version, increment it by one (1).
+(define %boot-parameters-version 1)
+
+(define-record-type* <boot-parameters>
+  boot-parameters make-boot-parameters boot-parameters?
+  (label            boot-parameters-label)
+  ;; Because we will use the 'store-device' to create the GRUB search comm=
and,
+  ;; the 'store-device' has slightly different semantics than 'root-device=
'.
+  ;; The 'store-device' can be a file system uuid, a file system label, or=
 #f,
+  ;; but it cannot be a device file name such as "/dev/sda3", since GRUB w=
ould
+  ;; not understand that.  The 'root-device', on the other hand, correspon=
ds
+  ;; exactly to the device field of the <file-system> object representing =
the
+  ;; OS's root file system, so it might be a device file name like
+  ;; "/dev/sda3".  The 'store-directory-prefix' field contains #f or the s=
tore
+  ;; file name inside the 'store-device' as it is seen by GRUB, e.g. it wo=
uld
+  ;; contain "/storefs" if the store is located in that subvolume of a btr=
fs
+  ;; 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)
+  (store-crypto-devices boot-parameters-store-crypto-devices
+                        (default '()))
+  (locale           boot-parameters-locale)
+  (kernel           boot-parameters-kernel)
+  (kernel-arguments boot-parameters-kernel-arguments)
+  (initrd           boot-parameters-initrd)
+  (multiboot-modules boot-parameters-multiboot-modules)
+  (version          boot-parameters-version  ;positive integer
+                    (default %boot-parameters-version)))
+
+(define (read-boot-parameters port)
+  "Read boot parameters from PORT and return the corresponding
+<boot-parameters> object.  Raise an error if the format is unrecognized."
+  (define device-sexp->device
+    (match-lambda
+      (('uuid (? symbol? type) (? bytevector? bv))
+       (bytevector->uuid bv type))
+      (('file-system-label (? string? label))
+       (file-system-label label))
+      ((? bytevector? bv)                         ;old format
+       (bytevector->uuid bv 'dce))
+      ((? string? device)
+       (if (string-contains device ":/")
+           device ; nfs-root
+           ;; It used to be that we would not distinguish between labels a=
nd
+           ;; device names.  Try to infer the right thing here.
+           (if (string-prefix? "/" device)
+               device
+               (file-system-label device))))))
+  (define uuid-sexp->uuid
+    (match-lambda
+      (('uuid (? symbol? type) (? bytevector? bv))
+       (bytevector->uuid bv type))
+      (x
+       (warning (G_ "unrecognized uuid ~a at '~a'~%") x (port-filename por=
t))
+       #f)))
+
+  ;; New versions are not backward-compatible, so only accept past and cur=
rent
+  ;; versions, not future ones.
+  (define (version? n)
+    (member n (iota (1+ %boot-parameters-version))))
+
+  (match (read port)
+    (('boot-parameters ('version (? version? version))
+                       ('label label) ('root-device root)
+                       ('kernel kernel)
+                       rest ...)
+     (boot-parameters
+      (version version)
+      (label label)
+      (root-device (device-sexp->device root))
+
+      (bootloader-name
+       (match (assq 'bootloader-name rest)
+         ((_ 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=3D? kernel (direct-store-path kernel))
+                  (string-append kernel "/"
+                                 (system-linux-image-file-name))
+                  kernel))
+
+      (kernel-arguments
+       (match (assq 'kernel-arguments rest)
+         ((_ args) args)
+         (#f       '())))                         ;the old format
+
+      (initrd
+       (match (assq 'initrd rest)
+         (('initrd ('string-append directory file)) ;the old format
+          (string-append directory file))
+         (('initrd (? string? file))
+          file)
+         (#f #f)))
+
+      (multiboot-modules
+       (match (assq 'multiboot-modules rest)
+         ((_ args) args)
+         (#f       '())))
+
+      (locale
+       (match (assq 'locale rest)
+         ((_ locale) locale)
+         (#f         #f)))
+
+      (store-device
+       ;; Linux device names like "/dev/sda1" are not suitable GRUB device
+       ;; identifiers, so we just filter them out.
+       (ensure-not-/dev
+        (match (assq 'store rest)
+          (('store ('device #f) _ ...)
+           root-device)
+          (('store ('device device) _ ...)
+           (device-sexp->device device))
+          (_                                      ;the old format
+           root-device))))
+
+      (store-directory-prefix
+       (match (assq 'store rest)
+         (('store . store-data)
+          (match (assq 'directory-prefix store-data)
+            (('directory-prefix prefix) prefix)
+            ;; No directory-prefix found.
+            (_ #f)))
+         (_
+          ;; No store found, old format.
+          #f)))
+
+      (store-crypto-devices
+       (match (assq 'store rest)
+         (('store . store-data)
+          (match (assq 'crypto-devices store-data)
+            (('crypto-devices (devices ...))
+             (map uuid-sexp->uuid devices))
+            (('crypto-devices dev)
+             (warning (G_ "unrecognized crypto-devices ~S at '~a'~%")
+                      dev (port-filename port))
+             '())
+            (_
+             ;; No crypto-devices found.
+             '())))
+         (_
+          ;; No store found, old format.
+          '())))
+
+      (store-mount-point
+       (match (assq 'store rest)
+         (('store ('device _) ('mount-point mount-point) _ ...)
+          mount-point)
+         (_                                       ;the old format
+          "/")))))
+    (x                                            ;unsupported format
+     (raise
+      (make-compound-condition
+       (formatted-message
+        (G_ "unrecognized boot parameters at '~a'~%")
+        (port-filename port))
+       (condition
+        (&fix-hint (hint (format #f (G_ "This probably means that this ver=
sion
+of Guix is older than the one that created @file{~a}.  To address this, you
+need to update Guix:
+
+@example
+guix pull
+@end example")
+                                 (port-filename port))))))))))
+
+(define (read-boot-parameters-file system)
+  "Read boot parameters from SYSTEM's (system or generation) \"parameters\"
+file and returns the corresponding <boot-parameters> object or #f if the
+format is unrecognized.
+The object has its kernel-arguments extended in order to make it bootable."
+  (let* ((file (string-append system "/parameters"))
+         (params (call-with-input-file file read-boot-parameters))
+         (root (boot-parameters-root-device params))
+         (version (boot-parameters-version params)))
+    (boot-parameters
+     (inherit params)
+     (kernel-arguments (append (bootable-kernel-arguments system root vers=
ion)
+                               (boot-parameters-kernel-arguments params)))=
)))
+
+(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
+file system labels."
+  (if (and (string? device) (string-prefix? "/" device))
+      #f
+      device))
+
+;;; boot.scm ends here
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 955dfa618d..40df166fd7 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -66,6 +66,7 @@ (define-module (guix scripts system)
   #:use-module (gnu image)
   #:use-module (gnu system)
   #:use-module (gnu bootloader)
+  #:use-module (gnu system boot)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system image)
   #:use-module (gnu system mapped-devices)
diff --git a/tests/boot-parameters.scm b/tests/boot-parameters.scm
index 03a1d01aff..2e7976aa6c 100644
--- a/tests/boot-parameters.scm
+++ b/tests/boot-parameters.scm
@@ -27,6 +27,7 @@ (define-module (test-boot-parameters)
   #:use-module (gnu bootloader)
   #:use-module (gnu bootloader grub)
   #:use-module (gnu system)
+  #:use-module (gnu system boot)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system uuid)
   #:use-module ((guix diagnostics) #:select (formatted-message?))
--=20
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:39 2024
Received: from localhost ([127.0.0.1]:36586 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhKE-0003c3-TL
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:39 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:37576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJl-0003YB-GF
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:13 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=fuBUMmGfDL3W87l
 vpvV4Rrmx/rNjZomQkl40E0+7qw8=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=kQUqC2HecLS/jMfevHVOcayMCIoWmBnZGfP+bQod
 9jZCVZ48gQKRQkXJEw+Hkxx45XLV7GqMD2U17JTMRWhODfnDW+yIinoP98ljSjIYxaE+AW
 20sVn1cdYZ/YVsfTceEBwJhrBlRNBZ8a2sMhFonsAI9ZxTR/bD1MFMnqJVYCk=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id b48d1f84
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 532d2ed5;
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 07/12] Rename boot-parameters to boot-alternatives when
 appropriate.
Date: Fri, 23 Feb 2024 17:51:40 -0800
Message-ID: <4e6ac07abb8ade8d10ce5a7c41836abebfb4ed4a.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Throughout the code base, the token 'boot-parameters' refers to collection of
data that is stored on disk for each system generation. It was confusing to
use it for a list of such records. This comment imposes an alternative name.

Change-Id: Iabb04dbb39f42f989692bede7304f20a69bef9fb
---
 gnu/machine/ssh.scm     | 20 ++++++++++----------
 guix/scripts/system.scm | 19 ++++++++++---------
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index fe47474470..11534c6740 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -414,7 +414,7 @@ (define not-config?
     (('gnu _ ...) #t)
     (_ #f)))
 
-(define (machine-boot-parameters machine)
+(define (machine->boot-alternatives machine)
   "Monadic procedure returning a list of 'boot-parameters' for the generations
 of MACHINE's system profile, ordered from most recent to oldest."
   (define bootable-kernel-arguments
@@ -503,14 +503,14 @@ (define (deploy-managed-host machine)
                                   (machine-become-command machine)))
 
   (mlet %store-monad ((_ (check-deployment-sanity machine))
-                      (boot-parameters (machine-boot-parameters machine)))
+                      (boot-alternatives (machine->boot-alternatives machine)))
     ;; Make sure code that check %CURRENT-SYSTEM, such as
     ;; %BASE-INITRD-MODULES, gets to see the right value.
     (parameterize ((%current-system system)
                    (%current-target-system #f))
       (let* ((os (machine-operating-system machine))
              (eval (cut machine-remote-eval machine <>))
-             (menu-entries (map boot-parameters->menu-entry boot-parameters))
+             (menu-entries (map boot-parameters->menu-entry boot-alternatives))
              (bootloader-configuration (operating-system-bootloader os))
              (bootcfg (operating-system-bootcfg os menu-entries)))
         (define-syntax-rule (eval/error-handling condition handler ...)
@@ -581,19 +581,19 @@ (define (roll-back-managed-host machine)
   (define roll-back-failure
     (condition (&message (message (G_ "could not roll-back machine")))))
 
-  (mlet* %store-monad ((boot-parameters (machine-boot-parameters machine))
-                       (_ -> (if (< (length boot-parameters) 2)
+  (mlet* %store-monad ((boot-alternatives (machine->boot-alternatives machine))
+                       (_ -> (if (< (length boot-alternatives) 2)
                                  (raise roll-back-failure)))
                        (entries -> (map boot-parameters->menu-entry
-                                        (list (second boot-parameters))))
+                                        (list (second boot-alternatives))))
                        (locale -> (boot-parameters-locale
-                                   (second boot-parameters)))
+                                   (second boot-alternatives)))
                        (crypto-dev -> (boot-parameters-store-crypto-devices
-                                       (second boot-parameters)))
+                                       (second boot-alternatives)))
                        (store-dir -> (boot-parameters-store-directory-prefix
-                                      (second boot-parameters)))
+                                      (second boot-alternatives)))
                        (old-entries -> (map boot-parameters->menu-entry
-                                            (drop boot-parameters 2)))
+                                            (drop boot-alternatives 2)))
                        (bootloader -> (operating-system-bootloader
                                        (machine-operating-system machine)))
                        (bootcfg (lower-object
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 09d29dbbb1..fd9f0727ee 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,9 +323,9 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
 
-(define* (profile-boot-parameters #:optional (profile %system-profile)
-                                  (numbers
-                                   (reverse (generation-numbers profile))))
+(define* (profile->boot-alternatives #:optional (profile %system-profile)
+                                     (numbers
+                                      (reverse (generation-numbers profile))))
   "Return a list of 'boot-parameters' for the generations of PROFILE specified
 by NUMBERS, which is a list of generation numbers. The list is ordered from
 the most recent to the oldest profiles."
@@ -390,18 +390,19 @@ (define (reinstall-bootloader store number)
                              (bootloader bootloader)))
 
          ;; Make the specified system generation the default entry.
-         (params (first (profile-boot-parameters %system-profile
-                                                 (list number))))
+         (params (first (profile->boot-alternatives %system-profile
+                                                    (list number))))
          (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))))
-         (old-params (profile-boot-parameters
-                       %system-profile old-generations))
+         (previous-boot-alternatives (profile->boot-alternatives
+                                      %system-profile old-generations))
          (entries (list (boot-parameters->menu-entry params)))
-         (old-entries (map boot-parameters->menu-entry old-params)))
+         (old-entries (map boot-parameters->menu-entry
+                           previous-boot-alternatives)))
     (run-with-store store
       (mlet* %store-monad
           ((bootcfg (lower-object
@@ -817,7 +818,7 @@ (define* (perform-action action image
           os
           (if (eq? action 'init)
               '()
-              (map boot-parameters->menu-entry (profile-boot-parameters))))))
+              (map boot-parameters->menu-entry (profile->boot-alternatives))))))
 
   (when (eq? action 'reconfigure)
     (maybe-suggest-running-guix-pull)
-- 
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:38 2024
Received: from localhost ([127.0.0.1]:36584 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhKE-0003bv-HU
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:38 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:41020)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJn-0003ZN-23
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:11 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=5FUNxGMiszupQFC
 uJkwVx3EeqqPXt+UZpqA0uAybdpM=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=pPrEKyCAmkW7QrXA2n/TFUyvZsLJYQdoApoAIHwJ
 M9N83ldUM9WSW/KRqg9Pr+AJHYMQ8W2I4RsnC5lzJsRdR0WWjiN3esfTVAA+qcwckXNqNm
 sexLs/CTcKhuHZ6X5gvOFsp/dw+iWlxR9IoNye8qZxnVvFBovetnv7eyL2RC4=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id fcde3106
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:57 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id a0f668d3;
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 10/12] Simplify profile->boot-alternatives.
Date: Fri, 23 Feb 2024 17:51:43 -0800
Message-ID: <ab0d962a458c1d6d86ac2d87153e83efa4c24801.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Change-Id: If31eeb4cef4f5a107a0ee5ad3f117bf38629ac38
---
 guix/scripts/system.scm | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index fd9f0727ee..3df37e5510 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -329,20 +329,16 @@ (define* (profile->boot-alternatives #:optional (profile %system-profile)
   "Return a list of 'boot-parameters' for the generations of PROFILE specified
 by NUMBERS, which is a list of generation numbers. The list is ordered from
 the most recent to the oldest profiles."
-  (define (system->boot-parameters system number epoch)
+  (define (generation->boot-parameters number)
     (unless-file-not-found
-     (let* ((params           (read-boot-parameters-file system))
+     (let* ((system           (generation-file-name profile number))
+            (params           (read-boot-parameters-file system))
+            (epoch            (stat:mtime (lstat system)))
             (text             (boot-parameters-label params)))
        (boot-parameters
         (inherit params)
         (label (decorated-boot-label text number epoch))))))
-  (let* ((systems (map (cut generation-file-name profile <>)
-                       numbers))
-         (times   (map (lambda (system)
-                         (unless-file-not-found
-                          (stat:mtime (lstat system))))
-                       systems)))
-    (filter-map system->boot-parameters systems numbers times)))
+  (filter-map generation->boot-parameters numbers))
 
 
 ;;;
-- 
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:38 2024
Received: from localhost ([127.0.0.1]:36582 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhKD-0003br-TL
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:38 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:41018)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJm-0003Ye-Tt
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:11 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=MD1y2I360PM4KNJ
 xEsOQSlUegSfyM4yZtDQwM1m0ha4=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=Pg7+mAiCz+oYt4GLSC81S7ees9vOqU9FKdEI5DjZ
 fkJ/Kg6rP+WPRu7GorYyRcYCemlENuF0ra4uoCtfEDR3u4+Hp6N+5gd3rF65ZsOoOmue4+
 KInbZMd15evkkFRK5S2vdyObbC6dAI8zyvqGBnDT/1175PiMY6W/nrMXjps4c=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id c4ab977b
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:57 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 4dd50758;
 Sat, 24 Feb 2024 01:51:57 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 11/12] Split generation->boot-parameters out of
 profile->boot-alternatives.
Date: Fri, 23 Feb 2024 17:51:44 -0800
Message-ID: <f5ebe1834d5a58691d812ffc57227fb13463b343.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Change-Id: I51ef1a4fa8fd18104d28a6a845707d7dedde3782
---
 guix/scripts/system.scm | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 3df37e5510..7f6ba20ef9 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,22 +323,27 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
 
+(define (generation->boot-parameters profile number)
+  "Return the 'boot-parameters' for the generation of PROFILE specified
+by NUMBER."
+  (unless-file-not-found
+   (let* ((system (generation-file-name profile number))
+          (params (read-boot-parameters-file system))
+          (epoch (stat:mtime (lstat system)))
+          (text (boot-parameters-label params)))
+     (boot-parameters
+      (inherit params)
+      (label (decorated-boot-label text number epoch))))))
+
 (define* (profile->boot-alternatives #:optional (profile %system-profile)
                                      (numbers
                                       (reverse (generation-numbers profile))))
   "Return a list of 'boot-parameters' for the generations of PROFILE specified
 by NUMBERS, which is a list of generation numbers. The list is ordered from
 the most recent to the oldest profiles."
-  (define (generation->boot-parameters number)
-    (unless-file-not-found
-     (let* ((system           (generation-file-name profile number))
-            (params           (read-boot-parameters-file system))
-            (epoch            (stat:mtime (lstat system)))
-            (text             (boot-parameters-label params)))
-       (boot-parameters
-        (inherit params)
-        (label (decorated-boot-label text number epoch))))))
-  (filter-map generation->boot-parameters numbers))
+  (filter-map (lambda (number)
+                (generation->boot-parameters profile number))
+              numbers))
 
 
 ;;;
@@ -386,8 +391,7 @@ (define (reinstall-bootloader store number)
                              (bootloader bootloader)))
 
          ;; Make the specified system generation the default entry.
-         (params (first (profile->boot-alternatives %system-profile
-                                                    (list number))))
+         (params (generation->boot-parameters %system-profile number))
          (locale (boot-parameters-locale params))
          (store-crypto-devices (boot-parameters-store-crypto-devices params))
          (store-directory-prefix
-- 
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:15 2024
Received: from localhost ([127.0.0.1]:36551 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhJr-0003am-Fs
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:15 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:41020)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJm-0003ZN-8V
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=3bmMbn8pjpS2E3l
 7ZFHNeML7YSmQj/eAxisDQXbLLPc=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=p7rTC1dNsggapIUQQVJfb4eMXbEBD8vQyEDzHfdx
 wbH3fANerkNphu5+nRG0hKF6abyZMTw7t32LuNWA7yFZF+8S9AkOk0nj9VszepYPXcAJOz
 IJSZbpkDvobtEsz92O8v2uSQMH/TiISkykt3aJ7GeFCmWJPFPKhVq8VXXaEO0=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 9189a85f
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:57 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 99433eed;
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 09/12] Give a separate name to a commonly used expression.
Date: Fri, 23 Feb 2024 17:51:42 -0800
Message-ID: <d0450ee78c1249ef2cc2138a7f6526c69d9ae977.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Change-Id: I8d70684142bea736042d6c9dc8276ea7bdb9c181
---
 gnu/machine/ssh.scm | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 9adb5e79b9..45ab8b9868 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -584,14 +584,11 @@ (define (roll-back-managed-host machine)
   (mlet* %store-monad ((boot-alternatives (machine->boot-alternatives machine))
                        (_ -> (if (< (length boot-alternatives) 2)
                                  (raise roll-back-failure)))
-                       (entries -> (map boot-parameters->menu-entry
-                                        (list (second boot-alternatives))))
-                       (locale -> (boot-parameters-locale
-                                   (second boot-alternatives)))
-                       (crypto-dev -> (boot-parameters-store-crypto-devices
-                                       (second boot-alternatives)))
-                       (store-dir -> (boot-parameters-store-directory-prefix
-                                      (second boot-alternatives)))
+                       (parameters (second boot-alternatives))
+                       (entries -> (list (boot-parameters->menu-entry parameters)))
+                       (locale -> (boot-parameters-locale parameters))
+                       (crypto-dev -> (boot-parameters-store-crypto-devices parameters))
+                       (store-dir -> (boot-parameters-store-directory-prefix parameters))
                        (old-entries -> (map boot-parameters->menu-entry
                                             (drop boot-alternatives 2)))
                        (bootloader -> (operating-system-bootloader
-- 
2.41.0





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

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:15 2024
Received: from localhost ([127.0.0.1]:36549 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhJq-0003ad-SG
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:15 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:41018)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJm-0003Ye-04
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=47VmDdzPyRcCeXb
 rRFTGuJwF+jJhlB91vKOm+qu4pyQ=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=RLRxHnuzPnzLdoyLyc+acwXJqOX52Euk+6uhIedH
 XBycuUllKjlgSk2trkR0KPWAVK0B1X022xVMF0/w9cjcCci07P3G/lby2Hk+IAXlXKwe+e
 +qV7EYk7Xj5HsorhZ386o6PFJ5+DnDLSWirOTqZoi357wqbtGqzasdALUVqzQ=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 713d875d
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:57 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 0dd6cad5;
 Sat, 24 Feb 2024 01:51:57 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 12/12] Encapsulate <boot-parameters> to retain generation,
 system-path and epoch.
Date: Fri, 23 Feb 2024 17:51:45 -0800
Message-ID: <f0591fbb312e8e9a0631df969748ed2047b7b587.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Change-Id: Iaef0b0a3fa9240ca8315a9699bcf4a7bfe908e33
---
 gnu/machine/ssh.scm     | 32 ++++++++++++++++++++------------
 gnu/system/boot.scm     | 14 ++++++++++++++
 guix/scripts/system.scm | 32 +++++++++++++++++++++-----------
 3 files changed, 55 insertions(+), 23 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 45ab8b9868..61125dddce 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -415,8 +415,8 @@ (define not-config?
     (_ #f)))
 
 (define (machine->boot-alternatives machine)
-  "Monadic procedure returning a list of 'boot-parameters' for the generations
-of MACHINE's system profile, ordered from most recent to oldest."
+  "Monadic procedure returning a list of <boot-alternative> records for the
+generations of MACHINE's system profile, ordered from most recent to oldest."
   (define bootable-kernel-arguments
     (@@ (gnu system) bootable-kernel-arguments))
 
@@ -460,13 +460,18 @@ (define (machine->boot-alternatives machine)
                                 read-boot-parameters))
                       (root (boot-parameters-root-device params))
                       (text (boot-parameters-label params))
-                      (version (boot-parameters-version params)))
-                 (boot-parameters
-                  (inherit params)
-                  (label (decorated-boot-label text generation epoch))
-                  (kernel-arguments
-                   (append (bootable-kernel-arguments system-path root version)
-                           (boot-parameters-kernel-arguments params))))))))
+                      (version (boot-parameters-version params))
+                      (parameters (boot-parameters
+                                   (inherit params)
+                                   (label (decorated-boot-label text generation epoch))
+                                   (kernel-arguments
+                                    (append (bootable-kernel-arguments system-path root version)
+                                            (boot-parameters-kernel-arguments params))))))
+                 (boot-alternative
+                  (generation generation)
+                  (system-path system-path)
+                  (epoch epoch)
+                  (parameters parameters))))))
           remote-results))))
 
 (define-syntax-rule (with-roll-back should-roll-back? mbody ...)
@@ -510,7 +515,8 @@ (define (deploy-managed-host machine)
                    (%current-target-system #f))
       (let* ((os (machine-operating-system machine))
              (eval (cut machine-remote-eval machine <>))
-             (menu-entries (map boot-parameters->menu-entry boot-alternatives))
+             (menu-entries (map boot-parameters->menu-entry
+                                (map boot-alternative-parameters boot-alternatives)))
              (bootloader-configuration (operating-system-bootloader os))
              (bootcfg (operating-system-bootcfg os menu-entries)))
         (define-syntax-rule (eval/error-handling condition handler ...)
@@ -584,13 +590,15 @@ (define (roll-back-managed-host machine)
   (mlet* %store-monad ((boot-alternatives (machine->boot-alternatives machine))
                        (_ -> (if (< (length boot-alternatives) 2)
                                  (raise roll-back-failure)))
-                       (parameters (second boot-alternatives))
+                       (chosen-alternative (second boot-alternatives))
+                       (parameters (boot-alternative-parameters chosen-alternative))
                        (entries -> (list (boot-parameters->menu-entry parameters)))
                        (locale -> (boot-parameters-locale parameters))
                        (crypto-dev -> (boot-parameters-store-crypto-devices parameters))
                        (store-dir -> (boot-parameters-store-directory-prefix parameters))
                        (old-entries -> (map boot-parameters->menu-entry
-                                            (drop boot-alternatives 2)))
+                                            (map boot-alternative-parameters
+                                                 (drop boot-alternatives 2))))
                        (bootloader -> (operating-system-bootloader
                                        (machine-operating-system machine)))
                        (bootcfg (lower-object
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index f5342e06ca..46aad7eeaa 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -65,6 +65,13 @@ (define-module (gnu system boot)
             read-boot-parameters
             read-boot-parameters-file
 
+            boot-alternative
+            boot-alternative?
+            boot-alternative-generation
+            boot-alternative-system-path
+            boot-alternative-epoch
+            boot-alternative-parameters
+
             epoch->date-string
             decorated-boot-label
             boot-parameters->menu-entry
@@ -271,6 +278,13 @@ (define (read-boot-parameters-file system)
      (kernel-arguments (append (bootable-kernel-arguments system root version)
                                (boot-parameters-kernel-arguments params))))))
 
+(define-record-type* <boot-alternative>
+  boot-alternative make-boot-alternative boot-alternative?
+  (generation boot-alternative-generation)
+  (system-path boot-alternative-system-path)
+  (epoch boot-alternative-epoch)
+  (parameters 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
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 7f6ba20ef9..8e1f6e8f06 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,26 +323,31 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
 
-(define (generation->boot-parameters profile number)
-  "Return the 'boot-parameters' for the generation of PROFILE specified
+(define (generation->boot-alternative profile number)
+  "Return the 'boot-alternative' for the generation of PROFILE specified
 by NUMBER."
   (unless-file-not-found
    (let* ((system (generation-file-name profile number))
           (params (read-boot-parameters-file system))
           (epoch (stat:mtime (lstat system)))
-          (text (boot-parameters-label params)))
-     (boot-parameters
-      (inherit params)
-      (label (decorated-boot-label text number epoch))))))
+          (text (boot-parameters-label params))
+          (parameters (boot-parameters
+                       (inherit params)
+                       (label (decorated-boot-label text number epoch)))))
+     (boot-alternative
+      (generation generation)
+      (system-path system-path)
+      (epoch epoch)
+      (parameters parameters)))))
 
 (define* (profile->boot-alternatives #:optional (profile %system-profile)
                                      (numbers
                                       (reverse (generation-numbers profile))))
-  "Return a list of 'boot-parameters' for the generations of PROFILE specified
+  "Return a list of 'boot-alternative' for the generations of PROFILE specified
 by NUMBERS, which is a list of generation numbers. The list is ordered from
 the most recent to the oldest profiles."
   (filter-map (lambda (number)
-                (generation->boot-parameters profile number))
+                (generation->boot-alternative profile number))
               numbers))
 
 
@@ -391,7 +396,9 @@ (define (reinstall-bootloader store number)
                              (bootloader bootloader)))
 
          ;; Make the specified system generation the default entry.
-         (params (generation->boot-parameters %system-profile number))
+         (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
@@ -402,7 +409,8 @@ (define (reinstall-bootloader store number)
                                       %system-profile old-generations))
          (entries (list (boot-parameters->menu-entry params)))
          (old-entries (map boot-parameters->menu-entry
-                           previous-boot-alternatives)))
+                           (map boot-alternative-parameters
+                                previous-boot-alternatives))))
     (run-with-store store
       (mlet* %store-monad
           ((bootcfg (lower-object
@@ -818,7 +826,9 @@ (define* (perform-action action image
           os
           (if (eq? action 'init)
               '()
-              (map boot-parameters->menu-entry (profile->boot-alternatives))))))
+              (map boot-parameters->menu-entry
+                   (map boot-alternative-parameters
+                        (profile->boot-alternatives)))))))
 
   (when (eq? action 'reconfigure)
     (maybe-suggest-running-guix-pull)
-- 
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:14 2024
Received: from localhost ([127.0.0.1]:36547 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhJq-0003aV-Bz
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:14 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:41018)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJi-0003Ye-2d
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:09 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=TYjSqt20F3oyd/m
 CHH1WcOjJ0noWTnNh6GAVmwY/EKU=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=RJy5kZ+bA43J6ZUxU9eRGj2ptr8ywM2Wy3Rs8fYV
 06tn42rVqMp0tQ44ePzF2QszY1Plcg7hONjbj3LoXQbnBd6/0rlSIm/8+5bNWmHz/htchy
 GoempgsiNfYQcZPXgdOpDtll1c4XWRdBt0f69mI4z8vjMgl5tN0Vqql/kc0TQ=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 16beef28
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 267bae45;
 Sat, 24 Feb 2024 01:51:55 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 05/12] Move epoch->date-string to gnu/system/boot.scm and use
 it elsewhere.
Date: Fri, 23 Feb 2024 17:51:38 -0800
Message-ID: <c339fdfe0fde00cdd111be66adaafcbd62e8143a.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Change-Id: I6a5f793567221f81edd7b2d8d9f0f3e801d1b113
---
 gnu/machine/ssh.scm     | 10 ++++------
 gnu/system/boot.scm     |  8 ++++++++
 guix/scripts/system.scm | 10 ++--------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 0ffe71367c..449b65dbfb 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -444,10 +444,10 @@ (define (machine-boot-parameters machine)
                                                              generation))
                           (boot-parameters-path (string-append system-path
                                                                "/parameters"))
-                          (time (stat:mtime (lstat system-path))))
+                          (epoch (stat:mtime (lstat system-path))))
                      (list generation
                            system-path
-                           time
+                           epoch
                            (read-file boot-parameters-path))))
                  (reverse (generation-numbers %system-profile)))))))
 
@@ -455,7 +455,7 @@ (define (machine-boot-parameters machine)
     (return
      (map (lambda (generation)
             (match generation
-              ((generation system-path time serialized-params)
+              ((generation system-path epoch serialized-params)
                (let* ((params (call-with-input-string serialized-params
                                 read-boot-parameters))
                       (root (boot-parameters-root-device params))
@@ -466,9 +466,7 @@ (define (machine-boot-parameters machine)
                   (label
                    (string-append label " (#"
                                   (number->string generation) ", "
-                                  (let ((time (make-time time-utc 0 time)))
-                                    (date->string (time-utc->date time)
-                                                  "~Y-~m-~d ~H:~M"))
+                                  (epoch->date-string epoch)
                                   ")"))
                   (kernel-arguments
                    (append (bootable-kernel-arguments system-path root version)
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index d3f58e1ade..df04ef92da 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -41,6 +41,7 @@ (define-module (gnu system boot)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-19)
   #:use-module (srfi srfi-35)
   #:use-module (rnrs bytevectors)
   #:export (boot-parameters
@@ -64,6 +65,7 @@ (define-module (gnu system boot)
             read-boot-parameters
             read-boot-parameters-file
 
+            epoch->date-string
             boot-parameters->menu-entry
 
             ensure-not-/dev))
@@ -276,6 +278,12 @@ (define (ensure-not-/dev device)
       #f
       device))
 
+(define (epoch->date-string epoch)
+  "Return a string representing the date for EPOCH seconds."
+  (let ((time (make-time time-utc 0 epoch)))
+    (date->string (time-utc->date time)
+                  "~Y-~m-~d ~H:~M")))
+
 (define (boot-parameters->menu-entry conf)
   "Return a <menu-entry> instance given CONF, a <boot-parameters> instance."
   (let* ((kernel (boot-parameters-kernel conf))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 86ee2ddc76..47c072ba5c 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,19 +323,13 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
 
-(define (epoch->date-string epoch)
-  "Return a string representing the date for EPOCH seconds."
-  (let ((time (make-time time-utc 0 epoch)))
-    (date->string (time-utc->date time)
-                  "~Y-~m-~d ~H:~M")))
-
 (define* (profile-boot-parameters #:optional (profile %system-profile)
                                   (numbers
                                    (reverse (generation-numbers profile))))
   "Return a list of 'boot-parameters' for the generations of PROFILE specified
 by NUMBERS, which is a list of generation numbers. The list is ordered from
 the most recent to the oldest profiles."
-  (define (system->boot-parameters system number time)
+  (define (system->boot-parameters system number epoch)
     (unless-file-not-found
      (let* ((params           (read-boot-parameters-file system))
             (label            (boot-parameters-label params)))
@@ -343,7 +337,7 @@ (define* (profile-boot-parameters #:optional (profile %system-profile)
          (inherit params)
          (label (string-append label " (#"
                                (number->string number) ", "
-                               (epoch->date-string time) ")"))))))
+                               (epoch->date-string epoch) ")"))))))
   (let* ((systems (map (cut generation-file-name profile <>)
                        numbers))
          (times   (map (lambda (system)
-- 
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:14 2024
Received: from localhost ([127.0.0.1]:36545 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhJq-0003aO-2S
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:14 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:37576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJk-0003YB-IY
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:09 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=G1N8ZklrS4vkAgg
 +RWhHzTmtfzYctpiC2LGdDiRx8Bc=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=g5t++sRcDu+6TfrUDPVE5Qzep6Heul/GCLOQ5E5J
 FLcQe7QjK2Ft12fnffMyItvtQuPLd0tW/hwaZDUUWAC07kPqUYxti1xXwokLWH2V58X7zL
 qbxav2izw6tiKmsHt8dPtiqsUxmw6q3nQnilzRMVWODWrAit3ed6mE/azWv2w=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id b3877c26
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id e65090a7;
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 08/12] Rename two remote variables confusingly named
 'generations'.
Date: Fri, 23 Feb 2024 17:51:41 -0800
Message-ID: <4fc8cce4e11bad8521b4afb93642de7c872d2d63.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Both refer to data sets returned from the remote expression, and one of them
shadowed an element of itself.

Change-Id: Ibd8a3036126d9da1215cfc191884c0f54df637df
---
 gnu/machine/ssh.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 11534c6740..9adb5e79b9 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -451,10 +451,10 @@ (define (machine->boot-alternatives machine)
                            (read-file boot-parameters-path))))
                  (reverse (generation-numbers %system-profile)))))))
 
-  (mlet* %store-monad ((generations (machine-remote-eval machine remote-exp)))
+  (mlet* %store-monad ((remote-results (machine-remote-eval machine remote-exp)))
     (return
-     (map (lambda (generation)
-            (match generation
+     (map (lambda (remote-result)
+            (match remote-result
               ((generation system-path epoch serialized-params)
                (let* ((params (call-with-input-string serialized-params
                                 read-boot-parameters))
@@ -467,7 +467,7 @@ (define (machine->boot-alternatives machine)
                   (kernel-arguments
                    (append (bootable-kernel-arguments system-path root version)
                            (boot-parameters-kernel-arguments params))))))))
-          generations))))
+          remote-results))))
 
 (define-syntax-rule (with-roll-back should-roll-back? mbody ...)
   "Catch exceptions that arise when binding MBODY, a monadic expression in
-- 
2.41.0





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

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:14 2024
Received: from localhost ([127.0.0.1]:36543 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhJp-0003a9-Ew
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:13 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:37576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJj-0003YB-Eh
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:08 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=bfr6sfF4lqOSAsu
 DUIysF5plQBf5x4N2yUHFIeKF+R0=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=d1UtXOHqGfuM8VxVrdi0HbNhxp5rSdL2MQe1zYWo
 CTKBd9UhsHKD3mmEmcSOfA5K8OZ8ST1GaNAmNgzGy4iLhf+TlVq/vPL406QbNfcd40kgdt
 zf5S5kWrujSTMxy0POvqu3rm2aQF76g6GXaWhrzHEMUE1mLhC4wXSFgoHpcHE=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 6485b81d
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id f74d228f;
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 06/12] Offer a uniform decorated-boot-label and use it.
Date: Fri, 23 Feb 2024 17:51:39 -0800
Message-ID: <0ec0c6abe0ee8020257c599c03485318bf9fd37f.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Change-Id: Id348c3047df2353f76b1bad0eb2a3e0fa17e474c
---
 gnu/machine/ssh.scm     |  8 ++------
 gnu/system/boot.scm     | 13 +++++++++++++
 guix/scripts/system.scm |  8 +++-----
 3 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 449b65dbfb..fe47474470 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -459,15 +459,11 @@ (define (machine-boot-parameters machine)
                (let* ((params (call-with-input-string serialized-params
                                 read-boot-parameters))
                       (root (boot-parameters-root-device params))
-                      (label (boot-parameters-label params))
+                      (text (boot-parameters-label params))
                       (version (boot-parameters-version params)))
                  (boot-parameters
                   (inherit params)
-                  (label
-                   (string-append label " (#"
-                                  (number->string generation) ", "
-                                  (epoch->date-string epoch)
-                                  ")"))
+                  (label (decorated-boot-label text generation epoch))
                   (kernel-arguments
                    (append (bootable-kernel-arguments system-path root version)
                            (boot-parameters-kernel-arguments params))))))))
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index df04ef92da..f5342e06ca 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -66,6 +66,7 @@ (define-module (gnu system boot)
             read-boot-parameters-file
 
             epoch->date-string
+            decorated-boot-label
             boot-parameters->menu-entry
 
             ensure-not-/dev))
@@ -284,6 +285,18 @@ (define (epoch->date-string epoch)
     (date->string (time-utc->date time)
                   "~Y-~m-~d ~H:~M")))
 
+(define (decorated-boot-label text generation epoch)
+  "Return a string for a nice boot label that includes TEXT, a numbered GENERATION,
+and a timestamp derived from EPOCH seconds."
+  (let* ((numbered (lambda (number) (string-append "#" (number->string number))))
+         (count (and=> generation numbered))
+         (timestamp (and=> epoch epoch->date-string))
+         (extras (filter identity (list count timestamp)))
+         (helpful (if (null? extras)
+                      ""
+                      (string-append "(" (string-join extras ", ") ")"))))
+    (string-join (list text helpful))))
+
 (define (boot-parameters->menu-entry conf)
   "Return a <menu-entry> instance given CONF, a <boot-parameters> instance."
   (let* ((kernel (boot-parameters-kernel conf))
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 47c072ba5c..09d29dbbb1 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -332,12 +332,10 @@ (define* (profile-boot-parameters #:optional (profile %system-profile)
   (define (system->boot-parameters system number epoch)
     (unless-file-not-found
      (let* ((params           (read-boot-parameters-file system))
-            (label            (boot-parameters-label params)))
+            (text             (boot-parameters-label params)))
        (boot-parameters
-         (inherit params)
-         (label (string-append label " (#"
-                               (number->string number) ", "
-                               (epoch->date-string epoch) ")"))))))
+        (inherit params)
+        (label (decorated-boot-label text number epoch))))))
   (let* ((systems (map (cut generation-file-name profile <>)
                        numbers))
          (times   (map (lambda (system)
-- 
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:13 2024
Received: from localhost ([127.0.0.1]:36541 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhJo-0003Zx-P0
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:13 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:37576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJi-0003YB-D5
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:07 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=hVpMq2zykFqmUpw
 EC8fnoeKZbmuI2fNnQhEl9akmS5Y=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=qUS15gMLd1AhJIiWzQTTWZK3tqjE0QQCqT0xAK31
 7uztAuZK5Zsesv4xGh275jrkZvIqhMpAWBa6akLC+V5j+yDimLekGjwZTtDhCcthq4Bu4e
 Mt51bgbSQjnjO5CkqJuEhjId/h9NZbaowt0q5XBsjhxSAliqW1SWxXk+W2F78=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 31d60c7d
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:56 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 9e826075;
 Sat, 24 Feb 2024 01:51:55 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 04/12] Rename seconds->string procedure to epoch->date-string.
Date: Fri, 23 Feb 2024 17:51:37 -0800
Message-ID: <920e58bf7db229d45e078f1a2e02b6d9052e1915.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Change-Id: I2b9aaa816b3ca84c32f7d6fa690245b149228310
---
 guix/scripts/system.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 40df166fd7..86ee2ddc76 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -323,9 +323,9 @@ (define-syntax-rule (unless-file-not-found exp)
           #f
           (apply throw args)))))
 
-(define (seconds->string seconds)
-  "Return a string representing the date for SECONDS."
-  (let ((time (make-time time-utc 0 seconds)))
+(define (epoch->date-string epoch)
+  "Return a string representing the date for EPOCH seconds."
+  (let ((time (make-time time-utc 0 epoch)))
     (date->string (time-utc->date time)
                   "~Y-~m-~d ~H:~M")))
 
@@ -343,7 +343,7 @@ (define* (profile-boot-parameters #:optional (profile %system-profile)
          (inherit params)
          (label (string-append label " (#"
                                (number->string number) ", "
-                               (seconds->string time) ")"))))))
+                               (epoch->date-string time) ")"))))))
   (let* ((systems (map (cut generation-file-name profile <>)
                        numbers))
          (times   (map (lambda (system)
-- 
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:12 2024
Received: from localhost ([127.0.0.1]:36539 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhJo-0003Zp-5E
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:12 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:37576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJh-0003YB-8Q
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:06 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=EFWZ6M0fHdrIxDF
 yhRF0gEG8ruIshyAhIa7hcTQka/E=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=kaPS6VvRJVNh+gT/uGZXn0kr5pD0XkTIlRmjsgWd
 lD0EsGTgpKzSaA6Qk0dTHsmASFq0hp+DfnwnqJkc/xjW9msKkTT8v5w9U2lgU2jUKwa8b+
 3wfBHbhdaSgpdI2jYqgWxi8eckX5bi8zVt0BuSDseYLTdDpdHmGW80n1xPyyI=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id c1670776
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:55 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 057730c4;
 Sat, 24 Feb 2024 01:51:55 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 01/12] Fix bug where the extra menu entries for a bootloader
 were shown twice.
Date: Fri, 23 Feb 2024 17:51:34 -0800
Message-ID: <25f1480b74f37095077b2cbbb8b0a169a272365d.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

The extra menu entries are already being added in each bootloaders, as
applicable.
---
 guix/scripts/system.scm | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index bf3d2f9044..955dfa618d 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -407,8 +407,7 @@ (define (reinstall-bootloader store number)
           (delv number (reverse (generation-numbers %system-profile))))
          (old-params (profile-boot-parameters
                        %system-profile old-generations))
-         (entries (cons (boot-parameters->menu-entry params)
-                        (boot-parameters-bootloader-menu-entries params)))
+         (entries (list (boot-parameters->menu-entry params)))
          (old-entries (map boot-parameters->menu-entry old-params)))
     (run-with-store store
       (mlet* %store-monad
-- 
2.41.0





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 24 Feb 2024 01:59:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:59:12 2024
Received: from localhost ([127.0.0.1]:36535 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdhJn-0003Zb-CD
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:12 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:41018)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdhJh-0003Ye-9W
 for 69343 <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:59:05 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=LEpLdcDW5XI6JcB
 iqCxX5+ctUaqlDUajJQiqlHANPlU=;
 h=references:in-reply-to:date:subject:
 cc:to:from; d=lease-up.com; b=WwH2RREDzgYR4uM4IDRKwaPbseqOsbFM5cI9exZU
 UE+SqntpV0vNEXyGi3fazv7mauhKSfvjhye07V1fnRbfTl5HVRT3ezCUacHBvIqUmR0osq
 eU8eqQqnpbJ/vjHImNGgUibZa/+rG2JUTgWHAeV9ja91+XpWvApyVqQYiVobg=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id e1233e51
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:51:55 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id cae211ed;
 Sat, 24 Feb 2024 01:51:55 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH 03/12] Also move boot-parameters->menu-entry.
Date: Fri, 23 Feb 2024 17:51:36 -0800
Message-ID: <55f27c88ae2a7d9e6d9b73a306c267e5a312ad2a.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
In-Reply-To: <cover.1708736440.git.felix.lechner@HIDDEN>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: 69343
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.8 (/)

Change-Id: I794198e074b6d3012526a3056599ee3db1f1cdba
---
 gnu/system.scm      | 28 ----------------------------
 gnu/system/boot.scm | 24 ++++++++++++++++++++++++
 2 files changed, 24 insertions(+), 28 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index a438137731..e748066e16 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -150,8 +150,6 @@ (define-module (gnu system)
 
             hurd-default-essential-services
 
-            boot-parameters->menu-entry
-
             local-host-aliases                    ;deprecated
             %root-account
             %setuid-programs
@@ -304,32 +302,6 @@ (define* (operating-system-kernel-arguments
   (append (bootable-kernel-arguments os root-device version)
           (operating-system-user-kernel-arguments os)))
 
-
-;;;
-;;; Boot parameters
-;;;
-
-(define (boot-parameters->menu-entry conf)
-  "Return a <menu-entry> instance given CONF, a <boot-parameters> instance."
-  (let* ((kernel (boot-parameters-kernel conf))
-         (multiboot-modules (boot-parameters-multiboot-modules conf))
-         (multiboot? (pair? multiboot-modules)))
-    (menu-entry
-     (label (boot-parameters-label conf))
-     (device (boot-parameters-store-device conf))
-     (device-mount-point (boot-parameters-store-mount-point conf))
-     (linux (and (not multiboot?) kernel))
-     (linux-arguments (if (not multiboot?)
-                          (boot-parameters-kernel-arguments conf)
-                          '()))
-     (initrd (boot-parameters-initrd conf))
-     (multiboot-kernel (and multiboot? kernel))
-     (multiboot-arguments (if multiboot?
-                              (boot-parameters-kernel-arguments conf)
-                              '()))
-     (multiboot-modules (if multiboot?
-                            (boot-parameters-multiboot-modules conf)
-                            '())))))
 
 
 ;;;
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 87b0184f98..d3f58e1ade 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -64,6 +64,8 @@ (define-module (gnu system boot)
             read-boot-parameters
             read-boot-parameters-file
 
+            boot-parameters->menu-entry
+
             ensure-not-/dev))
 
 ;;;
@@ -274,4 +276,26 @@ (define (ensure-not-/dev device)
       #f
       device))
 
+(define (boot-parameters->menu-entry conf)
+  "Return a <menu-entry> instance given CONF, a <boot-parameters> instance."
+  (let* ((kernel (boot-parameters-kernel conf))
+         (multiboot-modules (boot-parameters-multiboot-modules conf))
+         (multiboot? (pair? multiboot-modules)))
+    (menu-entry
+     (label (boot-parameters-label conf))
+     (device (boot-parameters-store-device conf))
+     (device-mount-point (boot-parameters-store-mount-point conf))
+     (linux (and (not multiboot?) kernel))
+     (linux-arguments (if (not multiboot?)
+                          (boot-parameters-kernel-arguments conf)
+                          '()))
+     (initrd (boot-parameters-initrd conf))
+     (multiboot-kernel (and multiboot? kernel))
+     (multiboot-arguments (if multiboot?
+                              (boot-parameters-kernel-arguments conf)
+                              '()))
+     (multiboot-modules (if multiboot?
+                            (boot-parameters-multiboot-modules conf)
+                            '())))))
+
 ;;; boot.scm ends here
-- 
2.41.0





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

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


Received: (at submit) by debbugs.gnu.org; 24 Feb 2024 01:08:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 23 20:08:18 2024
Received: from localhost ([127.0.0.1]:60582 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rdgWX-0000w4-9q
	for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:08:17 -0500
Received: from lists.gnu.org ([209.51.188.17]:44954)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1rdgWU-0000vo-IM
 for submit <at> debbugs.gnu.org; Fri, 23 Feb 2024 20:08:15 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <felix.lechner@HIDDEN>)
 id 1rdgW6-00019L-7V
 for guix-patches@HIDDEN; Fri, 23 Feb 2024 20:07:50 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from <felix.lechner@HIDDEN>)
 id 1rdgW3-00077u-67
 for guix-patches@HIDDEN; Fri, 23 Feb 2024 20:07:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=BSgVcUpqjfMU8RQ
 Ezi6CC5edwpWgCv06f5NF9C9pBa4=; h=date:subject:cc:to:from;
 d=lease-up.com; b=bwTZMkkJYo1QX9Ugpija1Ypx+Wls6ZFeMvyLMZOEmiHsyrTtBiIQ
 c5wfG2MhtCRoEZ7nJwEtkHc+LXSIbZZ+9JS/PA+m6B5OaOmzQ3pwNGg841C2yWz1jcP2W2
 SHKwPkKksIfmaAoU7AxWwkOyzGOnGsRZVSg0ONR8RdaIWANJ0=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 187341b2
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 24 Feb 2024 01:07:44 +0000 (UTC)
Received: from localhost (localhost [local])
 by localhost (OpenSMTPD) with ESMTPA id 579c22a2;
 Sat, 24 Feb 2024 01:07:44 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 00/12] Simplify bootloader data structures and procedures
Date: Fri, 23 Feb 2024 17:05:59 -0800
Message-ID: <cover.1708736440.git.felix.lechner@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Ricardo Wurmus <rekado@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=208.82.101.137;
 envelope-from=felix.lechner@HIDDEN; helo=sail-ipv4.us-core.com
X-Spam_score_int: -17
X-Spam_score: -1.8
X-Spam_bar: -
X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01,
 UNPARSEABLE_RELAY=0.001 autolearn=no autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.1 (-)
X-Debbugs-Envelope-To: submit
Cc: Felix Lechner <felix.lechner@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.1 (--)

The bootloader data structures are hard to understand because the
boot-parameter records are modified on the fly. It happened because those
records are versioned when stored on disk, and changing the data structure was
deemed to difficult. (I agree with that assessment.)

This commit series uses a new record type to separate the on-disk and the
in-memory concerns.

As for the bug fix, I never actually saw the bug but believe from reading the
code that a bug existed. The existence was not verified.

Felix Lechner (12):
  Fix bug where the extra menu entries for a bootloader were shown
    twice.
  Move <boot-parameters> record to a separate file.
  Also move boot-parameters->menu-entry.
  Rename seconds->string procedure to epoch->date-string.
  Move epoch->date-string to gnu/system/boot.scm and use it elsewhere.
  Offer a uniform decorated-boot-label and use it.
  Rename boot-parameters to boot-alternatives when appropriate.
  Rename two remote variables confusingly named 'generations'.
  Give a separate name to a commonly used expression.
  Simplify profile->boot-alternatives.
  Split generation->boot-parameters out of profile->boot-alternatives.
  Encapsulate <boot-parameters> to retain generation, system-path and
    epoch.

 gnu/machine/ssh.scm       |  74 ++++-----
 gnu/system.scm            | 252 +---------------------------
 gnu/system/boot.scm       | 336 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |  71 ++++----
 tests/boot-parameters.scm |   1 +
 5 files changed, 412 insertions(+), 322 deletions(-)
 create mode 100644 gnu/system/boot.scm


base-commit: c0f88cd18649c31c75bcddf8247b14ef3e3a66a5
-- 
2.41.0





Acknowledgement sent to Felix Lechner <felix.lechner@HIDDEN>:
New bug report received and forwarded. Copy sent to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, rekado@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 8 Mar 2024 08:30:02 UTC

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