From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id UOfECM/yrma6bgEAqHPOHw:P1 (envelope-from ) for ; Sun, 04 Aug 2024 03:17:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id UOfECM/yrma6bgEAqHPOHw (envelope-from ) for ; Sun, 04 Aug 2024 05:17:35 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=paFCu8yL; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=AUYz0YWW; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=eLDUIkKa; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1722741455; 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-type:content-type: 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=T7BKkIrypFS3jrOnHYS9zc/rfHl2KYrYktxjcyxu/0M=; b=qjzTbTOuJn7jtwymBaVfAiP8UM+NEgD4A6noUp1fqfgoOwR/8w2scfBtthbZ5T780i7Sd9 YUinthFh/5Hs6Oc2ILKPengaJ5GdQZS177KlB1r/ccCZsPiGtcUyNKpkh6tqFCex/pF35/ CA6qR3I49Szuqffi1NS/VIMB0U0L3x91hAVTLsuxZJdjQZbetO5AVASoKmE1vruY8rYHVv ry6Jx37hkij8IomjbIDBwKpZLXRVsnX0rj6Zx89VqQEWwGBS4qqbk/1wHk7Ebyfn7VL0B/ F6zjZ5qj7NRRRGyhNMitJvtNQvgUp1sIi6Y/RgUjl2SNmAyt6p3nKmxu41IqdQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1722741455; a=rsa-sha256; cv=none; b=CAJQmo58Ik+q4zbi9Ua5brNrbqfwxIsuInO3tZQScqYYAhg9mgSY8nx8FnlW9F7D7fwKin L0hvHo49qIi7PaC4EXro8IyUkAOShUzLwpOLkkay4sjYNs3u8iAV+vCjpXPSSTWLqIEzsk oKJXWpnfll8pqq/22/NifJdchfJzyI5cbZxICnsMxNG6vQzEKfegNrmCyXamuttMD92tGm ekv5CKn3UUBU9I6bU86jPO3qlkes4TAW4XGMBdY61ibDuipeD3F6L3TGyPpFkcOw/B/kRf x7nOHKRZuw1EY2UgOpfJFiTRYpRNgEDEq3sYUNHrs7TZ17TXewlsn/P+csopkw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=paFCu8yL; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=AUYz0YWW; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=eLDUIkKa; dmarc=pass (policy=none) header.from=gnu.org; 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" 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 DCA9864395 for ; Sun, 04 Aug 2024 05:17:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1saRkB-0003sW-KJ; Sat, 03 Aug 2024 23:17:15 -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 1saRjn-0003kl-1T for guix-patches@gnu.org; Sat, 03 Aug 2024 23:16:51 -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 1saRjk-0002RQ-TL; Sat, 03 Aug 2024 23:16:49 -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=T7BKkIrypFS3jrOnHYS9zc/rfHl2KYrYktxjcyxu/0M=; b=paFCu8yLchzm2Nd28ZXVjYj6C10RFFHp19BnFfHaOsuNAdHIv/ly1do67RR6IAWTHZ+PxxYpkA8sfwCXZh7jlmOo8G++y3YLGaa9+TGmXQoyQGn9jzjnv0cTAvlQcs0ICt+EWrbcy2js0recNDJDpBO28RYDeaSuyjEmSNUCATl+wDswQd1E+ic+8MWpP9mmMQAYL8GFbpsj+kQg1jDKACUVBnZ5YGm9K+TlAfwwhRq8VE0kQEU4sy0dx435Odow/T6HvfJ50p1zI2ppgtTPUarY4ngvfvXJjFe9fLr8t6AbozyvyTkqEa8njWpGlZXNWF98CLL4Ba5VNoPxTpDhCA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saRk4-0007ov-5w; Sat, 03 Aug 2024 23:17:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v3 11/12] Split generation->boot-parameters out of profile->boot-alternatives. Resent-From: Lilah Tascheter 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: Sun, 04 Aug 2024 03:17:08 +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 Court??s , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic Court??s , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 69343-submit@debbugs.gnu.org id=B69343.172274141429894 (code B ref 69343); Sun, 04 Aug 2024 03:17:08 +0000 Received: (at 69343) by debbugs.gnu.org; 4 Aug 2024 03:16:54 +0000 Received: from localhost ([127.0.0.1]:55032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saRjq-0007m4-4q for submit@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 ) id 1saRjo-0007lI-1D for 69343@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@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) Date: Sat, 3 Aug 2024 22:13:33 -0500 Message-ID: <009964ba87f3458ce70ce14f3106c46971cb57ef.1722741214.git.lilah@lunabee.space> In-Reply-To: References: 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-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: , From: Lilah Tascheter via Guix-patches Reply-To: Lilah Tascheter 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-Spam-Score: -2.44 X-Spam-Score: -2.44 X-Migadu-Queue-Id: DCA9864395 X-Migadu-Scanner: mx11.migadu.com X-TUID: L7qAJeONrLja From: Felix Lechner * 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