From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uKTRDYnL6mVpOwEAqHPOHw:P1 (envelope-from ) for ; Fri, 08 Mar 2024 09:25:45 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id uKTRDYnL6mVpOwEAqHPOHw (envelope-from ) for ; Fri, 08 Mar 2024 09:25:45 +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=mU98KtS2; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=XCl2T1RD; 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=1709886345; 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=wp+mPjSfKDZEKDSvO0r0sAa3OfIdCfoevatk8r4txlM=; b=NSupwwc0Rfm8IfF/SbM2Y/Lw6gkqhS4DYd3CCRsBv2QdCrPILd7YyFfeIIbF6VD8y8JTV0 Wa8KVT1PcO+p9ELlK+nslSTddvWHDRRi3AIWs8SaWSywUS06jjhxBiGBIEHwm7pRKOfh5M YbyvgWuki9L5Jwl8ha95mPftPMCLoPDks9Oqe2glzSBDVJEejP7qo1sibRUMGzmwEkIihS iFHprZsMVmM7xKuHQWq0zDRRdGhjJqJsE6rf2YAwVbfq9Hz29QlUo703RX27Jc7gDgTktL upcqdo6xCdr51gRSnivrONL/AZNsKPA5CoxaowKYsmkpJY6vLYK+KociQ79ymw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail2 header.b=mU98KtS2; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail2 header.b=XCl2T1RD; 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=1709886345; a=rsa-sha256; cv=none; b=l4ACk6n1BLN5esyN8cPr6ltl4AGx1vHgXSVT/TIYtGODF3RzR9C9IMNY7uigExBR9QAXUu 6UxTts4dmPTSvlraKhXqDSpk/p0QPipu7MQDwO+nrvFtG1DzgsbCzRYY63GWTNrBMq2JE4 52ODkJTHgQG8zgyweKMbOmH6afKCS7s8JON7lVPqwNFGwfbYn7EVMKmvd5SZoktcg8QCEa Gruh9iIZkY0HoHpXuPUXTKkuRrz9wJSuQQh55sNxtnJL0/4ciDohKFUwFxXnDXQJDvht+R Ba4cjWrslqld9R9U2t1Qx5LpjXhgYnP+YigweRyNQWop3GZgyIRd4kCjycdBhA== 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 DC14B1C229 for ; Fri, 8 Mar 2024 09:25:44 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riVXt-0003vU-Po; Fri, 08 Mar 2024 03:25:37 -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 1riVXr-0003uC-I6 for guix-patches@gnu.org; Fri, 08 Mar 2024 03:25:36 -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 1riVXq-00017v-9P; Fri, 08 Mar 2024 03:25:34 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1riVYJ-0002dj-Nk; Fri, 08 Mar 2024 03:26:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v2 06/12] Offer a uniform decorated-boot-label and use it. 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:03 +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.17098863329957 (code B ref 69343); Fri, 08 Mar 2024 08:26:03 +0000 Received: (at 69343) by debbugs.gnu.org; 8 Mar 2024 08:25:32 +0000 Received: from localhost ([127.0.0.1]:56393 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riVXn-0002aM-9M for submit@debbugs.gnu.org; Fri, 08 Mar 2024 03:25:31 -0500 Received: from sendmail.purelymail.com ([34.202.193.197]:50366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riVXl-0002ZW-Qo for 69343@debbugs.gnu.org; Fri, 08 Mar 2024 03:25:30 -0500 DKIM-Signature: a=rsa-sha256; b=mU98KtS29DZEdku2rgYteoeMmM+q/In207TJ8QM4Gg6AqE2272Qc/HJSJJqwvdEvU2w+BO2ocJen0XA3aJV57HXFHGLsKj3a+9BJiuYvlc8L7yjmYiSMCfJbBnSo0dRJ9OHaXhoZm7gLU9jeWEZV4tN4gT2XGJfQv9+Vk2j9H4YM6pFe7CrogTt+mEgLP60O+WfjIAD7TW9CCwBmM4LweEDj2fjkREIM/DvG71+wrz5DN1H28qG2G0sWvxaK5yVDrsrxrxaq2yoqejfBX7D+OrbyMHyoeW3wOp3pILROHKn3go3Mr40M06fUG9U9TmJ1IACekVTWlCqiaImDK4Goyw==; s=purelymail2; d=lunabee.space; v=1; bh=poPtLk1Ci8MIhvsA44gDhFg36hV5E3a1KO86FEWjKME=; h=Received:From:To:Subject; DKIM-Signature: a=rsa-sha256; b=XCl2T1RDXJpQXc7rVElhMEjjOoFOm/V+a6z7lrtZtKBKA1iMDTW7WctFOyXoiFoziJhDIezquTofrLubekR1gYZ7WoVA7BTYZqj8BOcpE9/U8YRf5s9+EOWY58wvB/rSqA6QaZh1V+JZoSVAO5Zn5l4rmBhf83bQuz0hyzqHnydbjE/JM8HKwaUUTYN7H5mUheR2ISeDiNCOS8tXlA1f3mgHvh18F1Wx5N7/a9Hb+S7oKr1NQpQ7y2MlFdmuH2EEk11eg1R3aE5KyTh+AwgHa4PLEgXWGKj7FLeHRMh0pPDNlUZFXc4SH6ZDy232aWSFp+mqq7OxTDOTmcy18FQC4A==; s=purelymail2; d=purelymail.com; v=1; bh=poPtLk1Ci8MIhvsA44gDhFg36hV5E3a1KO86FEWjKME=; 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:19 +0000 (UTC) Date: Fri, 8 Mar 2024 02:12:02 -0600 Message-ID: <1aa5fb52ea0aaf3cffc990737140d7c169cb96c2.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -5.28 X-Spam-Score: -5.28 X-Migadu-Queue-Id: DC14B1C229 X-TUID: XpsjlhJkBNcz From: Felix Lechner * gnu/system/boot.scm (decorated-boot-label): New procedure. * gnu/machine/ssh.scm (machine-boot-parameters): Use decorated-boot-label. * guix/scripts/system.scm (profile-boot-parameters)[system->boot-parameters]: Use decorated-boot-label. Change-Id: Id348c3047df2353f76b1bad0eb2a3e0fa17e474c --- gnu/machine/ssh.scm | 8 ++------ gnu/system/boot.scm | 13 +++++++++++++ guix/scripts/system.scm | 8 +++----- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/gnu/machine/ssh.scm b/gnu/machine/ssh.scm index 449b65dbfb..fe47474470 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -459,15 +459,11 @@ (define (machine-boot-parameters machine) (let* ((params (call-with-input-string serialized-params read-boot-parameters)) (root (boot-parameters-root-device params)) - (label (boot-parameters-label params)) + (text (boot-parameters-label params)) (version (boot-parameters-version params))) (boot-parameters (inherit params) - (label - (string-append label " (#" - (number->string generation) ", " - (epoch->date-string epoch) - ")")) + (label (decorated-boot-label text generation epoch)) (kernel-arguments (append (bootable-kernel-arguments system-path root ver= sion) (boot-parameters-kernel-arguments params)))))))= ) diff --git a/gnu/system/boot.scm b/gnu/system/boot.scm index 972f83febc..b39e7d8610 100644 --- a/gnu/system/boot.scm +++ b/gnu/system/boot.scm @@ -71,6 +71,7 @@ (define-module (gnu system boot) read-boot-parameters-file =20 epoch->date-string + decorated-boot-label boot-parameters->menu-entry =20 ensure-not-/dev @@ -282,6 +283,18 @@ (define (epoch->date-string epoch) (date->string (time-utc->date time) "~Y-~m-~d ~H:~M"))) =20 +(define (decorated-boot-label text generation epoch) + "Return a string for a nice boot label that includes TEXT, a numbered GE= NERATION, +and a timestamp derived from EPOCH seconds." + (let* ((numbered (lambda (number) (string-append "#" (number->string num= ber)))) + (count (and=3D> generation numbered)) + (timestamp (and=3D> epoch epoch->date-string)) + (extras (filter identity (list count timestamp))) + (helpful (if (null? extras) + "" + (string-append "(" (string-join extras ", ") ")")))) + (string-join (list text helpful)))) + (define (boot-parameters->menu-entry conf) "Return a instance given CONF, a instance= ." (let* ((kernel (boot-parameters-kernel conf)) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 47c072ba5c..09d29dbbb1 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -332,12 +332,10 @@ (define* (profile-boot-parameters #:optional (profile= %system-profile) (define (system->boot-parameters system number epoch) (unless-file-not-found (let* ((params (read-boot-parameters-file system)) - (label (boot-parameters-label params))) + (text (boot-parameters-label params))) (boot-parameters - (inherit params) - (label (string-append label " (#" - (number->string number) ", " - (epoch->date-string epoch) ")")))))) + (inherit params) + (label (decorated-boot-label text number epoch)))))) (let* ((systems (map (cut generation-file-name profile <>) numbers)) (times (map (lambda (system) --=20 2.41.0