From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id SBUfLj6f7ma8TwAA62LTzQ:P1 (envelope-from ) for ; Sat, 21 Sep 2024 10:26:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id SBUfLj6f7ma8TwAA62LTzQ (envelope-from ) for ; Sat, 21 Sep 2024 12:26:06 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=L8ZivxL+; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=JYwv0zu2; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726914366; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=rxvFX0W5DTBuH/E5MgZyz5ZQ2WKoV/sy8F4Pvs8vo6Q=; b=t8/116gcZN5DPIB+xele/G8fdmz8HjNohZ66VbywGc3rdK8qmmo4XU6q6wKbiknDPba2Zb YCW3ZakqJ4sbKX0JaHTxO/awCroyvI8HG6DfwNYu7VHtFycQsSH5ka+S9Gz68goRgMxNgG MgOX0zs4OjXNEdF1s7ORIrDVryhIdF1314MPMme9EUuI5I8myL0D7nOWnaeyh44SaO0z07 SgMR38kguskgUTgHwfrkgTwWW33aZj4258bbiUj6zBSdfCui7iJ4QFFxCNbQX2cMfJxIxA cgopLVrseh7JX4M3bRwspJ5ZvsrWltzdaSblhTatBl1FzaAy4RcpX+rJiGI/uA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726914366; a=rsa-sha256; cv=none; b=tp+hRcllzmqr3vbETA2DpJqSKBLU0wGCZRdWGfQrY23R7R5mLUbIz93A4RDQYEmhFnYARg dfhI8BOeegRMJvcGC9JRMqJldMTcMlLilsfRVUeEjkWO6iDlk+Ul/f0v2CUjWHtDMfj/Ik ZoCF0YptpSCYagKMtPwpgaMXBPVwwVCIGI+6S0eUd6o49gIW/L7rBrb6GKsXxHWXbHJcYk 1jFjFCCobCMeuEHDrNwvkCNk6wkDrLQweZtLvlUPtggTVV2jz1raPRwExB5Flz77Gvxml3 UW7u12zs9ybPOjCfOGBNiI0oyKjMbv5SHKPmYSGsFc8+/ATYVFt4IPtPYoQMOQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=L8ZivxL+; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=JYwv0zu2; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7C4FF8357E for ; Sat, 21 Sep 2024 12:26:06 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srxJJ-0000vw-2M; Sat, 21 Sep 2024 06:25:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1srxJB-0000jE-2i for guix-patches@gnu.org; Sat, 21 Sep 2024 06:25:47 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1srxJA-00053C-Gt; Sat, 21 Sep 2024 06:25:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=jkL+FQeZ/9ax5nQ8G/5jnclnGfSqcBVmxK2MWS+Axfw=; b=L8ZivxL+tpWltLhSXS1fxfqua/dv0DatGCSKzqFCIPQYtYeBFrMBLB+aXy5lK9ypjBTr7KLGSsW7cFzKTteYURzy6xzi47qmpqz3X/2jbz5cOvCdirUUQcaqyuJSYm/lSN/YEr777D0wRNUSTt/drb0ITK50OnechfzXQv4bGIhB1m0FCiTPVVG1Ze1fR32wASDsZ5UhEv5Ct4ENPWYinsct4piOyecvPWPkonFVe/8PerZvYWbnjUluLyj0Kqn6+CVA3Ovnt78uYO1nxYCL3Vep43p1tz/7RwZ+tWLzyvQfgPv+aUwlPIAjZhz60UF1O5l0APjP2eZs6gKQH3S91A==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srxJS-00060F-IW; Sat, 21 Sep 2024 06:26:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v5 09/10] Split system->boot-parameters out of profile->boot-alternatives. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Sat, 21 Sep 2024 10:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69343 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69343@debbugs.gnu.org Cc: Felix Lechner , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 69343-submit@debbugs.gnu.org id=B69343.172691430922468 (code B ref 69343); Sat, 21 Sep 2024 10:26:02 +0000 Received: (at 69343) by debbugs.gnu.org; 21 Sep 2024 10:25:09 +0000 Received: from localhost ([127.0.0.1]:37340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srxIa-0005qH-IG for submit@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 ) id 1srxIG-0005li-D1 for 69343@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) Date: Sat, 21 Sep 2024 12:23:22 +0200 Message-ID: <470795ee2a6bcf10608519c5cf2579ce4f7092c3.1726913452.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.01 X-Migadu-Queue-Id: 7C4FF8357E X-Spam-Score: -5.01 X-TUID: eyONOJgPk1k2 From: Felix Lechner * 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