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; 21 Sep 2024 10:25:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:25:09 2024
Received: from localhost ([127.0.0.1]:37342 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIb-0005qL-0n
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:25:09 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:42255
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIH-0005lr-Go
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:50 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914255;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=vVGYFGLJjpKS+pl5jCNhRz5iXNSJhEEPJAZPl+ywK4k=;
 b=HgYWrDv3F7dbm9ykbX2+26eD3lxa85csxcQ2kbgAjAZ/MJTVxIB7L3XDpK4+IT1STHzyUK
 k4EuJVHDc1lPnyU8joTeopvUvUgoL/8PPGnXATNaJrJ0OYOsREKGbtivTVRHKOcM/JxRT8
 19neu9/c5r4NmaqapUoQyHM00O2Y2BohOrBoO8x00kJLPslKjtiagZSnPANYQL89SjkryY
 R4Iz4AKaSahGqcL+NGGXd5O3RcPcR7ecwuZLjAetB2WFe68U/fl6n0u1kz8x5neSLjyi0P
 tZRJWp+KOolP5lzNoWs9EIKUcaFDt6QXBa1csHf1I6O7WcGObTHvze+3m+2Y8w==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id bf7f82d3
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:15 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 10/10] Encapsulate <boot-parameters> to retain generation,
 system-path and epoch.
