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 ms8.migadu.com with LMTPS id mNqFFrDL6mXyXgAAqHPOHw:P1 (envelope-from ) for ; Fri, 08 Mar 2024 09:26:24 +0100 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 mNqFFrDL6mXyXgAAqHPOHw (envelope-from ) for ; Fri, 08 Mar 2024 09:26:24 +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=VCBDmbAz; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=r8+Wa08t; 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=1709886384; 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=1UAOaOrKXSKkU5PLez//vrFZc+9cMpJfG6civa0Cc8M=; b=afzhdF8Ecrd7Lb9HyYAB8/9i6P1HzTpDV6iPgUxzsRWkO92smHFkXsqhtpK5da+vCWyZan aCKZrUN18nC/OOs8tuJPnADXOFqxSEYdxyeeT277HJoHEPDthHnzWaJIaHOuoytjCC0Lyu GDpzlajk2cZa/fbi5rtpGYqU/TgpxhYUrnpUnWO5WVOumHg056ZSTKEWvatSM0Od0dNxJU Dz9QnEDvEOrpntTIOKDoIj/aDHqQC1r824COxceITmmmv8VCQtYDgqj+oImw2dR1ee93tp rf6e53Hy76Da77XRDpikZmahDrZGB1Sn2zNi8mKejf/kvA024K3W93lhmwHWqw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709886384; a=rsa-sha256; cv=none; b=p9QUW2mVGeTixVwIj1Bz9THyats1M45b3+OVPBsqZRkrra0iTet/7oz759fyxrOpkwD9fy BgTFYaOMALMq+84WfM8fgfpQLZVxvlm4tGZyX6ESvUS6kFm5blmZZdBCIH0RYp/VqaU7Ox uVv6EZrG+3DsoubX47q8dK6s/BpvDcON5Xwr5EYXpcsaXQE4tONiUjnSkARfMnTZX8JL0d oXuvKtz295vI860y7USUnRVIFu8R2FMQsvWafIsuOCTMCukwVJ3DGGkPCH9bee/wsMlGgS UK+dIxhfmGl4uhtZ2v+BAdWbNxdLtBp7bhywj5dLrpptBYdbM5l09jX2p8+nBQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=VCBDmbAz; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=r8+Wa08t; 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 216DD42CD1 for ; Fri, 8 Mar 2024 09:26:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riVY5-00043f-Ah; Fri, 08 Mar 2024 03:25:49 -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-0003vd-Vs 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-00018N-7d; Fri, 08 Mar 2024 03:25:36 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1riVYL-0002eE-1o; Fri, 08 Mar 2024 03:26:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v2 07/12] Rename boot-parameters to boot-alternatives when appropriate. 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:04 +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.170988634710009 (code B ref 69343); Fri, 08 Mar 2024 08:26:04 +0000 Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:47 +0000 Received: from localhost ([127.0.0.1]:56399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riVXs-0002ay-0D for submit@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 ) id 1riVXl-0002ZZ-RS for 69343@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@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) Date: Fri, 8 Mar 2024 02:12:03 -0600 Message-ID: <7c47238a38488fdb2f509c2a021c183f645cbc11.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: 216DD42CD1 X-Migadu-Scanner: mx11.migadu.com X-TUID: wZNo9ug8ov8h From: Felix Lechner 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