From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id mOVDOZ/37Gb/XwEA62LTzQ:P1 (envelope-from ) for ; Fri, 20 Sep 2024 04:18:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id mOVDOZ/37Gb/XwEA62LTzQ (envelope-from ) for ; Fri, 20 Sep 2024 06:18:40 +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=vAlNRH3g; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail3 header.b=PFoFvbhx; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail3 header.b=t7+HQQ6w; 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=1726805919; 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=xH6N3KcjXiHGSeavyBCwt+jekQZziNo2tyGwxHomiik=; b=jGpKXrt6Dgtt3yrKCZ2J/FpLhwoF89Ptie9Zna34Qag7EleOWVMy2UCZpDSc9oCnUpe4dq qqcn9aLxC0QqVzWMHW7KKhyOrzYkbt4WGrqaKvwKR04ZvoQgbpiD2yhdlPqqWFH2JHvPNI /v/B6MTshXZnIkaKfxI6SornXoAGoDjvuEd2IL13D0WWj55KN6Z5HZVfRJiF5FESCITks+ kw/VR/CcCRqN4XH/XpGWeqK825SJc+QTY5eEsVwMP8Z9Xong9XKotwA0p6fsH7BwvoGd2y wsHgEEjJ5JtXPmwtsq4ES6SSyrHpJKENPIjKMMQeJR7bLQ9gVOvMpPxxHtXUNw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726805919; a=rsa-sha256; cv=none; b=AM3u6IX0tg53mYKZVoThmHFzLBL0RJIHB0hYcPLx1e8oeyEd8Fy8gTExdlqfGxcYHDIj80 B5OtrsxSjqEErVm1QGFh42OJ1K1oI07GhiqjHHC/JJc8I6MUh7T+OKYgt47UyBWB4w+i7A d+1j3LWntwzZ3QJaUJdSiJ8iNn1QkiEi8rOqiua07RCS51JvEZritxBvVNDzjDjmLs/o8V kqvk9nVwbvmOrAIonyM4p9XmEQd56EX3DUjxn/SW+Fe1UzD+NBGgDyFvAQOfXM3nFKaU2l dogkIBYIHcPefj7eK6k+klULCUJ0qCSgeoW9lVWcVebRIeWTSNS2bhFn4ghd3Q== 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=vAlNRH3g; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail3 header.b=PFoFvbhx; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail3 header.b=t7+HQQ6w; 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 AA36C60239 for ; Fri, 20 Sep 2024 06:18:39 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srV5k-0008GU-Bm; Fri, 20 Sep 2024 00:18:00 -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 1srV5Z-0008BZ-O4 for guix-patches@gnu.org; Fri, 20 Sep 2024 00:17:49 -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 1srV5Z-0006GX-E4; Fri, 20 Sep 2024 00:17: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=xH6N3KcjXiHGSeavyBCwt+jekQZziNo2tyGwxHomiik=; b=vAlNRH3gLivrLYtWea1wARNNbH3tFPFV5K36AJzew7TBO9efso+fKQYGCcKYccu1eMG/kuhKzmIYtKHnl/YBCZmhNx7oeb+BqyYdevw9+qZgCvAvPtC5W1uG3xWg0PQM7wTJ+YhUzL+IJCVYpOhcxT7IHdi4DYG9SKrMk8UCw0bsqq+mMr6StIViPfFJhnitWLezEVEyhmKC+of9K8nBVx/AoLwINRJIupwhW9uA49e0vmKYUrO3dqHG29J8leb23kiA7/O/d5HE4vVdeRr1TFBO6GGj8Wdx+AdhglkqPJKHZ0MO2x8AXKfb5I0GzXrqD9k3v6LZYbjy/UQLRkn0jg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srV5p-0005UA-Mq; Fri, 20 Sep 2024 00:18:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v4 06/11] 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 20 Sep 2024 04:18: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: 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.172680587420954 (code B ref 69343); Fri, 20 Sep 2024 04:18:05 +0000 Received: (at 69343) by debbugs.gnu.org; 20 Sep 2024 04:17:54 +0000 Received: from localhost ([127.0.0.1]:33748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5d-0005Rq-Jl for submit@debbugs.gnu.org; Fri, 20 Sep 2024 00:17:54 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:49248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5V-0005Qg-Ch for 69343@debbugs.gnu.org; Fri, 20 Sep 2024 00:17:46 -0400 DKIM-Signature: a=rsa-sha256; b=PFoFvbhxhXpudpc0chA2aUkQAkQjVl4iZwsA6FBnPBgJxBlUv3STqMLDq3rH5PcZvwSTZw5pwwABIMgLomOxGSQzkJJoeWZtw2xt9sfGgA/+L+J+Pry9NT1l6EzAibs7LfGHqTh/k2drwmpf7gRLocX2wJNmInVMU941hAZtse3dqNchidnJdEvAGB2KQP4T3rdLEP97jKN5uifqhpEUPF1gOTVbbkeuBD2BcnvG/8K15cic8fygNSOSZB+PqwT/WJyw7b1h+Wh3iLcIcVHbRfdG3QvOWYCN2dLJIJ/2M2VMRGJH/iGSF3u8wHvZIoiwzM8hTRoy+WHkLYVx88URvQ==; s=purelymail3; d=lunabee.space; v=1; bh=y5Tz2MCs2MM3YaWA05pWXrUKfFWXWXur/6HXGs15djE=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=t7+HQQ6w0Qa46wTRAnrmWhWOMheiInqJcLztutUHUJ0YvFyF+dLHggyRVZphWpLwlojodegpZ0gVhGDNObCtCleGPBInsfTPdYATgbOK19yd0J2slsvpFOtKRKbHCUJ0FFo9wRkDbcmVXBlwjTeaL0N7mnlfrUL4SsoIkxPnJgkEvvT2KJeTavtwirxdKo4IwfNeKlws1xpV505FWF552Vm9L8MNM62hJ9vPWrkE3KflCeGvPnNPvlLI+QhTVZLOe/29Cr8zSjzzTBNMTxYylY54GBBHM1wtEnIgX5DQx3/M+TNBlGyeYn4nz9b/omkepMI1zer+KJqrKwDXahPJZg==; s=purelymail3; d=purelymail.com; v=1; bh=y5Tz2MCs2MM3YaWA05pWXrUKfFWXWXur/6HXGs15djE=; 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:16 +0000 (UTC) Date: Thu, 19 Sep 2024 23:16:00 -0500 Message-ID: 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-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.51 X-Migadu-Queue-Id: AA36C60239 X-Spam-Score: -5.51 X-TUID: FCLr16ozWMuN 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 3971469e33..f3d2a77625 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -415,7 +415,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 remote-exp @@ -501,14 +501,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 ...) @@ -579,19 +579,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 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))))) =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." @@ -395,18 +395,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 @@ -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= )))))) =20 (when (eq? action 'reconfigure) (maybe-suggest-running-guix-pull) --=20 2.45.2