Date: Sat, 21 Sep 2024 12:23:23 +0200
Message-ID: <8edc2882011d47a2263f3d8069defb30427f6d96.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@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>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: From: Felix Lechner <felix.lechner@HIDDEN> *
 gnu/system/boot.scm
 (<boot-alternative>): New record. (boot-alternative->menu-entry): New
 procedure.
 * gnu/machine/ssh.scm (machine->boot-alternatives): Return a boot-alternative
 encapsulating previous return value. (deploy-managed-host): Get menu-entries
 from boot-alternatives. (roll-back-managed-ho [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: Felix Lechner <felix.lechner@HIDDEN> * gnu/system/boot.scm
    (<boot-alternative>): New record. (boot-alternative->menu-entry): New procedure.
    * gnu/machine/ssh.scm (machine->boot-alternatives): Return a boot-alternative
    encapsulating previous return value. (deploy-managed-host): Get menu-entries
    from boot-alternatives. (roll-back-managed-ho [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Felix Lechner <felix.lechner@HIDDEN>

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

* gnu/machine/ssh.scm (machine->boot-alternatives): Return a
  boot-alternative encapsulating previous return value.
  (deploy-managed-host): Get menu-entries from boot-alternatives.
  (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 menu-entries from
  boot-alternatives.

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

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index eb8dba3120..3a0c5f45c6 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -418,8 +418,9 @@ (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 remote-exp
     (with-extensions (list guile-gcrypt)
       (with-imported-modules `(((guix config) => ,(make-config.scm))
@@ -451,24 +452,30 @@ (define (machine->boot-alternatives machine)
                            (read-file boot-parameters-path))))
                  (reverse (generation-numbers %system-profile)))))))
 
+  (define remote-result->boot-alternative
+    (match-lambda
+      ((generation system-path epoch serialized-params)
+       (boot-alternative
+         (generation generation)
+         (system-path system-path)
+         (epoch epoch)
+         (parameters
+           (let* ((params (call-with-input-string serialized-params
+                            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))))))))))
+
   (mlet %store-monad
       ((remote-results (machine-remote-eval machine remote-exp)))
-    (return
-     (map (lambda (remote-result)
-            (match remote-result
-              ((generation system-path epoch serialized-params)
-               (let* ((params (call-with-input-string serialized-params
-                                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))))))))
-          remote-results))))
+    (return (map remote-result->boot-alternative remote-results))))
 
 (define-syntax-rule (with-roll-back should-roll-back? mbody ...)
   "Catch exceptions that arise when binding MBODY, a monadic expression in
@@ -511,7 +518,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-alternative->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 ...)
@@ -586,7 +594,8 @@ (define (roll-back-managed-host machine)
          ((boot-alternatives (machine->boot-alternatives machine))
           (_ -> (when (< (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))
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 1e0d75212f..de312c7208 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2024 Nicolas Graves <ngraves@HIDDEN>
 ;;; Copyright © 2024 Felix Lechner <felix.lechner@HIDDEN>
 ;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
+;;; Copyright © 2024 Lilah Tascheter <lilah@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -67,9 +68,17 @@ (define-module (gnu system boot)
             read-boot-parameters-file
             bootable-kernel-arguments
 
+            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
+            boot-alternative->menu-entry
 
             ensure-not-/dev
             system-linux-image-file-name))
@@ -295,6 +304,13 @@ (define* (bootable-kernel-arguments system root-device version)
            #~(string-append (if #$version>0? "gnu.load=" "--load=")
                             #$system "/boot")))))
 
+(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)) ; <boot-parameters>
+
 (define (epoch->date-string epoch)
   "Return a string representing the date for EPOCH seconds."
   (let ((time (make-time time-utc 0 epoch)))
@@ -333,6 +349,9 @@ (define (boot-parameters->menu-entry conf)
                             (boot-parameters-multiboot-modules conf)
                             '())))))
 
+(define boot-alternative->menu-entry
+  (compose boot-parameters->menu-entry boot-alternative-parameters))
+
 (define (ensure-not-/dev device)
   "If DEVICE starts with a slash, return #f.  This is meant to filter out
 Linux device names such as /dev/sda, and to preserve GRUB device names and
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 4ca4f1fa85..0fd153a278 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,25 +328,30 @@ (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))))))
+     (boot-alternative
+      (generation number)
+      (system-path system)
+      (epoch epoch)
+      (parameters
+       (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."
-  (filter-map (cut generation->boot-parameters profile <>) numbers))
+  "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 (cut generation->boot-alternative profile <>) numbers))
 
 
 ;;;
@@ -394,7 +399,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
@@ -404,7 +411,7 @@ (define (reinstall-bootloader store number)
          (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-entries (map boot-alternative->menu-entry
                            previous-boot-alternatives)))
     (run-with-store store
       (mlet* %store-monad
@@ -822,7 +829,8 @@ (define* (perform-action action image
           os
           (if (eq? action 'init)
               '()
-              (map boot-parameters->menu-entry (profile->boot-alternatives))))))
+              (map boot-alternative->menu-entry
+                   (profile->boot-alternatives))))))
 
   (when (eq? action 'reconfigure)
     (maybe-suggest-running-guix-pull)
-- 
2.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 21 Sep 2024 10:25:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:25:09 2024
Received: from localhost ([127.0.0.1]:37340 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIa-0005qH-IG
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:25:08 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:57083
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIG-0005li-D1
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914255;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=rxvFX0W5DTBuH/E5MgZyz5ZQ2WKoV/sy8F4Pvs8vo6Q=;
 b=JYwv0zu2XCsWxpDH3IJMzKxUW5NtALufPsnyYU1V6WuThyt/jBZQo0SY+sImjTWEDRh1f1
 zOrPpNfBHWmHu6Of+z+lM8uIF9kcW5Q5HNrnDQz6NlMhC2LcsUEigQO0b257Pisi9IwAOT
 8OqGGpUmTZ2/kJ2O5DA92VyHgtfZ9K8bAYEzdoCDi7mVdHDHAsI78ahYlgmkz1TulZKVOF
 Qk0AlhdoV7oY/kSKAvWPdozJ6/tDR+Ya3p0W8lsgyBYhcHKEW/sjUnNJQmOmFGbtusUMk2
 COhrRCWqHX/B2oCGvoCpp0DLxM1JJc0iOUCS73WF+6jixuZ5iVtvP5wkwhDWug==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 633a18e3
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:15 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 09/10] Split system->boot-parameters out of
 profile->boot-alternatives.
Date: Sat, 21 Sep 2024 12:23:22 +0200
Message-ID: <470795ee2a6bcf10608519c5cf2579ce4f7092c3.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@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>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: From: Felix Lechner <felix.lechner@HIDDEN> *
 guix/scripts/system.scm
 (profile->boot-alternatives)[system->boot-parameters]: Rename, process system
 and epoch,
 and move to... (generation->boot-parameters): ...here. (reinstall-bootloader):
 Use pr [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: Felix Lechner <felix.lechner@HIDDEN> * guix/scripts/system.scm
    (profile->boot-alternatives)[system->boot-parameters]: Rename, process system
    and epoch, and move to... (generation->boot-parameters): ...here. (reinstall-bootloader):
    Use pr [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Felix Lechner <felix.lechner@HIDDEN>

* guix/scripts/system.scm
  (profile->boot-alternatives)[system->boot-parameters]: Rename, process
  system and epoch, and move to...
  (generation->boot-parameters): ...here.
  (reinstall-bootloader): Use procedure above.

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

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index cdd78a7849..4ca4f1fa85 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,26 +328,25 @@ (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 (system->boot-parameters system number epoch)
-    (unless-file-not-found
-     (let* ((params           (read-boot-parameters-file 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 (cut generation->boot-parameters profile <>) numbers))
 
 
 ;;;
@@ -395,8 +394,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 21 Sep 2024 10:25:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:25:08 2024
Received: from localhost ([127.0.0.1]:37338 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIa-0005qB-2w
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:25:08 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:42255
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIG-0005lr-Ad
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:49 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914255;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=9T1njE2aCZ6j+YeQ4S8A005gwmFm3lVRI89eZEgwyT0=;
 b=QHQ9lJTMP54U2In75DTflmLg1n1F6f8yBw0HIIfAYuDxqgIgo6zr9Qr9N/H1mq7wnNwUYE
 3FJ4REOpwYUKzDUxTAMiMqzBg6UhKDDG3OrzV3/+ErT/mtr8fS+pDWziYK2e/g/e/WuJrI
 YxDFpre1SGy6zh71lrJROHXkChX4ubmy9MgXleFN4/xL5NMc78X5+EknmpuEeHyLZG4l4i
 8z6jP0BeMM5YsI1tMn1AnqpKERFhY9Q0gJdYlUQru/8w8AEqB8VsceViunSEHhCEbU4qUb
 14bSNW+BqyGe6aQ4b62HoHyTfAGN48Ysqgp2HQfoypNNe5mAd+V3rh5oojiM9g==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id d69b71e4
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:15 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 08/10] Give a separate name to a commonly used expression.
Date: Sat, 21 Sep 2024 12:23:21 +0200
Message-ID: <0780c8928d26c112af681337065755bc84697487.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: From: 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
 | 48 ++++++++++++++++++++++ 1 file changed, 23 insertions(+), 25 deletions(-)
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: 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
    | 48 ++++++++++++++++++++++ 1 file changed, 23 insertions(+), 25 deletions(-)
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: 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 | 48 ++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 25 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index efe056dab7..eb8dba3120 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -582,31 +582,29 @@ (define (roll-back-managed-host machine)
   (define roll-back-failure
     (condition (&message (message (G_ "could not roll-back 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)))
-                       (old-entries -> (map boot-parameters->menu-entry
-                                            (drop boot-alternatives 2)))
-                       (bootloader -> (operating-system-bootloader
-                                       (machine-operating-system machine)))
-                       (bootcfg (lower-object
-                                 ((bootloader-configuration-file-generator
-                                   (bootloader-configuration-bootloader
-                                    bootloader))
-                                  bootloader entries
-                                  #:locale locale
-                                  #:store-crypto-devices crypto-dev
-                                  #:store-directory-prefix store-dir
-                                  #:old-entries old-entries)))
-                       (remote-result (machine-remote-eval machine remote-exp)))
+  (mlet* %store-monad
+         ((boot-alternatives (machine->boot-alternatives machine))
+          (_ -> (when (< (length boot-alternatives) 2)
+                  (raise roll-back-failure)))
+          (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
+                          (machine-operating-system machine)))
+          (bootcfg (lower-object
+                    ((bootloader-configuration-file-generator
+                      (bootloader-configuration-bootloader
+                       bootloader))
+                     bootloader entries
+                     #:locale locale
+                     #:store-crypto-devices crypto-dev
+                     #:store-directory-prefix store-dir
+                     #:old-entries old-entries)))
+          (remote-result (machine-remote-eval machine remote-exp)))
     (when (eqv? 'error remote-result)
       (raise roll-back-failure))))
 
-- 
2.45.2





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; 21 Sep 2024 10:24:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:24:54 2024
Received: from localhost ([127.0.0.1]:37298 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIL-0005nm-Mn
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:54 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:57083
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIF-0005li-FY
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914254;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=TjT3pDihdH2wIxr/wXOz1HwYe+sawFO+2QfF4aR19vg=;
 b=upIITOyLtzbbGSR2TyRFqOjMUibMxP1z8AUwW94hE6UpfhZVNkoDlcH8Otiu2hGTL1nmKL
 xX/XiXj046N38Tqtj5bccNS+cfeXXafnXnu2t+7aqPnuSL62vkcoOYlzoozVM0kDyLyQj5
 Ll7e1HS+5j9GNZizKiLeutF/STrwUaOGVQTe8GPJe7JmN+E/lFPonJdc6rU0WxarpQTTo+
 8nAG7bCW1eJURygv9uFyBjDOQMeo6VVZcXODRYT7f1NC5tXXTC0mCJiNafBQuQ2RlPimr9
 DhsX4zD0yvaxzhwKjGY9ekwRo/vs1vd0X24KkUQjvxXzmgWai99H57mwg0IF9w==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id a68ba946
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:14 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 07/10] Rename two remote variables confusingly named
 'generations'.
Date: Sat, 21 Sep 2024 12:23:20 +0200
Message-ID: <5a7c148ce2d6c4838d543a4dcca845d69fe059d8.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: From: Felix Lechner <felix.lechner@HIDDEN> Both refer
 to data sets returned from the remote expression, and one of them shadowed
 an element of itself. * gnu/machine/ssh.scm (machine->boot-alternatives):
 Rename generations to remote-results. 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: Felix Lechner <felix.lechner@HIDDEN> Both refer
    to data sets returned from the remote expression, and one of them shadowed
    an element of itself. * gnu/machine/ssh.scm (machine->boot-alternatives):
    Rename generations to remote-results. 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: Felix Lechner <felix.lechner@HIDDEN>

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

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

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

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index fae42ad3ce..efe056dab7 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -451,10 +451,11 @@ (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 +468,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.45.2





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; 21 Sep 2024 10:24:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:24:53 2024
Received: from localhost ([127.0.0.1]:37296 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIL-0005nf-5F
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:53 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:42255
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIF-0005lr-Ci
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914254;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=8Ov0D+T6vKnwMIl9sJeL5cgr0rwCOtUfN+OUVuNS1X4=;
 b=Lb2WFKZ/oGurTjrTp/k/UmZwF2QIdWp37ipeEO2AUr2HvZy5tegYKnku83id5fPyf9P2W5
 wbEXYgNU9Fv8PXlnOa1UCNWDReFQ2JVtbR7N6yHjo7s19etf/xMWmwo4C1yOBEXFyjuIXA
 qIr9Pqf/ASQSqOvQG6WObHSJcajN0T8ezBUfWRNJZkc70EzlXCeTS/krMovbsuojZrlWdg
 B0rCtE6eHreY/+FOcjV8kzarXNvLn1qwgQbhJVOrxtGAe9PIW8EFuXFv32JLUuBMo6gfWZ
 5X2s2VTQTAxKRFP7CXir0zQ/m4QCnnSZMPG08r0ucR91RVFyxKjTQcDxrd+GAg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 47dc3ebc
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:14 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 06/10] Rename boot-parameters to boot-alternatives when
 appropriate.
Date: Sat, 21 Sep 2024 12:23:19 +0200
Message-ID: <17be076dc405f409a84bb566d4f5c226e62d6ae8.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@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>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: From: 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 commen [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: 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 commen [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: 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 3a0116ac0d..fae42ad3ce 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -417,7 +417,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 remote-exp
@@ -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 84eb99b938..cdd78a7849 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,9 +328,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."
@@ -395,18 +395,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
@@ -823,7 +824,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 21 Sep 2024 10:24:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:24:53 2024
Received: from localhost ([127.0.0.1]:37294 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIK-0005nX-Gf
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:53 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:57083
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIE-0005li-Ku
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914253;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=vmkvk3CV8fWlh/vuzi8ThlKTTK4EJQFZPqNcin3KiIY=;
 b=k4S4f/z+8unbKZAegYatspSEgjQ3xxYjDuYp05N+KIyzDLhw3ttP1xBseX29hbgDox1TrK
 a5P61EC/+VcoCiMk+5q2CuPLOSWhPGGKEIln1MG4Hed7nbdsi61wQGGAkSKOq+A8Xrupr5
 6SHzaGc/mp6O1rEdySmxfzCEkKk3MKrM4ZNgE5DnOLE3+Jwoq2PNahrCPoKBZj71erJYdy
 Nz2Crp8zZMQ097c/3Efjx90f8s+t9MKuoF5OFal8CiCpcGkkYUFGvfaR7G53EH9k3oT3KS
 URECTaT2oHdjaRd12PNCP59KSa99IomXTKvoL+4/PhsbiVn1nlcNg2GwAM30ZQ==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 6784f214
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:13 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 05/10] Offer a uniform decorated-boot-label and use it.
Date: Sat, 21 Sep 2024 12:23:18 +0200
Message-ID: <f734db8e278920da59c704357a6bd0372ef43c6d.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@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>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: From: 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 [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: 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
    [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: 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 86c21256eb..3a0116ac0d 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 c1d58a2743..1e0d75212f 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -10,6 +10,8 @@
 ;;; Copyright © 2020 Janneke Nieuwenhuizen <jannek@HIDDEN>
 ;;; Copyright © 2020, 2022 Efraim Flashner <efraim@HIDDEN>
 ;;; Copyright © 2024 Nicolas Graves <ngraves@HIDDEN>
+;;; Copyright © 2024 Felix Lechner <felix.lechner@HIDDEN>
+;;; Copyright © 2024 Herman Rimm <herman@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -66,6 +68,7 @@ (define-module (gnu system boot)
             bootable-kernel-arguments
 
             epoch->date-string
+            decorated-boot-label
             boot-parameters->menu-entry
 
             ensure-not-/dev
@@ -298,6 +301,16 @@ (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 ((count (and generation
+                    (string-append "#" (number->string generation))))
+        (timestamp (and=> epoch epoch->date-string)))
+    (match (filter identity (list count timestamp))
+      (() text)
+      (extras (string-append text "(" (string-join extras ", ") ")")))))
+
 (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 b197812e63..84eb99b938 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -337,12 +337,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 21 Sep 2024 10:24:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:24:52 2024
Received: from localhost ([127.0.0.1]:37292 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIJ-0005nP-W1
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:52 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:42255
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIE-0005lr-JI
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:47 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914253;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=zfO9KDsRlI74OquUb/76tSbvQjvIYJ2z1nc/qpuZzcs=;
 b=n6j8pf/IJnk/px4aNQypncWcZfxpJHR0qxoocHm9c1hilYa4rxwL8R1jZDgxLaVaCCO04L
 4pfeg75bIrMmrjBj6R5MNucJLi8Hts0M6iCZyQFgagWoANS4sTVQIGBjpf2AlCatxb12lC
 Qt0MyE8x/0PebTjEH8zLj8BbsVlUC0OW012RznyZsycERFN4gJkmaPB/tDq6QolQBI2ax9
 wz9ZbQ5yfjr12qmtBMqkgXZt9EkWVGMvJ0AvE4LxH6PM8DZ8vMVwXzpaMf0/2zIGjI6zH9
 8oqq2BjlulIPcsjD8U83ufhr4+cniiLLWK6OmYJDnQjjD025/XgCaV8i+U7hdQ==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 84e07e6e
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:13 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 04/10] Move epoch->date-string to gnu/system/boot.scm and
 use it elsewhere.
Date: Sat, 21 Sep 2024 12:23:17 +0200
Message-ID: <c9dace7f7e80907dddcac5d050fc2c7152c23207.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@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>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: From: 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 [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: 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 [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: 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 863c28a13c..86c21256eb 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 2c531e4ad5..c1d58a2743 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -39,6 +39,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)
@@ -64,6 +65,7 @@ (define-module (gnu system boot)
             read-boot-parameters-file
             bootable-kernel-arguments
 
+            epoch->date-string
             boot-parameters->menu-entry
 
             ensure-not-/dev
@@ -290,6 +292,12 @@ (define* (bootable-kernel-arguments system root-device version)
            #~(string-append (if #$version>0? "gnu.load=" "--load=")
                             #$system "/boot")))))
 
+(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 cb70d36219..b197812e63 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,19 +328,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)))
@@ -348,7 +342,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 21 Sep 2024 10:24:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:24:52 2024
Received: from localhost ([127.0.0.1]:37290 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIJ-0005nI-Kj
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:51 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:57083
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxID-0005li-QW
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914252;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=NYY942th2QJl+H72R2wEkqteejvkJ8nzoBqwjGZFRMI=;
 b=YX/fIOe9Qgl/pWD/sd/JNm3On8FC3ZbYf6DncCbdzVskRcidcQxhrgTV4NWoJsPeqjqhaD
 7DkWyPLD9xXg00GCOprN65VbrWIMxGSJcrzcsoHyNGKHKHb+tBjhDx31oqlXp8K6hMWszP
 SkzFdL3/nk5WD4nOSe5deKc9xUvwyyXVL8TnaCKHKdIlYj3n++pVoyhUjRx2F8/IJyhNhz
 fLgqoUwGNeXgwxgfNRfRaGZ/sNlsPRYVzGXHq/H1aN0TPS7E7Q8g9DUaHooWAbk9tcCoKs
 QwqHgEvgXgI+qpzAt5Se24+pAdC7zi9XARuQoncTdJ2FRm6zemGIpDnz9tjSnQ==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 084a8c5f
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:12 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 03/10] Rename seconds->string procedure to
 epoch->date-string.
Date: Sat, 21 Sep 2024 12:23:16 +0200
Message-ID: <d944345dd82dfce11edb8c9a3f518fd73c65a5c2.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@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>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview: From: 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(-)
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: 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(-)
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: 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 7000c470ed..cb70d36219 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,9 +328,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")))
 
@@ -348,7 +348,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 21 Sep 2024 10:24:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:24:51 2024
Received: from localhost ([127.0.0.1]:37286 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIG-0005mn-J0
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:51 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:57083
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIB-0005li-Ke
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:45 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914252;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=26IXqhP4ocZJ66ql6huYd4LTNC6fMnEtmIf+zJm+SeA=;
 b=JKmcFmg70BJGy+0TNGOcWI6Z+GmJbXQ9aJTjlG2X0tAsCdlpw2kcfEIoO0wPeSMac6cv8W
 2YptrZ3muUCs1hhnWq3hx1Qy0HDJwQ5fz04vO06M/eef12tk5A4DkofKJPAtBHBXH3/m9d
 T5v0XQxIbQYq5Hl3X1Ykosoh8Ltt1PYoWkjjvpA1EnzppEaOteYKGZ/iIO4qhvtb3bzRmi
 nyAvEWlhy8o1Xn8eH5wxXxk6do/ukpi/ZwEzYax01Uz5rvdf98vUAfOvE4nJ9gQfzSLavj
 mYABRelirvXkHai+uRq2uOG9jTVMjyPBTY8VzY+pCCTYTDxjeKP9PfPqMPgNBg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 2639cefa
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:12 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 02/10] Move <boot-parameters> record to a separate file.
Date: Sat, 21 Sep 2024 12:23:15 +0200
Message-ID: <cee6388d584da07748378256a133492c0be0a70d.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@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>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  From: 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, 
 bootable-kernel-arguments, ensure-not-/dev, read-boot-parameters,
 read-boot-para [...] 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: 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,
    bootable-kernel-arguments, ensure-not-/dev, read-boot-parameters, read-boot-para
    [...] 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: 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,
  bootable-kernel-arguments, ensure-not-/dev, read-boot-parameters,
  read-boot-parameters-file, boot-parameters->menu-entry):
  ...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.

* gnu/local.mk (GNU_SYSTEM_MODULES): Add new module above.

* gnu/machine/ssh.scm (machine-boot-parameters): Don't private-import
  bootable-kernel-arguments.

Change-Id: I50cca8d2187879cd351b8e9332e1e114ca5096ae
---
 gnu/local.mk              |   1 +
 gnu/machine/ssh.scm       |   4 +-
 gnu/system.scm            | 287 +-------------------------------
 gnu/system/boot.scm       | 335 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |   1 +
 tests/boot-parameters.scm |   1 +
 6 files changed, 340 insertions(+), 289 deletions(-)
 create mode 100644 gnu/system/boot.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 8e7abc8a47..6ba3aa3da8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -762,6 +762,7 @@ GNU_SYSTEM_MODULES =				\
 						\
   %D%/system.scm				\
   %D%/system/accounts.scm			\
+  %D%/system/boot.scm				\
   %D%/system/file-systems.scm			\
   %D%/system/hurd.scm				\
   %D%/system/image.scm 				\
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 3e10d984e7..863c28a13c 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))
@@ -419,9 +420,6 @@ (define not-config?
 (define (machine-boot-parameters 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
-    (@@ (gnu system) bootable-kernel-arguments))
-
   (define remote-exp
     (with-extensions (list guile-gcrypt)
       (with-imported-modules `(((guix config) => ,(make-config.scm))
diff --git a/gnu/system.scm b/gnu/system.scm
index 44f93f91d1..25afa96295 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -72,6 +72,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)
@@ -147,33 +148,11 @@ (define-module (gnu system)
             operating-system-boot-script
             operating-system-uuid
 
-            system-linux-image-file-name
             operating-system-with-gc-roots
             operating-system-with-provenance
 
             hurd-default-essential-services
 
-            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
-
             local-host-aliases                    ;deprecated
             %root-account
             %default-privileged-programs
@@ -195,29 +174,6 @@ (define-module (gnu system)
 ;;;
 ;;; Code:
 
-(define* (bootable-kernel-arguments system root-device version)
-  "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVICE.
-VERSION is the target version of the boot-parameters record."
-  ;; If the version is newer than 0, we use the new style initrd parameter
-  ;; names, otherwise we use the legacy ones.  This is to maintain backward
-  ;; compatibility when producing bootloader configurations for older
-  ;; generations.
-  (define version>0? (> version 0))
-  (let ((root (file-system-device->string root-device
-                                          #:uuid-type 'dce)))
-    (append
-     (if (string=? root "none")
-         '() ;  Ignore the case where the root is "none" (typically tmpfs).
-         ;; Note: Always use the DCE format because that's what
-         ;; (gnu build linux-boot) expects for the 'root'
-         ;; kernel command-line option.
-         (list (string-append (if version>0? "root=" "--root=") root)))
-     (list #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system)
-           #~(string-append (if #$version>0? "gnu.load=" "--load=")
-                            #$system "/boot")))))
-
-;; System-wide configuration.
-
 (define-with-syntax-properties (warn-hosts-file-field-deprecation
                                 (value properties))
   (when value
@@ -361,236 +317,6 @@ (define* (operating-system-kernel-arguments
   (append (bootable-kernel-arguments os root-device version)
           (operating-system-user-kernel-arguments os)))
 
-
-;;;
-;;; Boot parameters
-;;;
-
-;;; Version 1 was introduced early 2022 to mark the departure from long option
-;;; names such as '--load' to the more conventional initrd option names like
-;;; '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 command,
-  ;; 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 would
-  ;; not understand that.  The 'root-device', on the other hand, corresponds
-  ;; 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 store
-  ;; file name inside the 'store-device' as it is seen by GRUB, e.g. it would
-  ;; contain "/storefs" if the store is located in that subvolume of a btrfs
-  ;; 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 and
-           ;; 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 port))
-       #f)))
-
-  ;; New versions are not backward-compatible, so only accept past and current
-  ;; 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=? 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 version
-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 version)
-                               (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))
-         (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)
-                            '())))))
 
 
 ;;;
@@ -731,17 +457,6 @@ (define (swap-services os)
   (map (compose swap-service filter-deps)
        (operating-system-swap-devices os)))
 
-(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 image of
 OS."
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
new file mode 100644
index 0000000000..2c531e4ad5
--- /dev/null
+++ b/gnu/system/boot.scm
@@ -0,0 +1,335 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2013-2022 Ludovic Courtès <ludo@HIDDEN>
+;;; Copyright © 2016 Chris Marusich <cmmarusich@HIDDEN>
+;;; Copyright © 2017 David Craven <david@HIDDEN>
+;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@HIDDEN>
+;;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@HIDDEN>
+;;; Copyright © 2020 Danny Milosavljevic <dannym@HIDDEN>
+;;; Copyright © 2020 Stefan <stefan-guix@HIDDEN>
+;;; Copyright © 2020, 2022 Maxim Cournoyer <maxim.cournoyer@HIDDEN>
+;;; Copyright © 2020 Janneke Nieuwenhuizen <jannek@HIDDEN>
+;;; Copyright © 2020, 2022 Efraim Flashner <efraim@HIDDEN>
+;;; Copyright © 2024 Nicolas Graves <ngraves@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
+            bootable-kernel-arguments
+
+            boot-parameters->menu-entry
+
+            ensure-not-/dev
+            system-linux-image-file-name))
+
+;;;
+;;; Boot parameters
+;;;
+
+;;; Version 1 was introduced early 2022 to mark the departure from long option
+;;; names such as '--load' to the more conventional initrd option names like
+;;; '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 command,
+  ;; 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 would
+  ;; not understand that.  The 'root-device', on the other hand, corresponds
+  ;; 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 store
+  ;; file name inside the 'store-device' as it is seen by GRUB, e.g. it would
+  ;; contain "/storefs" if the store is located in that subvolume of a btrfs
+  ;; 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 and
+           ;; 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 port))
+       #f)))
+
+  ;; New versions are not backward-compatible, so only accept past and current
+  ;; 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=? 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 version
+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 version)
+                               (boot-parameters-kernel-arguments params))))))
+
+(define* (bootable-kernel-arguments system root-device version)
+  "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVICE.
+VERSION is the target version of the boot-parameters record."
+  ;; If the version is newer than 0, we use the new style initrd parameter
+  ;; names, otherwise we use the legacy ones.  This is to maintain backward
+  ;; compatibility when producing bootloader configurations for older
+  ;; generations.
+  (define version>0? (> version 0))
+  (let ((root (file-system-device->string root-device
+                                          #:uuid-type 'dce)))
+    (append
+     (if (string=? root "none")
+         '() ;  Ignore the case where the root is "none" (typically tmpfs).
+         ;; Note: Always use the DCE format because that's what
+         ;; (gnu build linux-boot) expects for the 'root'
+         ;; kernel command-line option.
+         (list (string-append (if version>0? "root=" "--root=") root)))
+     (list #~(string-append (if #$version>0? "gnu.system=" "--system=") #$system)
+           #~(string-append (if #$version>0? "gnu.load=" "--load=")
+                            #$system "/boot")))))
+
+(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
+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 0305128763..7000c470ed 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -70,6 +70,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?))
-- 
2.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 21 Sep 2024 10:24:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:24:48 2024
Received: from localhost ([127.0.0.1]:37283 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIF-0005ma-U4
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:48 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:57083
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxIA-0005li-LB
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:43 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914251;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=22xZr3cHfQUyuzJYjWynaHwwBCCVcboHbtjihFzfiuc=;
 b=QtsIxlfs+h3rUqdaXcwSl9iTPC87RAsSbPoNLDry8j7NG9N76vWRGEQrLyX/YDhya1/3M5
 l6Q+1yIvHlAa5wHJwBSgqBObHkJoysYA1rNXt2zazyEQ4JGaa6rS3ez0AeM7dkOSkVzAOG
 icDRv5NRYtb07VxR2iRMxKfLSNh5ZnhJUXuIaU+i85m2xhBRkEJpfp+PMUPKJZiNQBzasO
 6V4J54jTE433HnyMCp5TNaKHv66Wae3lXpA/3blzxcvgIRkvnIcGdrfahYI/nmT83lCNvU
 6rxq9zxQvu3iAujf+2zbVb+VxEwAwMDKzqCwWWaGFjB6sJgZ1yw0UdYQGBmFtg==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id b7c4536d
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Sat, 21 Sep 2024 10:24:11 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 01/10] Fix bug where the extra menu entries for a
 bootloader were shown twice.
Date: Sat, 21 Sep 2024 12:23:14 +0200
Message-ID: <485412da830c8b9a6d4ad4d98aec168eba9a6a3a.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1726913452.git.herman@HIDDEN>
References: <cover.1726913452.git.herman@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>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  From: 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. 
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 TVD_RCVD_IP            Message was received from an IP address
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-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: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  From: 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. 
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

From: 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 99c58f3812..0305128763 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -412,8 +412,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 21 Sep 2024 10:24:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 06:24:43 2024
Received: from localhost ([127.0.0.1]:37275 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srxIB-0005m4-FX
	for submit <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:43 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:57083
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1srxI9-0005li-Ay
 for 69343 <at> debbugs.gnu.org; Sat, 21 Sep 2024 06:24:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1726914251;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=dh0JrgkX3BmrVvZpOOuJJJt/MDdaOIlZAeu7YRrZ4tk=;
 b=VqRe/uqFJIwYWTQHLj0BTmoW2IX6LpPMtrUDE5R+9pJE4F85cj22WVQ/E6OseZhYakJqiE
 UJzRFoCh28sx4qwrnCh9Z1gxyiHtXB2z37A+r77RVSfh9Bco8Cpi0NQrpzrTK9GYqZQIZc
 u9y6pIgctsGuqk2f8LGEPlgVKQz58obWU47NkzlRT/1zaa4NAdM7gyaF1VCtV8hj1vNLli
 3L1w8hG0LYDv+mCOcTpUbCXINfBEcveWJykxwu8TTPwuLQhnHsFFOmIZhJyyAJx5vBCAkz
 W5AIF2HTEeaOjCEtKcRi6A/ja0G5YKlpj/1wq9cBCLJFvMttYfFWhi+IOgXZKA==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 0ebe6d78
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO)
 for <69343 <at> debbugs.gnu.org>; Sat, 21 Sep 2024 10:24:11 +0000 (UTC)
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v5 00/10] Simplify bootloader data structures and procedures.
Date: Sat, 21 Sep 2024 12:23:13 +0200
Message-ID: <cover.1726913452.git.herman@HIDDEN>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
X-Debbugs-Cc: Christopher Baines <guix@HIDDEN>, Josselin Poiret <dev@HIDDEN>, Ludovic Courtès <ludo@HIDDEN>, Mathieu Othacehe <othacehe@HIDDEN>, Simon Tournier <zimon.toutoune@HIDDEN>, Tobias Geerinckx-Rice <me@HIDDEN>
Content-Transfer-Encoding: 8bit
X-Spam-Score: 3.5 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hi, I squashed patch #10 into #9, and patch #14 from v2 of
 issue #73202 into what is now patch #10, formerly #11/#12. For patch #8,
 I replaced an if with when, for patch #5 I replaced an if with a match, [...]
 Content analysis details:   (3.5 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
X-Debbugs-Envelope-To: 69343
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.5 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Hi, I squashed patch #10 into #9, and patch #14 from v2 of
    issue #73202 into what is now patch #10, formerly #11/#12. For patch #8,
   I replaced an if with when, for patch #5 I replaced an if with a match, [...]
    
 
 Content analysis details:   (2.5 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
 -0.0 SPF_PASS               SPF: sender matches SPF record
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 T_SCC_BODY_TEXT_LINE   No description available.
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Hi,

I squashed patch #10 into #9, and patch #14 from v2 of issue #73202 into
what is now patch #10, formerly #11/#12.  For patch #8, I replaced an if
with when, for patch #5 I replaced an if with a match, and for patch #2
I used more relevant copyright.

By the way, there seem to be two different commit message styles used by
Guix contributors.  I would never use more than 72 columns, and I would
write e.g. patch #11 without newlines between changed files, or
alignment indenation, like so:

  -Encapsulate <boot-parameters> to retain generation, system-path and epoch.
  +Encapsulate <boot-parameters> to retain generation, system-path, epoch.
  
  * gnu/system/boot.scm (<boot-alternative>): New record.
  -  (boot-alternative->menu-entry): New procedure.
  +(boot-alternative->menu-entry): New procedure.
  -
  * 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.
  +boot-alternative encapsulating previous return value.
  +(with-roll-back, roll-back-managed-host): Get parameters from
  +boot-alternatives.

Is there a preferred style?

Also, should the indendation increase by one column, or by two columns
after a record constructor?

Cheers,
Herman

Felix Lechner (10):
  Fix bug where the extra menu entries for a bootloader were shown
    twice.
  Move <boot-parameters> record to a separate file.
  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.
  Split system->boot-parameters out of profile->boot-alternatives.
  Encapsulate <boot-parameters> to retain generation, system-path and
    epoch.

 gnu/local.mk              |   1 +
 gnu/machine/ssh.scm       | 116 ++++++------
 gnu/system.scm            | 287 +----------------------------
 gnu/system/boot.scm       | 375 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |  69 ++++---
 tests/boot-parameters.scm |   1 +
 6 files changed, 470 insertions(+), 379 deletions(-)
 create mode 100644 gnu/system/boot.scm


base-commit: 9d75215a59629ab224154ef6b843043289291f81
-- 
2.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@HIDDEN, zimon.toutoune@HIDDEN, me@HIDDEN, guix-patches@HIDDEN:
bug#69343; Package guix-patches. Full text available.
Added indication that bug 69343 blocks73202 Request was from Lilah Tascheter <lilah@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 69343) by debbugs.gnu.org; 20 Sep 2024 04:18:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:18:06 2024
Received: from localhost ([127.0.0.1]:33785 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5p-0005Tu-3B
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:18:06 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:52048)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5k-0005S7-LB
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:18:01 -0400
DKIM-Signature: a=rsa-sha256;
 b=DibIcuQEXQw7YTzXyFPqPopKEUwmgrll1ZZCjnacTamT2mBRszLQYeNtIzdwamPFcaGAXRAUFG/8rei1WalRFz0WN7pONEXN3UeIoMYbz0cPeUmiwhbrzHpPkJMlQUmnnZsaHlROh4UnwYjSc5N1WaFLx1lm6QFyzS8/Fqm96N3D+8hBxH2vbHXvFGq+fwA4UXY+2AAxxMX6PcLAyFvUbPoIz1jgmv9UWuEPqUT63qCAyRLxpEYYthC1BfnbNPY9O/W8nJTkMfurapYIGpNHHJiRYzUlBcNjbH5MAMozA73AlDYxo9YBVOE5xD4S7yI7yuYrYcHMNQ+4oHk43zxeDg==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=Wdaw++7Zd+Ll/cgrIr/flJd7mddXi3SKccGFa4Iyfic=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=jjjxJhFB7gvW4QvYIzVy5d73/DU21x1JUnPaRjEO430WssxEqEL6o9DnNm9sKxvO3MhA1/Z/GHQjTyPr7HU9oV5czRujCYX/eLdNdBnlr8ab5s7+gx9RhJl2Pz2/3m6fhGAEvRBCMeVQvY+XuPMstnPWF9rGyagwNz+WJ+pHO+xt+K6oXx28ixrVmcTpsl5XS+FRPpKHDxuiG4JhxnUU8SAx/lcRA8tHL9wVE593QODXnT/CPErM34MLcfjTIvGLsYS935E5H/d8LrZuvFxj5gDu0PQGQubBu89Q6popvRg8bb1qHSRMiDfWeHxm+1a8D5IMe5Rnchj92BxR5QQ+aw==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=Wdaw++7Zd+Ll/cgrIr/flJd7mddXi3SKccGFa4Iyfic=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:21 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 11/11] Encapsulate <boot-parameters> to retain generation,
 system-path and epoch.
Date: Thu, 19 Sep 2024 23:16:05 -0500
Message-ID: <5440f547c4fd458acdc327afeded9a6067e98124.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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     | 29 ++++++++++++++++++-----------
 gnu/system/boot.scm     | 14 ++++++++++++++
 guix/scripts/system.scm | 32 +++++++++++++++++++++-----------
 3 files changed, 53 insertions(+), 22 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 37806a2e1b..ca0f3483a4 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -416,8 +416,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 remote-exp
     (with-extensions (list guile-gcrypt)
       (with-imported-modules `(((guix config) =3D> ,(make-config.scm))
@@ -459,13 +459,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 ...)
@@ -509,7 +514,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 ...)
@@ -583,7 +589,8 @@ (define (roll-back-managed-host machine)
   (mlet* %store-monad
          ((boot-alternatives (machine->boot-alternatives machine))
           (_ -> (if (< (length boot-alternatives) 2) (raise roll-back-fail=
ure)))
-          (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)=
)
diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm
index 82ca353cb3..c29e48d607 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -71,6 +71,13 @@ (define-module (gnu system boot)
             read-boot-parameters-file
             bootable-kernel-arguments
=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
@@ -299,6 +306,13 @@ (define* (bootable-kernel-arguments system root-device=
 version)
            #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
                             #$system "/boot")))))
=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)) ; <boot-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 0c69f6d90b..0f7d864e06 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,26 +328,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
@@ -396,7 +401,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
@@ -407,7 +414,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
@@ -824,7 +832,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:18:05 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:18:05 2024
Received: from localhost ([127.0.0.1]:33780 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5o-0005Tc-Ce
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:18:05 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:49292)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5j-0005Rt-4j
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:59 -0400
DKIM-Signature: a=rsa-sha256;
 b=FJJaHPka5raJy0dM+yvNeaYzw4YT9n+yuKWeG6yCqXieSfuyg0MLFKCnSG/zBfPeKrwxIF5y1urkjN8KFSHQxymj5p20Ascsz3+FfCpfq9EoZkBtI8RBsPXtE8ExTg7kUd1hhFHxqIefFYIrxDnVvrg2QmF3kFklUcC+ElAbDVEn4wGlRs9bZX5/CAeCzxc6bajwPtVjbnKX+RjqpOjcZRa8BbZ4x7nd9lVD6ZAOE27n84YK34uoyiY4Nn9SK+Dgqvt9aWwYvP0Y8i/qOAVPOHyXRRfRNqIBPkzmoVgb+4G6jE+SzF8sMW8U+gkLudVIusuofHgTfy2K7pyqs50YDg==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=Tk8W7qM2jR/8/MeUJ1Qk7Yr0/D33pJMJPZnx9XqDdmw=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=PTgqHIDGIOm+kFyj20z10vUOjUvP0dSv9SHdHwKVA1lkG/kFUH/OUktY5agBvK0Lwfv2qE3tvfC3xkevWHhps35tfzKPyFTaHMtQCdMK1A6KH44c3pEQONZ0yooj29rtJqrilSggBnayYuI/4bU4u1jyMZTEZEPcAdzKx5mlxOgR4tJU1vyaL857FXDnY/ZN8cumSNd59txSKru6kjv1AUizG7eGQu3QNiDTqBekK7wvNQwFPMMSO2nE/p1nqVWkbEl2SfQ5Ta6tLD//MeE/6YnSW/DndrcPdd4rWeJQ+zaLsQBAiOwF0aljXfRjCd0T5p32pooy6+8J2MFUmAI9MQ==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=Tk8W7qM2jR/8/MeUJ1Qk7Yr0/D33pJMJPZnx9XqDdmw=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:20 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 10/11] Split generation->boot-parameters out of
 profile->boot-alternatives.
Date: Thu, 19 Sep 2024 23:16:04 -0500
Message-ID: <852043d05b73160c4613e209130a527fb1f7a5ce.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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 a4dd7a8054..0c69f6d90b 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,22 +328,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
 ;;;
@@ -391,8 +396,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:18:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:18:04 2024
Received: from localhost ([127.0.0.1]:33777 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5n-0005TT-Lx
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:18:04 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:45866)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5g-0005Rm-Ns
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:57 -0400
DKIM-Signature: a=rsa-sha256;
 b=n7Dc9fsCHGIqmT8CxI+iNHoZLp1ykUQRibyYyj2WwNd77X7q4pgZ6xCiMJm0noQjei06SWyLB6MqKaRa6yafZGmnWz5dOk7LzRWuFp9Hp/ADVyENGPTZRGI0UBSg7f0A/xXq0cBmNxQjrVtOfz+wTKTyie/hFCJfcM+eci4oN7Grl0bJrwb+ElXHYSj6h2nc6IaDh9rkIZ/jnYZqaufSZ4lgYr85Q1mi4EmErMmyUTJ4dLLfIGnnFpGn8xFTDE/w5+LkDwoYVAxGSe15yw61NBLA9MiFf/JFKPXuRcwxDNA2aappiwOuve8RX9YWTC5RW03q3mk2mB2Ji11XYvqrTQ==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=tUvD0ZLiDclvWKVBcWJbB0D6FAVkMJQpUX9BbzR++hc=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=uzb+BWicjSXZXDruVLtzb8B05JHGjR7yxe+/ldYuN2F23qvetEKzZWzSmLMfUaDvhQkVF1fVuE6mXu6PjMtR/GsLYU0fBPWONuOBxMU3eFMs/LWdDY/gWy6m0KCjihyDq6uGOQ09Ez/gRGYpD1ZVq9E0/LLGsNZCW8yX4bcsXl9X/vszAnttsTMWZB+F7yE2jg1jMRkkcNwHuBRbv9O+l758doTM5rqT1b0vCuJQAXxfeQHUm8nOxp8hqhCWA2ycoITwnque3dfS+gznDjPGNTX+BKQvV30yXZBkd5HfYwIEtxAjTak36uCDQ/A0P2OBlOEj0MkwXOb/Hhn8N+5tCA==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=tUvD0ZLiDclvWKVBcWJbB0D6FAVkMJQpUX9BbzR++hc=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:18 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 08/11] Give a separate name to a commonly used expression.
Date: Thu, 19 Sep 2024 23:16:02 -0500
Message-ID: <6e4fc53df2ff12590bfa557c38f4ea03446f5749.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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: Herman Rimm <herman@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 (-)

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 | 47 +++++++++++++++++++++------------------------
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index a96ca68f47..37806a2e1b 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -580,31 +580,28 @@ (define (roll-back-managed-host machine)
   (define roll-back-failure
     (condition (&message (message (G_ "could not roll-back machine")))))
=20
-  (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)))
-                       (old-entries -> (map boot-parameters->menu-entry
-                                            (drop boot-alternatives 2)))
-                       (bootloader -> (operating-system-bootloader
-                                       (machine-operating-system machine))=
)
-                       (bootcfg (lower-object
-                                 ((bootloader-configuration-file-generator
-                                   (bootloader-configuration-bootloader
-                                    bootloader))
-                                  bootloader entries
-                                  #:locale locale
-                                  #:store-crypto-devices crypto-dev
-                                  #:store-directory-prefix store-dir
-                                  #:old-entries old-entries)))
-                       (remote-result (machine-remote-eval machine remote-=
exp)))
+  (mlet* %store-monad
+         ((boot-alternatives (machine->boot-alternatives machine))
+          (_ -> (if (< (length boot-alternatives) 2) (raise roll-back-fail=
ure)))
+          (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
+                          (machine-operating-system machine)))
+          (bootcfg (lower-object
+                    ((bootloader-configuration-file-generator
+                      (bootloader-configuration-bootloader
+                       bootloader))
+                     bootloader entries
+                     #:locale locale
+                     #:store-crypto-devices crypto-dev
+                     #:store-directory-prefix store-dir
+                     #:old-entries old-entries)))
+          (remote-result (machine-remote-eval machine remote-exp)))
     (when (eqv? 'error remote-result)
       (raise roll-back-failure))))
=20
--=20
2.45.2





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; 20 Sep 2024 04:17:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:58 2024
Received: from localhost ([127.0.0.1]:33761 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5h-0005SM-Vj
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:58 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:49290)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5f-0005Ri-TA
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:56 -0400
DKIM-Signature: a=rsa-sha256;
 b=Z7gGcFRH42ouJUBrC0jepZS1ktTdpjQhORxFfBFBLpWlncOMnbP8Rz04cfhh45Eiurg8iJmPA+dKZAvogpbMiKuXWoXUbkxuss+YVqejdPGsw92v052pT/T/knsXrzFJ4xqS/68JujQXjpCdI6dMIrUAajq+JV0dAIgI15W9yr3xJpjJkIPqkF3UQmm5DD1rNEQekbTDk8D7gkK+hXSUUR1zwOxq5Dr017hEeBryVGyZl0SrB6xHKYs0W7cFcsFjbhBe0523PL3NCduxLXyYu08aevVmSFQdzy7c/VheittESOV7QRHqYMcypPs5rzfHO5GuTtS25cmWcbHFkBpcyw==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=NWG6NUH0mK7gkG+sq9A+xR0W0wwVR7O7WawedBxVieU=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=XqSx6r2ltKsSS4M22PWdusyBYhIN86heZBGfEsSRrAoIXK1MPzDFg4RIkyzTQ8Oc1iTKKMiBatLD880f5PiFXntZxjS1JQ3aPugLYOoC5/rBm4J5EsezitYfcMsHp6ICaklJTUXvZsm9kwaF5tooHyIvGzN17W9AHWnkQg+PBoaMyL9am9yKcXYwjIREW0RBMB8Fjbp7mid7ogPk4iPzCFkoQNON2hXJnYTYalXOVi4Y+0oNsiypQgryPYM6j2CygsAke0/ZkHW+/c+7B+uu79E9+eV7lk1JQQv8TG6sOZbPwXJLMlTEEECP3a/t9S8LcvOdvGoXMeFvlpK1h/61/g==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=NWG6NUH0mK7gkG+sq9A+xR0W0wwVR7O7WawedBxVieU=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:19 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 09/11] Simplify profile->boot-alternatives.
Date: Thu, 19 Sep 2024 23:16:03 -0500
Message-ID: <5cfea442dfbae70e44123556783d4df9e69113be.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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 cdd78a7849..a4dd7a8054 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -334,20 +334,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:17:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:58 2024
Received: from localhost ([127.0.0.1]:33759 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5h-0005SJ-Jl
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:57 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:52036)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5e-0005Rh-Uj
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:55 -0400
DKIM-Signature: a=rsa-sha256;
 b=bjjMk8lD0P/x7H/CdQBpYAgNqU/XI8b08yQkmm6cGaqNDmPS0w5RmpefFS/DEbGT4C/rLBQj8sO3J5yyXLIUO44jul0daosFhNHFotasRtIkRsEI91OAdx3nyPryxwK8GU254Uk5RRR3fo8bEq9g/st38ytnAaq/9c2SZrwIvC+uWJCUK1boeGgNDa96AvxXsgID2P9JI9C34g3kss75XHRabqI2TWJvWPgsBaK8CHAZZdgz39UU4M37W01k+vYkXNZ8wC62cWxRZuFz0lD1lpLxxI7fH3Rp5GXpgs0io/A9ivdi069OnJNUhhdoTqyAq8X5EIeAGFqRXWBvmuYXrA==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=zyS70lqfQXnJ0l6hxl0r9f5BP9QpTTTkEhs2PRCAb+I=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=G3Pt1eEHDWK4/MTy1sQECvKa5CXCtyfy2ssJ9BkKPWejQg12V/8TIOCfhDvKwxoLlc6L+L1W3WcXLVsoIlev1Zrfm4PVnBx9FsMn3+RRCVwfULsBhMUgv4JcFYd/M2NFHfmkuXqcTFHxEZqRA47QeLMC9zJGwpTotc3AuHoiu3X0slOc9yK344dyFkdEGOpOjVAfPoKxocXEBasxBBfD52wV+m8dP6csNWlU9+Xfk5C7vwyzTlXVpVaA0YN8mMdiqzZ2bu9CqfzjAhnq/hkv0fpuK9+j0BeAISa5gC7BBEBajaPQo37IUOsgSgowwkY0DGqWQx5+wki0sZd0T0v/kw==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=zyS70lqfQXnJ0l6hxl0r9f5BP9QpTTTkEhs2PRCAb+I=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:17 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 07/11] Rename two remote variables confusingly named
 'generations'.
Date: Thu, 19 Sep 2024 23:16:01 -0500
Message-ID: <849f65d3453b94dcef8c572a8486196695d865bb.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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: Herman Rimm <herman@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 (-)

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 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index f3d2a77625..a96ca68f47 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -449,10 +449,11 @@ (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))
@@ -465,7 +466,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.45.2





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; 20 Sep 2024 04:17:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:54 2024
Received: from localhost ([127.0.0.1]:33748 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5d-0005Rq-Jl
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:54 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:49248)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5V-0005Qg-Ch
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:46 -0400
DKIM-Signature: a=rsa-sha256;
 b=PFoFvbhxhXpudpc0chA2aUkQAkQjVl4iZwsA6FBnPBgJxBlUv3STqMLDq3rH5PcZvwSTZw5pwwABIMgLomOxGSQzkJJoeWZtw2xt9sfGgA/+L+J+Pry9NT1l6EzAibs7LfGHqTh/k2drwmpf7gRLocX2wJNmInVMU941hAZtse3dqNchidnJdEvAGB2KQP4T3rdLEP97jKN5uifqhpEUPF1gOTVbbkeuBD2BcnvG/8K15cic8fygNSOSZB+PqwT/WJyw7b1h+Wh3iLcIcVHbRfdG3QvOWYCN2dLJIJ/2M2VMRGJH/iGSF3u8wHvZIoiwzM8hTRoy+WHkLYVx88URvQ==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=y5Tz2MCs2MM3YaWA05pWXrUKfFWXWXur/6HXGs15djE=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=t7+HQQ6w0Qa46wTRAnrmWhWOMheiInqJcLztutUHUJ0YvFyF+dLHggyRVZphWpLwlojodegpZ0gVhGDNObCtCleGPBInsfTPdYATgbOK19yd0J2slsvpFOtKRKbHCUJ0FFo9wRkDbcmVXBlwjTeaL0N7mnlfrUL4SsoIkxPnJgkEvvT2KJeTavtwirxdKo4IwfNeKlws1xpV505FWF552Vm9L8MNM62hJ9vPWrkE3KflCeGvPnNPvlLI+QhTVZLOe/29Cr8zSjzzTBNMTxYylY54GBBHM1wtEnIgX5DQx3/M+TNBlGyeYn4nz9b/omkepMI1zer+KJqrKwDXahPJZg==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=y5Tz2MCs2MM3YaWA05pWXrUKfFWXWXur/6HXGs15djE=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:16 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 06/11] Rename boot-parameters to boot-alternatives when
 appropriate.
Date: Thu, 19 Sep 2024 23:16:00 -0500
Message-ID: <d3644424ddb20346d8a1888287101b7919aee3af.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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 3971469e33..f3d2a77625 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -415,7 +415,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 remote-exp
@@ -501,14 +501,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 ...)
@@ -579,19 +579,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 84eb99b938..cdd78a7849 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,9 +328,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."
@@ -395,18 +395,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
@@ -823,7 +824,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:17:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:48 2024
Received: from localhost ([127.0.0.1]:33746 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5X-0005RT-Vu
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:48 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:51946)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5S-0005QZ-Iy
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:43 -0400
DKIM-Signature: a=rsa-sha256;
 b=j8pFk7UnVdJi9iShP3cXbSDFylTTvL48ob2hYvrR4z+XTbx6Zy/KHrTSZILGZEY5NVFd6ESINsb1lO/V/lvF0/cPCH8luFEwHySppo6cktjg5RywzJrRqsom5577wwpBrh7cBurZfxs5ZmSU2meJOm/KuSVY+GlVpE4z/v2hWvQRFb8i62X0F6iRJ63DCUNqkTfg/AnDNIxD+tCw/Y8WNDbiE8LOpaWC5zr6PGNlvAuZY+OWVag5RlbAZy99ZlAQgFEPY8Btvd0+u5tMmYZ8U8apgM+tqwa8C2VNSQR4Y41wr0D5KM6V5zf6zuTqUvoAO4yo9DKik3/8QUxsIWYgcg==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=NOK0PWiSFHSzFTSi+M9ZXWQ8KB3bs8kYvKUPY7tzJ48=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=i6eEhq/b1nSjPtmBtgky8f+ZQXPaIVlhemKp5HTnxtv+yP/8XuBMEFfejKggrpdbiliqlOjccNOIICUGqW2115YRRjciPoQoCfco4vs3BfoF6KBwEIFhe/8HtkN5B17SNEh3Xs9n/CGMH7ar0m3sE1zQZtTuGV13tYB9RFV01MSJstgYkmHRYlWHS+bqbX82Yp+oSRSDwfLYHxoYc6yGTVKaRe5qHFsCbOvUa6SxcEU3yzKfn3pdQ5EI2mR9oPtTuA/c0uJTmJII8ncirQZ9keMOzVvWP3lCHYkpNyZL7iYNyMIX0wTxpR0E42ilRp6fyhRiOvyH224ZfvWM0hnyDA==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=NOK0PWiSFHSzFTSi+M9ZXWQ8KB3bs8kYvKUPY7tzJ48=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:16 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 05/11] Offer a uniform decorated-boot-label and use it.
Date: Thu, 19 Sep 2024 23:15:59 -0500
Message-ID: <8715f3e79e6b1dff09eb2c4c04d23af14b1247ba.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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 e68e64527e..3971469e33 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -457,15 +457,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 01e3a965e4..82ca353cb3 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -72,6 +72,7 @@ (define-module (gnu system boot)
             bootable-kernel-arguments
=20
             epoch->date-string
+            decorated-boot-label
             boot-parameters->menu-entry
=20
             ensure-not-/dev
@@ -304,6 +305,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
+GENERATION, and a timestamp derived from EPOCH seconds."
+  (let* ((numbered (lambda (num) (string-append "#" (number->string num)))=
)
+         (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 b197812e63..84eb99b938 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -337,12 +337,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:17:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:48 2024
Received: from localhost ([127.0.0.1]:33744 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5X-0005RL-CH
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:47 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:51944)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5S-0005QY-I5
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:43 -0400
DKIM-Signature: a=rsa-sha256;
 b=DRfMk84p82UX/K2rmbkOnkdwuIX8muIvBUYGZ4GrCrKNGInGpsxaBf2Ymy/+nUiNghJ7LQRmJSJ0I/3uZdNQIFOZJpdTTFYTDRMTpzvUqTzE30TDBCJb70PcMJ2ZlEIpFHFtlDiXY+UpyjMcuMvP+6lM1iB0zCkZKl+yv7DIQhU/1MrvHWC6ob7a/9KaZxzZvL2Z+Q9ApRP3Twc1JMNzIRDA7p4JhQFk5pEhi1Nmhl7gL3iMjVCgx+Znx7kcl+k7lh0srP/uKRCsSJ1EzSMOLlm2VhwP5EwB2jlO3uae/AJ8h8IHTKQp1KsBxvkRvTHV5YpvRY+tzLld7dfykeY+/Q==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=fwzoCc7y6ItU44Puf4gL6wng+1TnmX0zYcUUjQTfsJo=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=CekFazb7fA3XR71mlpWngRa4CS9SttCb+p2ZuzLutZ5aiflPwK2HdvYhyQrzPl4qLXHY/YXaqbr3omSWFF5cmUyKkfLWNBDN0d67qh8HWyWUaL+hVIPwOjIp9RehJM136sptuDUbUpC/kTNQd3C4z7mMp0uqu4aQxmc29iU8J9hLvJTfdcmB+v/LquT0uHqm55WjNdEcUfeS+6Gg2HtWZV1jQi7iMKodnG8Ifao7E2oAfeKKyMNLSMNzF13/cGXZuxFQsnBNEzMUD5QxF9w/FPo9ORKGovIhyZbuN9aQ7l4YYtq+Q3e0NCyGd5IzuxHggYxvsNLdOHzDmH8f5zEkVw==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=fwzoCc7y6ItU44Puf4gL6wng+1TnmX0zYcUUjQTfsJo=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:15 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 04/11] Move epoch->date-string to gnu/system/boot.scm and
 use it elsewhere.
Date: Thu, 19 Sep 2024 23:15:58 -0500
Message-ID: <a7f035efc6e491e7e462fa1b5887a3e680ec4ad8.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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 749aa2b6d8..e68e64527e 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -442,10 +442,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
@@ -453,7 +453,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))
@@ -464,9 +464,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 df27b8aea4..01e3a965e4 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)
@@ -70,6 +71,7 @@ (define-module (gnu system boot)
             read-boot-parameters-file
             bootable-kernel-arguments
=20
+            epoch->date-string
             boot-parameters->menu-entry
=20
             ensure-not-/dev
@@ -296,6 +298,12 @@ (define* (bootable-kernel-arguments system root-device=
 version)
            #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
                             #$system "/boot")))))
=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 cb70d36219..b197812e63 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,19 +328,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)))
@@ -348,7 +342,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:17:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:47 2024
Received: from localhost ([127.0.0.1]:33739 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5V-0005RC-8Y
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:47 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:45752)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5P-0005QN-RP
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:42 -0400
DKIM-Signature: a=rsa-sha256;
 b=p8ahLyCtvSM3gl6l/TgGjeSCfAMPOPrkVp6zEaB8k/IVszuxIKP1Yx1xEXdIqszSFjXYF/fNVnNA1UqUnqnw2BNPv+ZJ2ixZSxe0anUSQ3B4uQiR1lmARb49cy+nnQUYY72vzW5bAyPWqBexRUGD2gohe/l5u9jakblJnc/79SQWIqI3dYHn7TGsRtYaOtgnpsjBJEyfxjWUWqGxox6bPg1dER2QjtmjI9/POxCuRZLEiP+2Ri848vo6PVrQGu3qVcI47dAnDWteE7MyV3vjhNmWrNTiWUF6cQpmoXt5ZJTU4O/E6nGql/iKSjnY49Vgy3a0/9/Qn2BV30KsgiI0Eg==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=oRaTEmS2mej/tH6xcejZxpSD254H6b/VBo3LygsmuCo=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=Fvf3bpqyeBlwoqlTayA8a7FIV11HjZ85KQwX9iX1VA6LhuI5jMR5VdAtTdubV1g1puk8CmmhULeAVNE/JdrruWDUE5uIRGK8GYcRpPgo0HUZD52rTwq16GW+yp9bpCBEa4Hnp/HU5TaYJpuOzSZuuvCeEhgABJEM2SHqKT86z0RkxkFEgCcv7j0ajTJljx7yumuS9ne5lw96Yf2H/P45+Cp2AqT/cPgyjriBJZzA83UD954WOb4teBMXbAZfUVNn3T/OTgc/smpSjKPWlRJdPO85PqnPYh45czRP6Yh6x0iMwHybXfevl6f7l61ftP8z3kW2GDcT3sHcly8TZ6H1ew==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=oRaTEmS2mej/tH6xcejZxpSD254H6b/VBo3LygsmuCo=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:13 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 02/11] Move <boot-parameters> record to a separate file.
Date: Thu, 19 Sep 2024 23:15:56 -0500
Message-ID: <1f574c422d47205d1f5e0fc139959d0e93280576.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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,
  bootable-kernel-arguments, ensure-not-/dev, read-boot-parameters,
  read-boot-parameters-file, boot-parameters->menu-entry):
  ...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.

* gnu/local.mk (GNU_SYSTEM_MODULES): Add new module above.

* gnu/machine/ssh.scm (machine-boot-parameters): Don't private-import
  bootable-kernel-arguments.
---
 gnu/local.mk              |   1 +
 gnu/machine/ssh.scm       |   4 +-
 gnu/system.scm            | 287 +-------------------------------
 gnu/system/boot.scm       | 341 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |   1 +
 tests/boot-parameters.scm |   1 +
 6 files changed, 346 insertions(+), 289 deletions(-)
 create mode 100644 gnu/system/boot.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 6d2b14e72d..8375e13709 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -758,6 +758,7 @@ GNU_SYSTEM_MODULES =3D=09=09=09=09\
 =09=09=09=09=09=09\
   %D%/system.scm=09=09=09=09\
   %D%/system/accounts.scm=09=09=09\
+  %D%/system/boot.scm=09=09=09=09\
   %D%/system/file-systems.scm=09=09=09\
   %D%/system/hurd.scm=09=09=09=09\
   %D%/system/image.scm =09=09=09=09\
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 0be9ebbc0d..749aa2b6d8 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))
@@ -417,9 +418,6 @@ (define not-config?
 (define (machine-boot-parameters 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
-    (@@ (gnu system) bootable-kernel-arguments))
-
   (define remote-exp
     (with-extensions (list guile-gcrypt)
       (with-imported-modules `(((guix config) =3D> ,(make-config.scm))
diff --git a/gnu/system.scm b/gnu/system.scm
index c76f4d7c50..4a084b2ecf 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -72,6 +72,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)
@@ -145,33 +146,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
-
             local-host-aliases                    ;deprecated
             %root-account
             %setuid-programs
@@ -192,29 +171,6 @@ (define-module (gnu system)
 ;;;
 ;;; Code:
=20
-(define* (bootable-kernel-arguments system root-device version)
-  "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVI=
CE.
-VERSION is the target version of the boot-parameters record."
-  ;; If the version is newer than 0, we use the new style initrd parameter
-  ;; names, otherwise we use the legacy ones.  This is to maintain backwar=
d
-  ;; compatibility when producing bootloader configurations for older
-  ;; generations.
-  (define version>0? (> version 0))
-  (let ((root (file-system-device->string root-device
-                                          #:uuid-type 'dce)))
-    (append
-     (if (string=3D? root "none")
-         '() ;  Ignore the case where the root is "none" (typically tmpfs)=
.
-         ;; Note: Always use the DCE format because that's what
-         ;; (gnu build linux-boot) expects for the 'root'
-         ;; kernel command-line option.
-         (list (string-append (if version>0? "root=3D" "--root=3D") root))=
)
-     (list #~(string-append (if #$version>0? "gnu.system=3D" "--system=3D"=
) #$system)
-           #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
-                            #$system "/boot")))))
-
-;; System-wide configuration.
-
 (define-with-syntax-properties (warn-hosts-file-field-deprecation
                                 (value properties))
   (when value
@@ -356,236 +312,6 @@ (define* (operating-system-kernel-arguments
   (append (bootable-kernel-arguments os root-device version)
           (operating-system-user-kernel-arguments os)))
=20
-=0C
-;;;
-;;; 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 (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))
-         (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
 ;;;
@@ -726,17 +452,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..df27b8aea4
--- /dev/null
+++ b/gnu/system/boot.scm
@@ -0,0 +1,341 @@
+;;; 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
+            bootable-kernel-arguments
+
+            boot-parameters->menu-entry
+
+            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* (bootable-kernel-arguments system root-device version)
+  "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVI=
CE.
+VERSION is the target version of the boot-parameters record."
+  ;; If the version is newer than 0, we use the new style initrd parameter
+  ;; names, otherwise we use the legacy ones.  This is to maintain backwar=
d
+  ;; compatibility when producing bootloader configurations for older
+  ;; generations.
+  (define version>0? (> version 0))
+  (let ((root (file-system-device->string root-device
+                                          #:uuid-type 'dce)))
+    (append
+     (if (string=3D? root "none")
+         '() ;  Ignore the case where the root is "none" (typically tmpfs)=
.
+         ;; Note: Always use the DCE format because that's what
+         ;; (gnu build linux-boot) expects for the 'root'
+         ;; kernel command-line option.
+         (list (string-append (if version>0? "root=3D" "--root=3D") root))=
)
+     (list #~(string-append (if #$version>0? "gnu.system=3D" "--system=3D"=
) #$system)
+           #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
+                            #$system "/boot")))))
+
+(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
+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 0305128763..7000c470ed 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -70,6 +70,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:17:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:42 2024
Received: from localhost ([127.0.0.1]:33731 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5R-0005Qn-GY
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:42 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:45754)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5P-0005QO-RQ
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:40 -0400
DKIM-Signature: a=rsa-sha256;
 b=CinEWg1/fo6rZjJ/cktAFSA03u/uDFxqCVdVIfO2NEPDx8O1ufSiMSl6RdlXNfODcwoRZEUaSQs10Kd/RBq2jRq4oxLZTHcfehyJZW/YMIREVeIUg93IfKbdVlMzYpiybXh1isqg+SVJ7dva9Jh1v8kybGVzJR7qUnKAvdMXFekcUfuOoS+8Ip3kPZn8xBBnlpPNP332ZWq0y4UVHFy5UKIgZEDh9M5b27eO8nmBFfwJNI9M3MFeunIrXht28K7JH+RI5FGFTsltH7JSGL9iZqYbsH7AY9b84rGucGa8o+FqFBKVL7D3GxGNLH5kkev2AB4s7R0bzugh1EYUotznMg==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=oThLW0/lymMCVSVmKwy8oE8qI6vmgdd2ZBmkRVkECVU=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=NFzsX89HWFlnQN804A4t8wKigefZSiJUr/mnKT5eWcWlrn11xv+uP5XvMGlyVFY2cyvwRaNjMXZxaShbkyir0CehKXQzEVMOFbEudo5ahC8pIj71eA4vynT1MUvNITUsRuHvojQeJ0cX4TKL21R6Fy9+OAG9dgkcRmfZtyiFtqyik7YfwhdKj0jkCJ9H1S6VPWiD5zlV3VvjFyxwutJ4OT2pfT6LvPqdQRrS6eK2VxH6cUJlpmfeUOvaXTgqilOnQ7aBfg3ra/hkUopNauhuleXdNQGd/lO0limpzuSvG4NwOe6RtHOXeLfGZi+6PXYj9j4JFLAB6L0rUT/gDhMUkw==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=oThLW0/lymMCVSVmKwy8oE8qI6vmgdd2ZBmkRVkECVU=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:14 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 03/11] Rename seconds->string procedure to
 epoch->date-string.
Date: Thu, 19 Sep 2024 23:15:57 -0500
Message-ID: <26815704b0d1122f45aeaca6e30438c713cf76c1.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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 7000c470ed..cb70d36219 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,9 +328,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
@@ -348,7 +348,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:17:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:36 2024
Received: from localhost ([127.0.0.1]:33723 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5M-0005QQ-3H
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:36 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:49144)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5K-0005Q0-4I
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:34 -0400
DKIM-Signature: a=rsa-sha256;
 b=awliK9Fzrvgq3UnS44kefL4JfzLACfXV9qlNY5gK0awpFnZTZz3fBswkKmMkFkH20gGvTGe6dET2kFnGBfbRm+GlJgkcPexggUbfIL+NnQ0x0m0Jgnc3dz321OnuCWpegb1V6iXtMOQ6CTdsN+y5mspDw6rTxzccmYiwYBMrCjK0D0RwyXYsbEpFz7HSGrmWixSurpjCTYLL9Pzyi7+jkQxqa5vuIwJxR8gDvRYsnlBXh9avYDKhGMZYt0sjWnSLS0hPVVTSCECMYpRojmz2HyI1Oj3rf3jlyH1cw54xSLZ7KPIlYFmbPEtXFMA75cFit02LCUFCzAyYYz1PRgcmLA==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=qXWn1cz6zN65+Q68ygAxFMhzoQIb60JNk1LL8A3ilhs=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=iljA4SzUGUnnbXQoVY9hu2NfHeR3nCeMMgDNdoNP+kQBn0WLF0Px5lhUcX58+97zy92kiBq1k08V/49Tjec15bJrcVU4hbTQN/2WJPc/EEDrD5wZb5UPiFf5CTwIiB7qmymUpEUUmsVM9Aj22i80HbCbYCBhfLkbLEXB6+DO6qwrY5opzCbOihykzfvzDasesVh67GXHV6/lCxb4zq5FndWqmmwCf0aX6lcNVYcCuRCbej3nmmLIVH6J/ak83864Dxu6KkChJ27tjGwEKHB8N1w1CUP6h0cF+gWcKGT1LKE0AAr/4jiJUXfiCZBDv7ElpGWxsH0R+Tss80Ecd4kdHA==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=qXWn1cz6zN65+Q68ygAxFMhzoQIb60JNk1LL8A3ilhs=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:09 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 01/11] Fix bug where the extra menu entries for a
 bootloader were shown twice.
Date: Thu, 19 Sep 2024 23:15:55 -0500
Message-ID: <048a294013321d432030a71007d7386d2f1308d7.1726805765.git.lilah@HIDDEN>
In-Reply-To: <cover.1726805765.git.lilah@HIDDEN>
References: <cover.1726805765.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>, 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: Herman Rimm <herman@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 (-)

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 99c58f3812..0305128763 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -412,8 +412,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 20 Sep 2024 04:17:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 20 00:17:33 2024
Received: from localhost ([127.0.0.1]:33718 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1srV5I-0005Q9-Oq
	for submit <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:33 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:49018)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1srV5F-0005Pr-Fg
 for 69343 <at> debbugs.gnu.org; Fri, 20 Sep 2024 00:17:31 -0400
Authentication-Results: purelymail.com; auth=pass
DKIM-Signature: a=rsa-sha256;
 b=Doe99bhqMWNX61O6+xqeBunZ1dH9s1BpEl/mgvLRZZD6Tn/EZHZ6JAAlf+fmryL2ddjNuT25vx84Zf07l2WXHqtlS3uTFpnOw7dSr2leGHKEweHYRr4R2o9iX3LwG0aWOAcQqRjbccO80oCkPBNGi0MW0bUSE+/wA5rjQcVRzGjz+d8Wt8F6kBrPTQka8mhG4G/ZnHhrT79+DSxy+JWZef7Emg1ERWdDrra5exRjzXE5Z1yrX1o5XgnnQDLrHtKb/4SlY3d401x8LtYexxUy6IPkkmTXGBHpDGYevmQrk4LZnBKDJDH8caDgfQj3a38wOKJi/PUKz98wEMiYH/XgOw==;
 s=purelymail3; d=lunabee.space; v=1;
 bh=zsiQXjZQZt7L7hHCItmEZj/VYc5KzbMSoAA38J4AT6Q=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=X/jE9aPbwWfwUjQgJcjGYmvRdzk+RDgWY2g09TybwcsRvBZ6qT2XIutMsCwxyuKMLD6KL+b7EgGcZkUfn4oXbkNdpfLwFQT6nIaC0ushgIFgH5IFMArIIFxS3daT6pSoiFisSSP3hM8osPxaA4qgkvij/prM23xw10LWMZolFbcdFHDWDoLWUTGxFWutZt6yGreohLeyYts1Z9VbCpzdDIn8zTbVFGBV/m8KYuGLAk6LSOZ9ioIT40gsTg38m1W5h/XGWOl9AljxWqfZOicZxrR4kYevR0r7CjGircfzrp0RsQ0J9zmB2AdfSkA0jCu4LyXGheO4kEuTVcIrTrnWRg==;
 s=purelymail3; d=purelymail.com; v=1;
 bh=zsiQXjZQZt7L7hHCItmEZj/VYc5KzbMSoAA38J4AT6Q=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -100958845; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Fri, 20 Sep 2024 04:17:02 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v4 00/11] Simplify bootloader data structures and procedures
Date: Thu, 19 Sep 2024 23:15:54 -0500
Message-ID: <cover.1726805765.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>, 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>, Herman Rimm <herman@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 (-)

Modified per Herman's review.

Felix Lechner (11):
  Fix bug where the extra menu entries for a bootloader were shown
    twice.
  Move <boot-parameters> record to a separate file.
  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/local.mk              |   1 +
 gnu/machine/ssh.scm       | 105 ++++++-----
 gnu/system.scm            | 287 +----------------------------
 gnu/system/boot.scm       | 376 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |  71 +++----
 tests/boot-parameters.scm |   1 +
 6 files changed, 467 insertions(+), 374 deletions(-)
 create mode 100644 gnu/system/boot.scm


base-commit: f59c4126827af3d2041d49f1d0a8ce12b41470cf
--=20
2.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 5 Sep 2024 07:15:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Sep 05 03:15:43 2024
Received: from localhost ([127.0.0.1]:36024 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1sm6iV-00060H-HC
	for submit <at> debbugs.gnu.org; Thu, 05 Sep 2024 03:15:43 -0400
Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:50965
 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <herman@HIDDEN>) id 1sm6iT-0005zw-5b
 for 69343 <at> debbugs.gnu.org; Thu, 05 Sep 2024 03:15:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman;
 t=1725520467;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=uo9+n65Jiiypv6BC7//3lM35y/Q6puGrgQZ2pTdlz7c=;
 b=buWtbTmEcfY7lVq6bwWXYyE9/LmgrslUZAZ504X5eImkYsSnK3tPEY36sC9rgwEuXdmQ69
 gftiH5Dh1BgDupcHsYpREUS/gjHknyAIOlcthaM9aGXvdS/Jn0jkXlF5tgWcd3wauZjj0w
 VRQsYFRSojMIPug2QIt7M4SSYtT7VG99bWRYpLKJpihhJGV12e+yviDZ447dfycKvXu7Ic
 7j8/PEfO9jbmM+ggFv6ONFMeBoUhj4dPgLxPX+wn75nflNlycEkncTDbF2Yy4faUzrGPvR
 92EkEagV/Uq9VygnwHRRAPx7Hga6VOBjXx5xZj1wUriCJ3uJQfnupf0ss8q6uQ==
Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 12f08692
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Thu, 5 Sep 2024 07:14:27 +0000 (UTC)
Date: Thu, 5 Sep 2024 09:13:57 +0200
From: Herman Rimm <herman@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: Re: [bug#69343] [PATCH v3 00/12] Simplify bootloader data structures
 and procedures
Message-ID: <hz5fnapfxgltu5k3ib2pp4xcdm4tazkic4ia6dkccxd2go5rhp@w76pordmlmtz>
References: <cover.1708736440.git.felix.lechner@HIDDEN>
 <cover.1722741214.git.lilah@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
X-Spam-Score: 3.6 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hello Lilah, Booting with the EFI boot stub still works when
 using this patch series. Can you squash patch #3 into #2 and try to keep
 the lines within 78 columns in patches #6, #8, #9, #10 and #12? Also in #12,
 can you align all the boot-alternative-* and indicate the type of boot-alte
 [...] Content analysis details:   (3.6 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 TVD_RCVD_IP            Message was received from an IP address
 3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
 [81.205.150.117 listed in zen.spamhaus.org]
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
X-Debbugs-Envelope-To: 69343
Cc: Lilah Tascheter <lilah@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.6 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Hello Lilah, Booting with the EFI boot stub still works when
    using this patch series. Can you squash patch #3 into #2 and try to keep
   the lines within 78 columns in patches #6, #8, #9, #10 and #12? Also in #12,
    can you align all the boot-alternative-* and indicate the type of boot-alte
    [...] 
 
 Content analysis details:   (2.6 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
  3.6 RCVD_IN_PBL            RBL: Received via a relay in Spamhaus PBL
                             [81.205.150.117 listed in zen.spamhaus.org]
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager

Hello Lilah,

Booting with the EFI boot stub still works when using this patch series.

Can you squash patch #3 into #2 and try to keep the lines within 78
columns in patches #6, #8, #9, #10 and #12?  Also in #12, can you align
all the boot-alternative-* and indicate the type of
boot-alternative-parameters?

Cheers,
Herman




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; 4 Aug 2024 03:17:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:17:02 2024
Received: from localhost ([127.0.0.1]:55037 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRjx-0007mc-Ot
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:17:02 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:56606)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjv-0007m6-Hj
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:17:00 -0400
DKIM-Signature: a=rsa-sha256;
 b=odvQ/3TZNBWJWPETPFKX8H9JoeOVd+QfA7ZLfcVJk3zsM+319FkrIhyndA8feBBv0Br4vv83oM6ZN0fjCydl0PmCQkKimj/kUXKj1kjIeAqxqyL8OkOafuaIAM1Avdc/fB9CVnlsDViiOdg6+j8JZG37VVi6kBpE3HN2vrUFihqYmPpdzbwICK1pS2Dtqeu7xS4TOE02sh8KozV1h2EIwLalqKo+ApMTQ8S6OhndTvimq7UW8ZvtDgoiSo3n5SCdjKEF0nSZjJy7A4JcreW3SpaRPWknQ+gBYoR4UOXCx5TeqsAbysjOHycP0NdN0cQTznxR8LcL53FSMgnOKIQcXQ==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=RUHmSuhS5uGJenfJXJKaEJCl2J6PvkMjfkqxRW4ZKHI=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=Y2TFPijtjktrmsFyWkzw+S9QsO2mFSUvVdMlzt5B/cX8FP8MNJEG3OaDCaM8SRftBnKvZnLu5aMiQQ6g2Ud4DT/pk/CCB5s6QHpprdHhoxdMu5Vhadlwr8LIshBIrXrLWRV900P+w5uLJLbP/R1ErBdhp7EdB+RyKllaYJ4isLmP7ovtSNHBZaGXw+nzDkcxTH/SFKxmXeNwzM/T+jjDz7R6WOvw6uqaVNgxzCWiLRLYsN+t4vW3aqX+oHLK9U9BQfiBNp3EYvxyWWPBaBpdV6vyQpPxyqWVkQrjbDgmOrDam1CaXGL9Vj7nZozsuIdh2SHTBQjHJ3vGtkTYb6EAQA==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=RUHmSuhS5uGJenfJXJKaEJCl2J6PvkMjfkqxRW4ZKHI=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:42 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 12/12] Encapsulate <boot-parameters> to retain generation,
 system-path and epoch.
Date: Sat,  3 Aug 2024 22:13:34 -0500
Message-ID: <7d781027c78bdea5fdb3f1c9c9ec432b9606d2b5.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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 fa1066b27b..8dd8c342a0 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -416,8 +416,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 remote-exp
     (with-extensions (list guile-gcrypt)
       (with-imported-modules `(((guix config) =3D> ,(make-config.scm))
@@ -458,13 +458,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 ...)
@@ -508,7 +513,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 ...)
@@ -582,13 +588,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 b1302b8786..833caef496 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -71,6 +71,13 @@ (define-module (gnu system boot)
             read-boot-parameters-file
             bootable-kernel-arguments
=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
@@ -299,6 +306,13 @@ (define* (bootable-kernel-arguments system root-device=
 version)
            #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
                             #$system "/boot")))))
=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 0c69f6d90b..0f7d864e06 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,26 +328,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
@@ -396,7 +401,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
@@ -407,7 +414,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
@@ -824,7 +832,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:54 2024
Received: from localhost ([127.0.0.1]:55032 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRjq-0007m4-4q
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:54 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:56598)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjo-0007lI-1D
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:52 -0400
DKIM-Signature: a=rsa-sha256;
 b=AUYz0YWWI1AApKqX96bJ9Nq7zoRzSAcFJO1cpsi2GnOpFokmq3+/+FIqAtHBwtOA57A1DYb3B25M2x5Lf89NvMxVv1pYY6egD+Pg2FWRw92Bqb/4yNPdjSExqmyeX2eEe6FY75FFt1jOdzKQZ3ECawim2GXR0w+MPe1t63Dy5mFMNY1jbdNL6c+s//srFqxw0RdPr7adnDVmIR0KLf2oVmuHl2arxmWrUXucwdM0n8W1l8+gvxORFOvlkrSsf6tN/nmpBzKtvoqZtu0K6XBEMyaex9gfO8WZFfj4M9gJRY/OoFdCfOGfv965bz0TsUhlDnF5J8W/k2rK+cw+Hpoupw==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=Tk8W7qM2jR/8/MeUJ1Qk7Yr0/D33pJMJPZnx9XqDdmw=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=eLDUIkKaUdaHDLWbs2bUrI2TNJGcMaDh8E6qgLIdX1+4d2LVbO3CY1N9O4fDYlrtnWiLz4CscqZjXABHWB+qtovGxg6THvngQz5Cg4DpYeCg4oKEIL4D0EQq1YtxwSaboJaWDXmheNeKGKcF7XGNLhkgxINYUy/GP2ZUkzU4T0a2yV7ag0cDA7FuRyh/psapK88pkvSbyEOgZNtdcLy8B9QkGW3k5+tsATeAECD7PX2FrnFvG5vVYOXTlW2XAgNpQiFBzj5SG8yHSYF8ns3WNb833/Q7hDiKVPcMQWikXTl7isNwhPCFcGdV16d++Arp6cGpXWEcrjVsqc5IA2CnUQ==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=Tk8W7qM2jR/8/MeUJ1Qk7Yr0/D33pJMJPZnx9XqDdmw=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:41 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 11/12] Split generation->boot-parameters out of
 profile->boot-alternatives.
Date: Sat,  3 Aug 2024 22:13:33 -0500
Message-ID: <009964ba87f3458ce70ce14f3106c46971cb57ef.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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 a4dd7a8054..0c69f6d90b 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,22 +328,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
 ;;;
@@ -391,8 +396,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:50 2024
Received: from localhost ([127.0.0.1]:55027 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRjl-0007lb-Io
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:50 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:56590)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjk-0007kq-7M
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:48 -0400
DKIM-Signature: a=rsa-sha256;
 b=YYwsZqOfkYX9rIPXhPn5svMlP/ILeLHTsIHaT1FuDGxP8T1qilzniIlOrxmv8t4pVOxWUfTBG5lswy3mGOsNK/mPu8tKNYHWW3e4mvyALSeUtH2tefUmvJurmZ+PxWqpsF6KDY1Sq3AlL2IkVo1er9+YinBlF+wjcMeJpxpIRlTMQwD+SUy4VDF9em3v0LLu50hUGvesNQvoGwQq5206nz3JF5QWKvfWyx+zKmDxI4FwCral2qJQz9AFalfsChKh84vJthJIjO5r8s0jBqMdV7Kwh7RaoVRPg3zgn9sdt6LZyOTdCJqHPITZ0TkH8CdkHWpQQRf/O1Jz1ILt04/Mrw==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=NWG6NUH0mK7gkG+sq9A+xR0W0wwVR7O7WawedBxVieU=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=C/Tski/rxLHcqwLFnr3W1xs3s1wkXuQqoxL1rgPZsuqGYvylYi/ltwvLfxaoTPcLgTah9SG2jZBUX3teATL5BEmVVt7beg5D5f+mWiMGAW5DY8Kv7fKAWr18HIufTgemGMgjF1FORP7UX4VmmeXqvyTm2v2YCwRn7yHDfQVfskMD//nGONvvPaYNUChX+pzzQsqA6KBew74RJnxJyd8on4eYC2F0Q11ARvgGpwuA+N6qzoYnaZZxAaFaEHV600F5tJcNvbp6N89fpIlPoeGSCr+saugPr8XfOdiw/CYBkLYs7Kq/2exSID82j/IOiSxoiXwIX9ceaK0ErDJn3iApiQ==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=NWG6NUH0mK7gkG+sq9A+xR0W0wwVR7O7WawedBxVieU=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:41 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 10/12] Simplify profile->boot-alternatives.
Date: Sat,  3 Aug 2024 22:13:32 -0500
Message-ID: <6b454e5cd048626a4f32bcec0d135f700f705b92.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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 cdd78a7849..a4dd7a8054 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -334,20 +334,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:47 2024
Received: from localhost ([127.0.0.1]:55022 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRjj-0007lJ-5J
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:47 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:51922)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjh-0007kZ-J3
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:45 -0400
DKIM-Signature: a=rsa-sha256;
 b=I9T/4sY9fz149ShK0VpLjWmYSXmSHSY/h39zdB7icindQY7D6o87ZPE+M9G820dwZMuEiX2su0D6ZNHWzQu6c7WiooUHrjtlg4zbQ5EmfUymJVs8OjAnpFeuYw5GGkgagFvG+y89pbm+Mjf3vZBfhRy1XIoT4VS5Ul6b0sORmItbvecXfA2Ngh+txZ2i7P7rvlO9+DIHT5jmoGtHbkwHSe0f1AqQrP62zjxqJN7Ee2/FmZVU3oj2P+5tBnwiE4gWP/kIvKvGp1DVcjJ30MLuc/HY09ycCAJxBXpD1gYpWafha4eNfDkdcfx5/UE+s8K70qLAwPEbl4PHB/nw7ozB+Q==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=4MuWm+0iaQXUgxclHAHItfhlMj6cT4OP/EafMQjnn+g=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=P+yYzydrET0+G3PEukGwnKJ6M2gzXPhQE712nELbHwpVHzOWd3Dmicwm3Fu++zBzy9Rs4bOx3FUiLCk5dNBo80tcarW7mzpC7cRnJzelAme/zH9h5y+jkZi3zMHi1O2cP4NnXoMh0F0tEB0yrseYne17Cki5ZDefzMXOsfJe3oIX15l99m6erjig49LIv2ZTARKc4ggIldmGodwrrmMu73QQONvWBKucPfWczBieq1vo4TTDL0WSP8udodk2Vy6L1A6fPaPEUrIpDcngnc1ZRS67uJpN7XmZUCFGTg6VZDera3qLgDATRPKDPs6kXNk7zBP6lcxGZ3enH/+NR+m+1A==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=4MuWm+0iaQXUgxclHAHItfhlMj6cT4OP/EafMQjnn+g=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:40 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 09/12] Give a separate name to a commonly used expression.
Date: Sat,  3 Aug 2024 22:13:31 -0500
Message-ID: <907087c7d2f0161e1c7800430c6017d2b4b92b9a.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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 75b02bff50..fa1066b27b 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -582,14 +582,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.45.2





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; 4 Aug 2024 03:16:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:45 2024
Received: from localhost ([127.0.0.1]:55017 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRjg-0007l0-PB
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:45 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:56582)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjf-0007kS-7b
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:43 -0400
DKIM-Signature: a=rsa-sha256;
 b=ixXog01r+kpMlOje5vqmk9Sx29cVRLsDE68Q0nH0ZblGlHH7q0250at82QU0bcYXIWSbIpyhe2gpO7+OJwFmAZLLeS7DNGKbxpYYxvuB8EISykEeMxJ+puhjvXAoniOl1hsf5Tj5/M/tkLYwmuKFGxUtVAp/fTaGeEsYnDQxF4E074CFHfip0mAVnaRSh8sSD3EFRCZu8AdmIudtynnHG5fwAX3o4XT7enMqPSBejw333xhNyw0xBNj6VEU0mSASa7gBsTGkb1yhR3GffJq7ujv2z8qk2mmU3bdYCFj0G0cKGwv7wU2+DCcmv0+H40zMnu8XHJeJx4fP17iNutHSsw==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=8Y3lwlhVZfv4H/3/f/+71DSSH9NmrIzG73u+i2tfSKY=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=EQCNT6By20f/bsVJIAfAjVOA+AzEy04je5/X/dwgfRA9WPpcYeHk4ay7is119Ugt0ZiSJd4E/MHUunl/cdhYuuxr4Q3DLQSFYh7W7TFn7JCrYsumNJzm6RUZfsS0hM+AloatWo/W/xqQBoPubvedBOJ82zhCSzRhCutwx+JBKcsIlBiLzEJ0P5P9DWWqEe8VccVMr+TYER3m6puiFHGos1SEduTSwoPEivCH4SZegsLxttKboiXL1LIhS1CPZN9QhGRNk9Q9bVDwcFKXWlNPt74qhq0N3VqxgxE24gwQJ3LudLkRGztRO2z1GIOGll9nrF/u0bg7SDuG8N3M/BrOLA==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=8Y3lwlhVZfv4H/3/f/+71DSSH9NmrIzG73u+i2tfSKY=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:39 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 08/12] Rename two remote variables confusingly named
 'generations'.
Date: Sat,  3 Aug 2024 22:13:30 -0500
Message-ID: <e868e6475ecb703122792bc93b831d4ac5885bc8.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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 f3d2a77625..75b02bff50 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -449,10 +449,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))
@@ -465,7 +465,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.45.2





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; 4 Aug 2024 03:16:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:42 2024
Received: from localhost ([127.0.0.1]:55012 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRje-0007kg-47
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:42 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:51810)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjc-0007k3-JW
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:41 -0400
DKIM-Signature: a=rsa-sha256;
 b=q2CM70bFf/bT5SsHpAYk/IZA4mhFV82oVVM1rV+riK8ZsCtsLV9ABNefDlKMXWUA4lemmAwBkk8oVAXOCNy/dqaahl0ogzHzXWuMcNSttU/D25qqd1MYKPuYPLp1hJfIp+m0kdHOpVOFGbvTFbu9To06P6NDHCn6oAYCQLD7K0SSSow5TtDF9m36ZrGMzV0rh3aQy8fR/r0vnhTYx/9W3UuQ8hZvKw7DELdv0H9GdEBtabSH47jeUzNCLS2nGp5y4yo1PK8TJ1b2N6ivYyKoL43QwoCo7LGb1KtQuxh8ixnAKWiHpqWN23TonlC+hFbujq0s+uFSpu1IJsawqYKWfw==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=y5Tz2MCs2MM3YaWA05pWXrUKfFWXWXur/6HXGs15djE=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=IZgdHsiuGExBfhHonsIeDJvx7dFsKCMz6JtcqYgzeqZb9slc7w9UaRW7wlVIBxXSYig+S9epRA44S9sFMepyB+nVPT0a/gibzB/soYAXTWCpKm0UsfcFPLGC/4bq8PTiaWiBNpYDqFNe0cBlp99L3VK0XE1InQKQWTK3XZeLZEofrGI3CoG1kI+TTOTQptjEQvQmFsFKosZt/5itV9JltqGOypkj5ledsNtKGXsQGjWThcTPcwpF30Mdw/4aOn+tW3FdyHwsPXUhFNB9OrtateQmD78ZYL9EmY9vR2eUCITJOFXewh+ilUNGabvC4H37OOo90MNdWM20pU3y2cPxSw==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=y5Tz2MCs2MM3YaWA05pWXrUKfFWXWXur/6HXGs15djE=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:39 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 07/12] Rename boot-parameters to boot-alternatives when
 appropriate.
Date: Sat,  3 Aug 2024 22:13:29 -0500
Message-ID: <0bc81e0b885d720e8b094a64f22253248425e787.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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 3971469e33..f3d2a77625 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -415,7 +415,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 remote-exp
@@ -501,14 +501,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 ...)
@@ -579,19 +579,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 84eb99b938..cdd78a7849 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,9 +328,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."
@@ -395,18 +395,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
@@ -823,7 +824,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:38 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:38 2024
Received: from localhost ([127.0.0.1]:55007 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRjZ-0007kJ-KD
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:38 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:51806)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjX-0007jW-I3
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:36 -0400
DKIM-Signature: a=rsa-sha256;
 b=YWXon0l1i47J4x8o/ysxps2DDy1sdjpRFwkHSxHoje2Dmt/Sp6KMyUxfBhAouzKeXtQNccfBrQHVJTRGvsjbaRUf0WU+RtN7IEfg3TBrcwB1l5Ru1Jk7Vuo9LTGG8e7vL5ZbdkAuQJfS61QM5+U2+0W/Kxw8ApMrPy98phcBTyqXqJKw+XwdyDF56PnuYOXg/t1Dg8+JM1f0glHO3R53ecLtPULzt+nWVOHE1jLGEgL3oJI49SEqRlj/iCUpLgCVU8OJ8Igjl7aOtryuihMYi+ezzltGJjBqfAGImemmtlSOnxn3GC3U/dsGt6fXPKLQw/LHMxBgyWWrTwjIcCbIjg==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=fU4zrS3h+RESWGPofXsOm6UJWY6GaeME8xd4jKqnYus=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=DhnSa8QVVsVDa6xyGvjdBobFM3gYy5tXyUS9N/ujn/2QhShCpuwRSSGUoImGGHzqyPNkyoYQID1V+/6HC02AdoeECS5a69vsxa/6Y27PnIG1kXoh6dj4lCmrqQEAz/lMN/Vgqd+DQ/tiz0Hqw+dhGPwsrrGTf6/bEZehQ7/9A5FFGhFhRW+7rugO88nnWYMvUQJOPHogze5WIwjWjzPY2oGg8ttwP4Jk4LQvGoanuoy9koytuMP6plYNQIt5o/jYOZB818IasBWqnAVARVRNDtV8x1tEskdcRT+1y0FsrcAKVJar943H7VXkeNh5vWejY+qR2M5KPToh/1yHjwh0/Q==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=fU4zrS3h+RESWGPofXsOm6UJWY6GaeME8xd4jKqnYus=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:38 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 06/12] Offer a uniform decorated-boot-label and use it.
Date: Sat,  3 Aug 2024 22:13:28 -0500
Message-ID: <1cd48d746543091532044ffa979cacc17f725cc7.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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 e68e64527e..3971469e33 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -457,15 +457,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 01e3a965e4..b1302b8786 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -72,6 +72,7 @@ (define-module (gnu system boot)
             bootable-kernel-arguments
=20
             epoch->date-string
+            decorated-boot-label
             boot-parameters->menu-entry
=20
             ensure-not-/dev
@@ -304,6 +305,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 b197812e63..84eb99b938 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -337,12 +337,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:36 2024
Received: from localhost ([127.0.0.1]:55005 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRjX-0007k4-LM
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:36 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:56536)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjV-0007jP-Og
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:34 -0400
DKIM-Signature: a=rsa-sha256;
 b=q45eCk3kECGfYW+hvIkxhiTpR/E78iUuhibKoz7O+pDCQFmLS78P23LsGPSsmcuYPdN9HXufi3yzN7jp/76by1c5JhX6+OnL8bszqWPwMxgWGl+I156jIxyPpMIdN/i1lstd9Qcv6Mjcqm91lNA6tlQO9dn6ioOL6rVYgAsLDr3Nk1ZXxbQe5UHU59+olCv++B7aenNze78Jvaw3f74b6Ex/l5BsUjwSFffiGN6goq0Vh9eSwVc6n03VbTaM+KViy5796UfkXvTB1/3etbmdUcq3sD4PAspjqV+o2f8aDVXeYnLvNkkgrrQfUiSR5jUrhEY80hIie8rBxwib73Vnxg==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=fwzoCc7y6ItU44Puf4gL6wng+1TnmX0zYcUUjQTfsJo=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=qIRbQS1VNZHJKWiNuEA92m4ikWRisVVRSzvOIVzhoccAUOnitVTEXejW338HtL0YWAH2CNnT1TtlW9SaVwINcIru6GqP7RCMf6BLe3cyRpcEEjxXiJCKMA753jGgJcB7AoFNEyupXQLzbPWkfJsuGcUiOWeHD7S8Lgunfqb0ezTIkrLhaS47ys7N0vbKNUf2cqn6bv/wJvVfNsWxwTtFhNLS3G4sGJM0Cl9wvhZXz8UZeQH2pj7C8Wh8GOkSziFi9e5nsqtlOEaYZyMu7+tahlyF0lPNeP4cSOxq66R3cHh5pr/hHT71c87cYfy/BPpMs08vplcsW8yy8EXP23Esfg==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=fwzoCc7y6ItU44Puf4gL6wng+1TnmX0zYcUUjQTfsJo=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:37 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 05/12] Move epoch->date-string to gnu/system/boot.scm and
 use it elsewhere.
Date: Sat,  3 Aug 2024 22:13:27 -0500
Message-ID: <d9708ecbc7b3b10ffed7a78d6076e5ffaaef25d5.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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 749aa2b6d8..e68e64527e 100644
--- a/gnu/machine/ssh.scm
+++ b/gnu/machine/ssh.scm
@@ -442,10 +442,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
@@ -453,7 +453,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))
@@ -464,9 +464,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 df27b8aea4..01e3a965e4 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)
@@ -70,6 +71,7 @@ (define-module (gnu system boot)
             read-boot-parameters-file
             bootable-kernel-arguments
=20
+            epoch->date-string
             boot-parameters->menu-entry
=20
             ensure-not-/dev
@@ -296,6 +298,12 @@ (define* (bootable-kernel-arguments system root-device=
 version)
            #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
                             #$system "/boot")))))
=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 cb70d36219..b197812e63 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,19 +328,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)))
@@ -348,7 +342,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:18 2024
Received: from localhost ([127.0.0.1]:54997 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRjF-0007in-Lu
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:18 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:56516)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRjE-0007iF-81
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:16 -0400
DKIM-Signature: a=rsa-sha256;
 b=V6I/7vg/b2+EwJvyM0aV8xMcwnGRVZcFa4/KebBRmW08vjw0zeNBOukyf4bnnzbIA3aRRX+kQA+YFKcnI6qChS+8XuGDUMoliH9HdhIIg/8PJuaFJPcOCMuBZE3AOU6VFIEWnhbh0FPUTlU3obOxalkN5G9UNq/abOb4DouzWC2U7E/qOxVhfmBAfQPSj72YRdFNFzLcRM95UPvSQM/ajQCFuCuMJgDsr30jFfj2oeJht7R1klGhubPsGKuY6Qh6hYK5+t+LPBOPYPL2D+2vHEGpOP929vIvMEbc6BS5ypOxpwA0wJ4xeZZzq3yMgDOVocTcuZO+495D7QpNX5m0IQ==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=oThLW0/lymMCVSVmKwy8oE8qI6vmgdd2ZBmkRVkECVU=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=k0PuBkTvqP2YyjuIkVV2JVBTEiZ+t/S2YoMpACHm/07u56Hkd+swh4wHru/5G0MTCjgeJ+Kk7fC56udwbby1DD6lOVQwalFDiiYo/pbkcRUrnjyRe6IPP4fIZpcDq4sT9JPsGK4NCyb5iHDOJGIWIMFLZinWCRUDzsP5msy9Vlgomzj6QdnItGdZGZU1EA0sISbKbTAbFwa6tSkBNbaH7Ges96h0Ip/vrjOIdyLr5MrRGfhxeNc/lZhstoe7/af+OBg0BEWQPWjCq4yOlxwxl9neJr8FNaMYfp1xSL9X/E2L9yzmEV6gxgzRGp0Gde5haR+hI4zZOM4QgkV+QWaikA==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=oThLW0/lymMCVSVmKwy8oE8qI6vmgdd2ZBmkRVkECVU=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:37 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 04/12] Rename seconds->string procedure to
 epoch->date-string.
Date: Sat,  3 Aug 2024 22:13:26 -0500
Message-ID: <df1d58f482a90f5e5c67a08aaff1673dc319fdca.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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 7000c470ed..cb70d36219 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -328,9 +328,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
@@ -348,7 +348,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:13 2024
Received: from localhost ([127.0.0.1]:54992 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRj9-0007iG-J0
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:13 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:51702)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRj5-0007h5-Vr
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:10 -0400
DKIM-Signature: a=rsa-sha256;
 b=mYs3mQYBH/bj5MWWFfpkOhnuMZCmZOhoNGL3GcT/ppiCcGTED6QgqFRrAla8/Kyp0iEaj5LiKAjxqv5sfqJrPykNFs0Tri6jphF77nY3Nlmhf/+SRJOXM7O+hGPLRpxlKdcyI2sqYEforpcB9QX2RggVUY5ISZ5Owf1ErPY61dqU7cvWGK8aTauZ6BELPPQF4dB/dFi3DdSf4zJg2d7fSjQSlSnjjXcnNd4pshtBc1uNg3BHU66H+g5JvR8Z+l2moGzzms/LDg6ptrkPt6xpafeArE48+kBDZ3NrSoQziVsO6U2RPz/Gl83og/OyjA6CfhuGNR/i9nggMXHfj1WlgA==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=a5UGzS5kQkdVSvcKofZnx9J57WwombKPeOCAElNSvCo=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=LVeUwlXYjUk0X0334JXnmh6JlcX/ch3gJuGI3Kubpl0EPGhz2x81U9ebW68ciBxLp8/Y+M9nRy8cL6B3s8aTamnbqyZ0WynRV8EFBbd1jdQuNAPxnIM4pK3ak/MKds7pVrjSusUJkzz8jBHacJJFmTnaYB60g1VItRcff7PS1PiuplzkfFIsWIKKHh1NE3TM06mNUyMhVqmnjS3F7pQQdR2yUg0SAEV2Zo4cjC+esebn6mLJl9JvqpECbOjlTBazhBjB3hljLToUMsdheQqKGDTc4/xpmaMBlYQt1PwYYulz+AxQqMn5lnlUQwc8BlCvE/C3x6gQIacj3mkd737P1g==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=a5UGzS5kQkdVSvcKofZnx9J57WwombKPeOCAElNSvCo=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:35 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 02/12] Move <boot-parameters> record to a separate file.
Date: Sat,  3 Aug 2024 22:13:24 -0500
Message-ID: <84d2bacfdda34a9c8be2ed13b3d348280f9ba2ef.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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,
  bootable-kernel-arguments, 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.

* gnu/local.mk (GNU_SYSTEM_MODULES): Add new module above.

* gnu/machine/ssh.scm (machine-boot-parameters): Don't private-import
  bootable-kernel-arguments.

Change-Id: I6944ffd4c323c776005b0cef23218bffae59be23
---
 gnu/local.mk              |   1 +
 gnu/machine/ssh.scm       |   4 +-
 gnu/system.scm            | 259 +------------------------------
 gnu/system/boot.scm       | 318 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |   1 +
 tests/boot-parameters.scm |   1 +
 6 files changed, 323 insertions(+), 261 deletions(-)
 create mode 100644 gnu/system/boot.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index 6d2b14e72d..8375e13709 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -758,6 +758,7 @@ GNU_SYSTEM_MODULES =3D=09=09=09=09\
 =09=09=09=09=09=09\
   %D%/system.scm=09=09=09=09\
   %D%/system/accounts.scm=09=09=09\
+  %D%/system/boot.scm=09=09=09=09\
   %D%/system/file-systems.scm=09=09=09\
   %D%/system/hurd.scm=09=09=09=09\
   %D%/system/image.scm =09=09=09=09\
diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm
index 0be9ebbc0d..749aa2b6d8 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))
@@ -417,9 +418,6 @@ (define not-config?
 (define (machine-boot-parameters 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
-    (@@ (gnu system) bootable-kernel-arguments))
-
   (define remote-exp
     (with-extensions (list guile-gcrypt)
       (with-imported-modules `(((guix config) =3D> ,(make-config.scm))
diff --git a/gnu/system.scm b/gnu/system.scm
index c76f4d7c50..2e4b10e2fb 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -72,6 +72,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)
@@ -145,31 +146,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
@@ -192,29 +173,6 @@ (define-module (gnu system)
 ;;;
 ;;; Code:
=20
-(define* (bootable-kernel-arguments system root-device version)
-  "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVI=
CE.
-VERSION is the target version of the boot-parameters record."
-  ;; If the version is newer than 0, we use the new style initrd parameter
-  ;; names, otherwise we use the legacy ones.  This is to maintain backwar=
d
-  ;; compatibility when producing bootloader configurations for older
-  ;; generations.
-  (define version>0? (> version 0))
-  (let ((root (file-system-device->string root-device
-                                          #:uuid-type 'dce)))
-    (append
-     (if (string=3D? root "none")
-         '() ;  Ignore the case where the root is "none" (typically tmpfs)=
.
-         ;; Note: Always use the DCE format because that's what
-         ;; (gnu build linux-boot) expects for the 'root'
-         ;; kernel command-line option.
-         (list (string-append (if version>0? "root=3D" "--root=3D") root))=
)
-     (list #~(string-append (if #$version>0? "gnu.system=3D" "--system=3D"=
) #$system)
-           #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
-                            #$system "/boot")))))
-
-;; System-wide configuration.
-
 (define-with-syntax-properties (warn-hosts-file-field-deprecation
                                 (value properties))
   (when value
@@ -361,210 +319,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))
@@ -726,17 +480,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..7bae9d2102
--- /dev/null
+++ b/gnu/system/boot.scm
@@ -0,0 +1,318 @@
+;;; 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
+            bootable-kernel-arguments
+
+            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* (bootable-kernel-arguments system root-device version)
+  "Return a list of kernel arguments (gexps) to boot SYSTEM from ROOT-DEVI=
CE.
+VERSION is the target version of the boot-parameters record."
+  ;; If the version is newer than 0, we use the new style initrd parameter
+  ;; names, otherwise we use the legacy ones.  This is to maintain backwar=
d
+  ;; compatibility when producing bootloader configurations for older
+  ;; generations.
+  (define version>0? (> version 0))
+  (let ((root (file-system-device->string root-device
+                                          #:uuid-type 'dce)))
+    (append
+     (if (string=3D? root "none")
+         '() ;  Ignore the case where the root is "none" (typically tmpfs)=
.
+         ;; Note: Always use the DCE format because that's what
+         ;; (gnu build linux-boot) expects for the 'root'
+         ;; kernel command-line option.
+         (list (string-append (if version>0? "root=3D" "--root=3D") root))=
)
+     (list #~(string-append (if #$version>0? "gnu.system=3D" "--system=3D"=
) #$system)
+           #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
+                            #$system "/boot")))))
+
+(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 0305128763..7000c470ed 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -70,6 +70,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:10 2024
Received: from localhost ([127.0.0.1]:54990 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRj8-0007i0-11
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:10 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:51704)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRj5-0007h6-W4
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:08 -0400
DKIM-Signature: a=rsa-sha256;
 b=p+hUvS8Xu2XM3odq+GQkkzndbUH17xgCGlJVOjEf0LXKxCit1uHG7TiJP4BcnQzstOdLGdDyTHQFNGC5RakWfPki4FVginF0e85VIRipUrOHrDWHy4A08FOZWquEiqzZ9RtCVNIdyi5kGKTKRFusPlY75Ul4P7bUdEfWMu+FGn2GQ5cPpH4RJ9xms/WcJYKlfTExcRn2PASFhWuoQE/57SpT4WqATl7e0Iu8QgcK5FEJzjBkcCyuf4tb5WeF3NIxZf9UzFooPoQX9LDNplJCurwzqJhoEvUcJfcNR2fh8RfwGhh2dbBI8RrCvqm3kLcr2AWHd8bOMEJc7Ixqtr6Jtg==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=jy/kU1dLT9HOtgJ0JkSUOAOHJKl09vrJf8Tl6mXh85Q=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=eHjt6bbt466xWrBtW0kTZOohgjmXG///hFzMdW4LfoS2/58/weiz69/Uar0vsDbdhpuaZPmxrrqYHoIu1mD/Hrj2ROwg4WtUeMqVKmmm32NAiwTxl5HtPInUniofs3+pw9GkDlkAXqzXXPpFVqrVbkK18PeyvZc0xQCXFHUeZopVa8IjsgWfEhnmwPjpYjZnnzXGRN90QCiAPkg/cCX6DwSz+Qvua+9y1dkdAZ+UtSiFihmYYREmkcqmVo8d3wk81+wtnbWU7/bqy354FaKZmgvvYISlBpTFjhWkZexDjVGjPGRokZyv4K1aGrJlpwUG5X9akd5y5YJguh4Re5GWjQ==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=jy/kU1dLT9HOtgJ0JkSUOAOHJKl09vrJf8Tl6mXh85Q=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:36 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 03/12] Also move boot-parameters->menu-entry.
Date: Sat,  3 Aug 2024 22:13:25 -0500
Message-ID: <9f0909b3323fd6dda448e7c9b36f9c46115dc778.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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 2e4b10e2fb..4a084b2ecf 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -151,8 +151,6 @@ (define-module (gnu system)
=20
             hurd-default-essential-services
=20
-            boot-parameters->menu-entry
-
             local-host-aliases                    ;deprecated
             %root-account
             %setuid-programs
@@ -314,32 +312,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 7bae9d2102..df27b8aea4 100644
--- a/gnu/system/boot.scm
+++ b/gnu/system/boot.scm
@@ -70,6 +70,8 @@ (define-module (gnu system boot)
             read-boot-parameters-file
             bootable-kernel-arguments
=20
+            boot-parameters->menu-entry
+
             ensure-not-/dev
             system-linux-image-file-name))
=20
@@ -294,6 +296,28 @@ (define* (bootable-kernel-arguments system root-device=
 version)
            #~(string-append (if #$version>0? "gnu.load=3D" "--load=3D")
                             #$system "/boot")))))
=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
@@ -314,5 +338,4 @@ (define* (system-linux-image-file-name #:optional
    ((string-prefix? "riscv64" target) "Image")
    (else "bzImage")))
=20
-
 ;;; boot.scm ends here
--=20
2.45.2





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; 4 Aug 2024 03:16:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:08 2024
Received: from localhost ([127.0.0.1]:54982 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRj5-0007hX-L7
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:07 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:56494)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRj3-0007ge-43
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:06 -0400
DKIM-Signature: a=rsa-sha256;
 b=HX0fVzAs5xOV34TRNun+64UaDPkqDNXmYM9EjEuno8BM7iHQtezOPRGm496bgLgXZNHOrwdo8aftpxPlAGvYipfyPuBA0kgFEa33DUg+mJwK71VJELT4sb+oxJJ7P9LAjVQBLfZyIV52wnAZA4j9GtsQqcl/CVjDlsxQpHowXiRClqD0aH6/VTfNUeKTYAqSQu9OCTzbCOo1Yr/S8FKObKcEFu9VHYGr1wHBd3c0HtOSe/8nMchYg9xN6XLEOqp5zhJif/Qobt2040upy4RApQ3HwPnJc+gqA6FB4dWggUxYFR8HpBcjVD30syy3WPRDLaRkFXV0Tf8s/+TJ/UKeFA==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=qXWn1cz6zN65+Q68ygAxFMhzoQIb60JNk1LL8A3ilhs=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=Ymjeoj9Jm14DJFP4EBzK1dnPTb9ym2vxm7IH9FQaaCxfCnupBBlTGJFfhYFQHJZv//T09kaiXFZa1+Od7GAcSX8/V+RyZOIPuIseU6ggIywS4sbw3327sRtzy665xoNqH0GlhHuJXhYeK4hCB24K1XGvs9q20LXyhF+Ljx393c1RdE7Skt6Y2fwFhPr+vbH4zWA/ufGQ+Ozb5RAzvV1nYlUdwaw/aP0kJIViDGnwBDtwvXP6MwH0QBF7lbb7QDz8auq1Dh71HhV76geHgzrEADZKqIkPYPLpvuQeRusd0qFCw7mWgeRSl3E2B8p0gncBNgBQ6tMfSlhvGfORA+c5fQ==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=qXWn1cz6zN65+Q68ygAxFMhzoQIb60JNk1LL8A3ilhs=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:35 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 01/12] Fix bug where the extra menu entries for a
 bootloader were shown twice.
Date: Sat,  3 Aug 2024 22:13:23 -0500
Message-ID: <048a294013321d432030a71007d7386d2f1308d7.1722741214.git.lilah@HIDDEN>
In-Reply-To: <cover.1722741214.git.lilah@HIDDEN>
References: <cover.1722741214.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>, 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 99c58f3812..0305128763 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -412,8 +412,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.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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; 4 Aug 2024 03:16:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Aug 03 23:16:07 2024
Received: from localhost ([127.0.0.1]:54980 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1saRj5-0007hU-7p
	for submit <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:07 -0400
Received: from sendmail.purelymail.com ([34.202.193.197]:56492)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <lilah@HIDDEN>) id 1saRj3-0007gd-43
 for 69343 <at> debbugs.gnu.org; Sat, 03 Aug 2024 23:16:06 -0400
Authentication-Results: purelymail.com; auth=pass
DKIM-Signature: a=rsa-sha256;
 b=kDNDltF1UvZ9HnuKf5NipDmrpSWF6i0osX/NzZcdjAm2qZmnbbmkaIVhS96hJfZ9izeFzUTGjCgoaiJNguKks1gvK7Q1BSbaOl+mB5dxKPigxJw1P2u4FBfzyx7mPDPGWzXwOx39NSxw1ptqi0zgmZXUb9NS14TNB4IWw19snxbmpA1m0mci8ybiV2SVyKPdN19WnuYPD4Jy63xDCefwfwP2ooE/gpRAVLkGf3vdSzaJWzYXaQejUX8emfGPKe8VRf5r4zceO7V9qxKdEGjvgy5xCbfCDcVLei10bi3RgtWvhyZRbI6WUhAeVUsLp4f1eUt81ENnGcNuyttaEqi6fg==;
 s=purelymail2; d=lunabee.space; v=1;
 bh=5uTVr6x+b9Lqb5s/g9XGLGDnzwnHw/FafC3zZt5ibcE=;
 h=Received:From:To:Subject:Date; 
DKIM-Signature: a=rsa-sha256;
 b=jlLiwJ406gSVpj62KH48ptH51J6joNZPC5dl6Y8OFu+RmO2B+zIdGY97Rula+TQlScJyLqKcUzrUaurQCFfZ5F8nvCIfT/2sTVlwvAOWtVxm+vgK+GtzOo+HfEvHfKOILhm57l2Z15h1UevqhGUjpDqpdcqr2lO+N1PQF8FZR1IO9HvGx+fN6pE6fpmOdcJtBWGW3S4nYZ797Moi7rSj49cwOj/Y0G6OiVQgFcTR/juNfKg7SK4tT3O6f4fcK4IB6/SUel1UgykooO6Pu/TjuNN4URrQP1mDuCdneBelaBQPqjsMDdROT82TnJdOz1eL58jykgThDrxEAU8e3YWKgA==;
 s=purelymail2; d=purelymail.com; v=1;
 bh=5uTVr6x+b9Lqb5s/g9XGLGDnzwnHw/FafC3zZt5ibcE=;
 h=Feedback-ID:Received:From:To:Subject:Date; 
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 -2124817350; 
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384);
 Sun, 04 Aug 2024 03:15:34 +0000 (UTC)
From: Lilah Tascheter <lilah@HIDDEN>
To: 69343 <at> debbugs.gnu.org
Subject: [PATCH v3 00/12] Simplify bootloader data structures and procedures
Date: Sat,  3 Aug 2024 22:13:22 -0500
Message-ID: <cover.1722741214.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>, 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>
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 (-)

Two small changes here: add gnu/system/boot.scm to gnu/local.mk, and one ot=
her
small fix. Kinda forgot what that second fix was, sorry.

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/local.mk              |   1 +
 gnu/machine/ssh.scm       |  77 ++++----
 gnu/system.scm            | 287 +----------------------------
 gnu/system/boot.scm       | 376 ++++++++++++++++++++++++++++++++++++++
 guix/scripts/system.scm   |  71 +++----
 tests/boot-parameters.scm |   1 +
 6 files changed, 453 insertions(+), 360 deletions(-)
 create mode 100644 gnu/system/boot.scm


base-commit: f59c4126827af3d2041d49f1d0a8ce12b41470cf
--=20
2.45.2





Information forwarded to guix@HIDDEN, dev@HIDDEN, ludo@HIDDEN, othacehe@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 16:34:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 08 11:34:28 2024
Received: from localhost ([127.0.0.1]:59397 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ridAx-0004xe-KK
	for submit <at> debbugs.gnu.org; Fri, 08 Mar 2024 11:34:28 -0500
Received: from sail-ipv4.us-core.com ([208.82.101.137]:42938)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <felix.lechner@HIDDEN>) id 1ridAs-0004xQ-2K
 for 69343 <at> debbugs.gnu.org; Fri, 08 Mar 2024 11:34:25 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=sDEtYzjaZ5y3HS9
 1XTVMCSn1EMeKyJq05pAgk+cHYzE=;
 h=date:references:in-reply-to:subject:
 cc:to:from; d=lease-up.com; b=AYIEVdcgRkXPttTWjDvWC/bLyfLkIMKR60dedlkK
 ncv4bLp38oTpVQz6bH9gg9C/taVWD3Pn8Tp0z6D49kkdcTb9ComonCSA5xYvE3OA/PO7s1
 dY8kEnboVqN2IgZxdnx9RLT7Gg9Y/AgWLmdol9ftEOhSu9NiSDHu6/dfGLhlg=
Received: by localhost (OpenSMTPD) with ESMTPA id fe69d9f2
 for <69343 <at> debbugs.gnu.org>; Fri, 8 Mar 2024 16:33:48 +0000 (UTC)
Delivered-To: 69343@HIDDEN
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=2017; bh=sDEtYzjaZ5y3HS9
 1XTVMCSn1EMeKyJq05pAgk+cHYzE=;
 h=date:references:in-reply-to:subject:
 cc:to:from; d=lease-up.com; b=AYIEVdcgRkXPttTWjDvWC/bLyfLkIMKR60dedlkK
 ncv4bLp38oTpVQz6bH9gg9C/taVWD3Pn8Tp0z6D49kkdcTb9ComonCSA5xYvE3OA/PO7s1
 dY8kEnboVqN2IgZxdnx9RLT7Gg9Y/AgWLmdol9ftEOhSu9NiSDHu6/dfGLhlg=
Received: by sail-ipv4.us-core.com (OpenSMTPD) with ESMTPSA id 89270730
 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); 
 Fri, 8 Mar 2024 16:33:47 +0000 (UTC)
From: Felix Lechner <felix.lechner@HIDDEN>
To: Lilah Tascheter <lilah@HIDDEN>
Subject: Re: Simplify bootloader data structures and procedures
In-Reply-To: <cover.1709885528.git.lilah@HIDDEN>
References: <cover.1709885528.git.lilah@HIDDEN>
Date: Fri, 08 Mar 2024 08:33:44 -0800
Message-ID: <87jzmcwumv.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 69343
Cc: 69343@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 (-)

Hi Lilah,

On Fri, Mar 08 2024, Lilah Tascheter wrote:

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

Thank you for taking a closer look! Sorry I did not get back to you on
the system-path question before. Of course, you were right.

If you will please accept an excuse for my tardiness: My family has a
new sister. Time passes when a baby cries.

> * (gnu system boot) was missing a few imports that it needs to work.

I regularly notice missing imports, too, but haven't figured out when
they present an obstacle to running a Guile program.

> * (gnu system boot) requires the procedure
> system-linux-image-file-name, which is defined in (gnu system). I
> moved it over to (gnu system boot).

Thanks for doing that! Now you and I are co-conspirators in re-arranging
the procedures.

> * generation->boot-alternative in (guix scripts system) had typos in
> variables resulting in them not being used.

Thank you for finding those. I have poor vision and am not good with
details, including speling.

> * commit messages didn't have relevant gnu changelog info.

Yes, I will read the GNU ChangeLog spec one more time, but all hope may
be lost.

> * one of those commit messages had a wholeass log that's Way too much
> extraneous information and just got in the way

My commit messages are widely regarded as wordy, roundabout and overly
documentative.

> 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.

I use 'guix deploy' and will test your patch series shortly. (Despite
the previous shortcomings, I have been using it in production.) My
branch rebase is overdue.

Unfortunately, I have many custom patches, including some affecting core
packages. A branch rebase locally causes a full bootstrap and takes
about two days.

Given your attention here, I am sure your changes are fine. Folks should
feel free to merge your work before I return with confirmation. Thanks!

Kind regards
Felix




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: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: Sun, 12 Jan 2025 05:45:02 UTC

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