From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id kPXDGrLL6mVhYAAAqHPOHw:P1 (envelope-from ) for ; Fri, 08 Mar 2024 09:26:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id kPXDGrLL6mVhYAAAqHPOHw (envelope-from ) for ; Fri, 08 Mar 2024 09:26:26 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=hkdDqvCM; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=CYlIEP51; 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=1709886386; 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=skq4qqpu8m4BtxagPFJMiPLnWeEguZcGXTsdiYfTiXI=; b=N3fLHD77qf28aDvEU5o4kJ7g/MU+GuXmUMgf/8jn16ygcQxKD6fyNJfQEzN2VduEie5rAL 5so7GkIqc6qZYYD3NYAZF6t2BQs6CUTMawe+UHfoamVEGj00VytTehiot/lf4ZHotLHEVy 4uUHo2K9pHugXw0KzVJfNhBdO8eMmiMvfdUXWqNRCsbSaTRxSOcBbBNtwXdYE3S+DBx3mP EI0yc3y3UjiUStxGS6HVMeNISmpIs8mDRAjn/ly8Bn0zAM381LPtYmzrl5/6UhDt6Q4ggS bWRY5NQnCoa0HIrUsYhy4L+qZRRcIds0nPNj20Zp1Gn7YvIZtSSKj1OFheUiJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=hkdDqvCM; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=CYlIEP51; 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-Seal: i=1; s=key1; d=yhetil.org; t=1709886386; a=rsa-sha256; cv=none; b=tePigvnJnuWm3rsE7Mck0Ah4Te8IV07wGDcBN6mesjIx41cMo2ULIycr/zVLwJtoY/q50G SFEA7MDFYKqsahZz29C7NRYN9f+KMndu84ZQUUntOwlgVc4KIjW96ThEd8f/U7QqMAfXWY 7KjiihUkEdKzUpsr7BvgLz4OoncFNIntJi08rN21NJi46irNj2OOZjcckDZVUcPmKKr2LA 0gKKyAGaDt3PHk2WFRVvkl8rXl4XqCP+K8bLS6WaHO4BO7NFr0/JkKPldk3BYoM7Eg9gWt ebl9P9g/LUsFEY8VRbA96kQWNRNjUrjzCwdNhxdyTHssOdAN72JXMxAjbw4gMg== 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 3606145FBE for ; Fri, 8 Mar 2024 09:26:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riVY2-00041X-Mn; Fri, 08 Mar 2024 03:25:46 -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 ) id 1riVXt-0003vZ-VM for guix-patches@gnu.org; Fri, 08 Mar 2024 03:25:39 -0500 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 1riVXr-00018e-Gx; Fri, 08 Mar 2024 03:25:37 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1riVYM-0002ed-0T; Fri, 08 Mar 2024 03:26:06 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v2 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, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 08 Mar 2024 08:26:05 +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 , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic Court??s , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 69343-submit@debbugs.gnu.org id=B69343.170988635310066 (code B ref 69343); Fri, 08 Mar 2024 08:26:05 +0000 Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:53 +0000 Received: from localhost ([127.0.0.1]:56420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riVY8-0002cD-JA for submit@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 ) id 1riVY5-0002bI-Tg for 69343@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@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) Date: Fri, 8 Mar 2024 02:12:07 -0600 Message-ID: <05ea87298e8731b00fa7127e97a6b497ae391695.1709885528.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: -5.28 X-Spam-Score: -5.28 X-Migadu-Queue-Id: 3606145FBE X-Migadu-Scanner: mx13.migadu.com X-TUID: eUaeN5ogmSQ1 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 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