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 ms13.migadu.com with LMTPS id eClRFyGf7mYXKgAAqHPOHw:P1 (envelope-from ) for ; Sat, 21 Sep 2024 10:25:37 +0000 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 eClRFyGf7mYXKgAAqHPOHw (envelope-from ) for ; Sat, 21 Sep 2024 12:25:37 +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=lWjAAx0i; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b="Lb2WFKZ/"; 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=1726914337; 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=8Ov0D+T6vKnwMIl9sJeL5cgr0rwCOtUfN+OUVuNS1X4=; b=noJGd9I8YQGW79yY8ul1Aw/tZ+pjc8r7n+ZGzFludxU1WfG2ySzMNE+us9rc3jmouAQ05f MyHfDdhdqJqQJ79l0jA92UCv91ELoNAxFuTmke8CSyy14Ii1hM+IJ+zlwIjwLD5SGzP48O brWADtFikpCwCcbyr6L4GYDqT8XIeULjvLSWi/djHtsYi1AREI/UcrFt9vGW+6ZTIra65T zGtSgCDuTKci+zp21uU6zl5RIGNv+7YmqLKoXX7Ru9mFg8QH3es/8O69GyB+H2Y6HFpjUb ipqn1eXvjKdPh5Ec6YMjLz3DKqMOIui/t/AV8JVraWUKDzyngvL2aBQUburZ2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726914337; a=rsa-sha256; cv=none; b=VBTfVPzaP3KmAoMbriCDJS9FU35ttp73VVka9ZIyPYUivV2SlylfzDwAoVsPby2VjjjDYb C3SuIkq82vAzH4AfJ8z5719Q3TLz0Oe7crYrVtSaXy7AJ9+oHouxn4fMhUQBRqFkJtBHXv 5/OhkBDug0S5J2dvpIBEuuBaQG9Tt1F9yc9xd8vnkEI2Bn/iAdulibU9faB6D/UEhkdnkC HRP4Anz3dMP2GgECkprsuYDBn9EPTvcJTuyCjPRumM2DKVogPOJJv2MvQMGp56Og3F/zFX 3EcSx2TfjKH2qmCrkIxOl56Gdhs8Aybe5lWnrqrfXbo+fsZJHD53chRSwgYXMg== 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=lWjAAx0i; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b="Lb2WFKZ/"; 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 2D884168C3 for ; Sat, 21 Sep 2024 12:25:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srxIH-00006a-Tl; Sat, 21 Sep 2024 06:24:49 -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 1srxIE-0008W3-Io for guix-patches@gnu.org; Sat, 21 Sep 2024 06:24:46 -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 1srxID-0004cm-SW; Sat, 21 Sep 2024 06:24:46 -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=8Ov0D+T6vKnwMIl9sJeL5cgr0rwCOtUfN+OUVuNS1X4=; b=lWjAAx0iRc1trJ/KoGUtjdzEHrIqCGNxgbYKS6GT5Yl3mpJyzYCVMk7CvY57oEjUHF6EDj1AxbFs19yNee9bcdQFDDtncZxPObInEm2Rl1gx7Mpf3WOjmZ8+Df+LPvi8eyUK4g8Mk+invnJw+7WjO+wSj/cyNB90+HUo+18n7DfzhrkpB4uZHkAbsybFF28TFigAoQpaa/vHgi7+X7pQeRzQpwt7UFLPPjRXCH+XCId6SjQjbk+RNTmBDtMbxnjQ5Ty3zKjzjg/gx/9Bg2U4iD+X0OPzLsO1QQt3z97sTw/gqb9iCBgE2u2aJ1asPwDBDASpCEaPGpSvUsfua/tzWA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srxIX-0005pO-E6; Sat, 21 Sep 2024 06:25:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v5 06/10] Rename boot-parameters to boot-alternatives when appropriate. 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:25: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 =?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.172691429322309 (code B ref 69343); Sat, 21 Sep 2024 10:25:05 +0000 Received: (at 69343) by debbugs.gnu.org; 21 Sep 2024 10:24:53 +0000 Received: from localhost ([127.0.0.1]:37296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srxIL-0005nf-5F for submit@debbugs.gnu.org; Sat, 21 Sep 2024 06:24:53 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:42255 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srxIF-0005lr-Ci for 69343@debbugs.gnu.org; Sat, 21 Sep 2024 06:24:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1726914254; 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=8Ov0D+T6vKnwMIl9sJeL5cgr0rwCOtUfN+OUVuNS1X4=; b=Lb2WFKZ/oGurTjrTp/k/UmZwF2QIdWp37ipeEO2AUr2HvZy5tegYKnku83id5fPyf9P2W5 wbEXYgNU9Fv8PXlnOa1UCNWDReFQ2JVtbR7N6yHjo7s19etf/xMWmwo4C1yOBEXFyjuIXA qIr9Pqf/ASQSqOvQG6WObHSJcajN0T8ezBUfWRNJZkc70EzlXCeTS/krMovbsuojZrlWdg B0rCtE6eHreY/+FOcjV8kzarXNvLn1qwgQbhJVOrxtGAe9PIW8EFuXFv32JLUuBMo6gfWZ 5X2s2VTQTAxKRFP7CXir0zQ/m4QCnnSZMPG08r0ucR91RVFyxKjTQcDxrd+GAg== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id 47dc3ebc (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Sat, 21 Sep 2024 10:24:14 +0000 (UTC) Date: Sat, 21 Sep 2024 12:23:19 +0200 Message-ID: <17be076dc405f409a84bb566d4f5c226e62d6ae8.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.91 X-Spam-Score: -2.91 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: 2D884168C3 X-TUID: Z4gFllcn2UEs 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 3a0116ac0d..fae42ad3ce 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -417,7 +417,7 @@ (define not-config? (('gnu _ ...) #t) (_ #f))) -(define (machine-boot-parameters machine) +(define (machine->boot-alternatives machine) "Monadic procedure returning a list of 'boot-parameters' for the generations of MACHINE's system profile, ordered from most recent to oldest." (define remote-exp @@ -503,14 +503,14 @@ (define (deploy-managed-host machine) (machine-become-command machine))) (mlet %store-monad ((_ (check-deployment-sanity machine)) - (boot-parameters (machine-boot-parameters machine))) + (boot-alternatives (machine->boot-alternatives machine))) ;; 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-parameters)) + (menu-entries (map boot-parameters->menu-entry boot-alternatives)) (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"))))) - (mlet* %store-monad ((boot-parameters (machine-boot-parameters machine)) - (_ -> (if (< (length boot-parameters) 2) + (mlet* %store-monad ((boot-alternatives (machine->boot-alternatives machine)) + (_ -> (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-devices - (second boot-parameters))) + (second boot-alternatives))) (store-dir -> (boot-parameters-store-directory-prefix - (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 84eb99b938..cdd78a7849 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -328,9 +328,9 @@ (define-syntax-rule (unless-file-not-found exp) #f (apply throw args))))) -(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 specified by NUMBERS, which is a list of generation numbers. The list is ordered from the most recent to the oldest profiles." @@ -395,18 +395,19 @@ (define (reinstall-bootloader store number) (bootloader bootloader))) ;; 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 params)) (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 @@ -823,7 +824,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)))))) (when (eq? action 'reconfigure) (maybe-suggest-running-guix-pull) -- 2.45.2