From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id CKmUGar37GasSQAA62LTzQ:P1 (envelope-from ) for ; Fri, 20 Sep 2024 04:18:50 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id CKmUGar37GasSQAA62LTzQ (envelope-from ) for ; Fri, 20 Sep 2024 06:18:50 +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=BK4pvX5V; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail3 header.b=j8pFk7Un; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail3 header.b="i6eEhq/b"; 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=1726805930; 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=THcAq8t8oXrBea0PUfva4NVotH+M6T/0nB34dP5viQE=; b=q5TbWAWsA36hIxU77LA69jT/Vdh6q4uWhhiz/GkYzQ/VDTmqqzOnCcqzHVTiORAQzzrGzi IA7U2uWJiEpVIO+0R/dekxDC+4i1nVNHc50Yam7jQrVLDELurjVzaJm2ki8DR87ROkN6aL zeuA6Jjjo412ju2uOtAn4OqOgYmkPUj+Z4xTneSA78iKSWsWsdwK2ZrJfSTX0t2CAD8Nvk oYPcB3vNuJZED3ah1Jn9BYngRJDGSYJtO3YYhKJTc57xlQaiLhn+N+MkUvuaiZ237I1uC1 duX9bdXQgiBGxI9G5JhrB/bip6l1hJ5hAVmMKpzvYxlWZKWTehljXpvBul2QHA== 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=BK4pvX5V; dkim=fail ("headers rsa verify failed") header.d=lunabee.space header.s=purelymail3 header.b=j8pFk7Un; dkim=fail ("headers rsa verify failed") header.d=purelymail.com header.s=purelymail3 header.b="i6eEhq/b"; 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=1726805930; a=rsa-sha256; cv=none; b=lzOO2D1ajxQEHwsURkI1qZ03iGMAIcV9UkoHlijlIGVRR1QYNDsJOp07wWyRWlfxtnz1Jj 2zhz3r/b4hUcHI3L9OQsnE/gESo4QrHck/bGAkXeGesm+elE+GilnOjaPGWR5QVHLUSUD5 7/qEX2qr929z0rIRwKUB2ItfyexrqAS5U9iBBErBwRCDJPx1DQk5vmw9VQDtxUGXqXO31K Qlc+tw+naRViwalNyFRUFs5iDt273NiZbwwRa2K7355tXJ8e+LUfln4BL94u3CzN2HQjLj rm4BfEk1o0YEX6hKKEEC4F9YI+Vws05xuoj4KZVriQEpmzDfZ54iL3RpWQRbBA== 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 3BE767CFBD for ; Fri, 20 Sep 2024 06:18:50 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1srV5d-0008DE-Rq; Fri, 20 Sep 2024 00:17:53 -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 1srV5X-0008BI-MN for guix-patches@gnu.org; Fri, 20 Sep 2024 00:17:48 -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 1srV5X-0006Fi-Cv; Fri, 20 Sep 2024 00:17:47 -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=THcAq8t8oXrBea0PUfva4NVotH+M6T/0nB34dP5viQE=; b=BK4pvX5VcNl17RATegG4qe0NVJPqwx/kn1BTwGhS1KPBT/gbyx9TKBlwoG4i4SJp7F3Ywu5fAdkHEKRCaMQx+Mn0alN8xMr4Sn+T5AS6ESaJL6Oj00DnYTSwbCKS8x8xuY1Rv+0/D9bYTFSFLhWNG9KDVoX2CwsPMMcPFWY9qln83TtpYEtGz85vB/3girP4tRPpHobd6DcD3WZuhGXqHtkAHQ6vKsI8T8+064ap1Nki30AfQBdN69GiLfsQuQWWu+AGxa3G/oe6swAid+K7X9mTWqQz2P9yphK6rcLHTn7xcG88VCaX85O6cXds/yaYrN1vUTXB++iXtQgKwDX9EQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1srV5o-0005To-VT; Fri, 20 Sep 2024 00:18:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69343] [PATCH v4 05/11] 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, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Fri, 20 Sep 2024 04:18: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: 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.172680586820932 (code B ref 69343); Fri, 20 Sep 2024 04:18:04 +0000 Received: (at 69343) by debbugs.gnu.org; 20 Sep 2024 04:17:48 +0000 Received: from localhost ([127.0.0.1]:33746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5X-0005RT-Vu for submit@debbugs.gnu.org; Fri, 20 Sep 2024 00:17:48 -0400 Received: from sendmail.purelymail.com ([34.202.193.197]:51946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1srV5S-0005QZ-Iy for 69343@debbugs.gnu.org; Fri, 20 Sep 2024 00:17:43 -0400 DKIM-Signature: a=rsa-sha256; b=j8pFk7UnVdJi9iShP3cXbSDFylTTvL48ob2hYvrR4z+XTbx6Zy/KHrTSZILGZEY5NVFd6ESINsb1lO/V/lvF0/cPCH8luFEwHySppo6cktjg5RywzJrRqsom5577wwpBrh7cBurZfxs5ZmSU2meJOm/KuSVY+GlVpE4z/v2hWvQRFb8i62X0F6iRJ63DCUNqkTfg/AnDNIxD+tCw/Y8WNDbiE8LOpaWC5zr6PGNlvAuZY+OWVag5RlbAZy99ZlAQgFEPY8Btvd0+u5tMmYZ8U8apgM+tqwa8C2VNSQR4Y41wr0D5KM6V5zf6zuTqUvoAO4yo9DKik3/8QUxsIWYgcg==; s=purelymail3; d=lunabee.space; v=1; bh=NOK0PWiSFHSzFTSi+M9ZXWQ8KB3bs8kYvKUPY7tzJ48=; h=Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=i6eEhq/b1nSjPtmBtgky8f+ZQXPaIVlhemKp5HTnxtv+yP/8XuBMEFfejKggrpdbiliqlOjccNOIICUGqW2115YRRjciPoQoCfco4vs3BfoF6KBwEIFhe/8HtkN5B17SNEh3Xs9n/CGMH7ar0m3sE1zQZtTuGV13tYB9RFV01MSJstgYkmHRYlWHS+bqbX82Yp+oSRSDwfLYHxoYc6yGTVKaRe5qHFsCbOvUa6SxcEU3yzKfn3pdQ5EI2mR9oPtTuA/c0uJTmJII8ncirQZ9keMOzVvWP3lCHYkpNyZL7iYNyMIX0wTxpR0E42ilRp6fyhRiOvyH224ZfvWM0hnyDA==; s=purelymail3; d=purelymail.com; v=1; bh=NOK0PWiSFHSzFTSi+M9ZXWQ8KB3bs8kYvKUPY7tzJ48=; 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:15:59 -0500 Message-ID: <8715f3e79e6b1dff09eb2c4c04d23af14b1247ba.1726805765.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-Queue-Id: 3BE767CFBD X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -5.51 X-Migadu-Spam-Score: -5.51 X-TUID: /Yjg6f5WAPM4 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 e68e64527e..3971469e33 100644 --- a/gnu/machine/ssh.scm +++ b/gnu/machine/ssh.scm @@ -457,15 +457,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 01e3a965e4..82ca353cb3 100644 --- a/gnu/system/boot.scm +++ b/gnu/system/boot.scm @@ -72,6 +72,7 @@ (define-module (gnu system boot) bootable-kernel-arguments =20 epoch->date-string + decorated-boot-label boot-parameters->menu-entry =20 ensure-not-/dev @@ -304,6 +305,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 +GENERATION, and a timestamp derived from EPOCH seconds." + (let* ((numbered (lambda (num) (string-append "#" (number->string num)))= ) + (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 b197812e63..84eb99b938 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -337,12 +337,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.45.2