From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0PR1GoX37GasSQAA62LTzQ:P1 (envelope-from ) for ; Fri, 20 Sep 2024 04:18:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 0PR1GoX37GasSQAA62LTzQ (envelope-from ) for ; Fri, 20 Sep 2024 06:18:13 +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=RPtdRsXu; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail3 header.b=FJJaHPka; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail3 header.b=PTgqHIDG; 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=1726805893; 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=ZZd4tFwm4nq+mvO5Dnl69iflJdUydRlkFne5xnbOY4SiiOuG5815Ygvw3htAOMGnXFaBMD CjHUrQ8H04R6+EZJTmSSZPJvlng4FwZtcFtqE+PweHvUgKKxK0Hx9rOUn5eJWr83gFBGHY HtoXB+kgKreXTWMls1ouICBPAVc10dMlYowc6ZIvYP9A90soxOcBhsEecSkHgucj9AJBUe yFxR389yBzwYTXeA8H0w6sduI8MBq1jNhrscmFGTvPKz4dlmPPMRRjlTjKdbeOmdBbo/SR 3sTX40Q9DYJpMEz5lQsdOxBFzvNE3V9dyaBJFR4ZtCxh/TeLsgtW/V5NlelYRA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726805893; a=rsa-sha256; cv=none; b=BGZJ1QNgjDVCUeUmnd4yIH6YxGEkbdXMbQTmT4CB1Y4q3J5oTzJR5g6mRrV0EndPfVWJ4y /qvQ4nd635viEz/QfPyiRMlGqSFRGh+fFSq10jJUNO3/vYpK6WOGW80Ipdtu17JxtX4MzT EAHHc9AKTJPOqoywlwJTfS+dyrcObPg+XrhfmbWBPnoU7f1lMWJn3jb/ccMbtcG7sZwWnh c9Lrd3GNTPO0N6qeAs+ma6SSQSgTDM/qxToCN55+E88M67lCwO58r6xM1U77HFNVVAyyY4 GaE1zIRPCbXoBGQoCdunDI6SOW7Vx6ZuynDjWw+QWdnSPNjjk6ovxIkiCeu2WQ== 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=RPtdRsXu; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail3 header.b=FJJaHPka; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail3 header.b=PTgqHIDG; 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 B5C0173AA6 for ; Fri, 20 Sep 2024 06:18:12 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srV5f-0008DQ-4l; Fri, 20 Sep 2024 00:17:55 -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 1srV5a-0008Cs-W4 for guix-patches@gnu.org; Fri, 20 Sep 2024 00:17:52 -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 1srV5a-0006Gx-MS; Fri, 20 Sep 2024 00:17:50 -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=RPtdRsXud2QWX1OFCcgByCqpZfyBRDbvT5VA8O6CjSOMuFX3FUa0G2HNP24G0DBkSGSRqWqA9v3iPRzGdey7DglDGbqLL9kK9Sz7F9JYWdRJvmgcvd80nLb2NDmbscGfHJfzzDGt7RuiPXB1tzGQm8ZoUksbmJz5GXko+JNyP9WFjcCjRrWYPW5YDSRejVpSx/Vdf3oo2EErk9GCcBQflc95LUExRh7ehbBYtz7lmfJhO5cHlRBFwIHBmkoZmr6iIP7dWJ/IPlN6bK2TD1kytVV365N6X3QAhAMXKPO1Uvx7dITJANTeMxpYl6OdamXcYzo3BOLfzruhBeLU/itTSg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srV5s-0005Uz-08; Fri, 20 Sep 2024 00:18:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v4 10/11] 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: Fri, 20 Sep 2024 04:18:07 +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: Herman Rimm , 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.172680588521080 (code B ref 69343); Fri, 20 Sep 2024 04:18:07 +0000 Received: (at 69343) by debbugs.gnu.org; 20 Sep 2024 04:18:05 +0000 Received: from localhost ([127.0.0.1]:33780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5o-0005Tc-Ce for submit@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 ) id 1srV5j-0005Rt-4j for 69343@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@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) Date: Thu, 19 Sep 2024 23:16:04 -0500 Message-ID: <852043d05b73160c4613e209130a527fb1f7a5ce.1726805765.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.41 X-Spam-Score: -3.41 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: B5C0173AA6 X-TUID: Mzh3Uu7MWtRs 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