From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 29 09:45:04 2020 Received: (at submit) by debbugs.gnu.org; 29 Aug 2020 13:45:04 +0000 Received: from localhost ([127.0.0.1]:48056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kC1AG-0008DQ-5F for submit@debbugs.gnu.org; Sat, 29 Aug 2020 09:45:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:52928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kC1AE-0008DH-Ip for submit@debbugs.gnu.org; Sat, 29 Aug 2020 09:45:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kC1AD-0003Tw-Cw for guix-patches@gnu.org; Sat, 29 Aug 2020 09:45:01 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:34564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kC1AA-0002E3-Q9 for guix-patches@gnu.org; Sat, 29 Aug 2020 09:45:01 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 922173ad for ; Sat, 29 Aug 2020 13:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=H0t a9oQDZwALu7CDSND63hCo6JdCjS66mSqG5xLckIE=; b=iUBFmWxsOx72unm6pZL 1LAvKaEd7WR1nrixBTKW+Fz4p5OwUUn+pIwVagW591hDgb1W/f2K0IK4FOlcQ3GY QmsFn7JxzMFt4ajEBip3OMm4S2eQpd+2MK/v70mAHqYlFwm/5eSgQP283DBbZwEb 8ej26s2H46fLsIlIV9GRHad9NnTZ8sTy2B0AgzNAc0IPJl7crzEGFZPsdBQKiBrq keQJCzjfhVOuqF1qIDXwJtGp08xlbNq1L3YGdoZXNgwOczJEJVdehAEq1KysILuw Fq7LUJV8nypYs00JGWYNpjJPunpcAxVBqEuCtpmyC3aXH78tRRzWjYp6yIFoO9TE 5HQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 94532f2b (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Sat, 29 Aug 2020 13:44:52 +0000 (UTC) Date: Sat, 29 Aug 2020 15:44:45 +0200 From: Julien Lepiller To: guix-patches@gnu.org Subject: [PATCH] Add version number in release ISO Message-ID: <20200829154445.5512d99a@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/P3HHZ==llbC0YlgTya0gJ34" Received-SPF: none client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --MP_/P3HHZ==llbC0YlgTya0gJ34 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, I've recently proposed a patch to libosinfo database, and they suggested that we add the version number to the ISO label, so the tool can differentiate and identify the ISOs. See https://gitlab.com/libosinfo/osinfo-db/-/merge_requests/202 The first patch adds the --label option to guix system, and it sets the label for the boot partition. The second patch simply uses it and adds a --label option to the release target in the Makefile. --MP_/P3HHZ==llbC0YlgTya0gJ34 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-guix-system-Add-label-option.patch From a6d4cb90825b9e45c0baeaeaa653c57a9100b21a Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 29 Aug 2020 15:34:56 +0200 Subject: [PATCH 1/2] guix: system: Add `--label' option. * guix/scripts/system.scm (%options): Add `--label'. --- guix/scripts/system.scm | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index f6d20382b6..c9cee2e2a2 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -662,7 +662,7 @@ checking this by themselves in their 'check' procedure." (define* (system-derivation-for-action os base-image action #:key image-size file-system-type full-boot? container-shared-network? - mappings) + mappings label) "Return as a monadic value the derivation for OS according to ACTION." (case action ((build init reconfigure) @@ -688,7 +688,14 @@ checking this by themselves in their 'check' procedure." (image (inherit base-image) (size image-size) - (operating-system os))))) + (operating-system os) + (partitions (match (image-partitions base-image) + ((boot others ...) + (cons + ((@ (gnu image) partition) + (inherit boot) + (label (or label (partition-label boot)))) + others)))))))) ((docker-image) (system-docker-image os #:shared-network? container-shared-network?)))) @@ -741,7 +748,7 @@ and TARGET arguments." install-bootloader? dry-run? derivations-only? use-substitutes? bootloader-target target - image-size file-system-type full-boot? + image-size file-system-type full-boot? label container-shared-network? (mappings '()) (gc-root #f)) @@ -795,6 +802,7 @@ static checks." ((target* (current-target-system)) (image -> (find-image file-system-type target*)) (sys (system-derivation-for-action os image action + #:label label #:file-system-type file-system-type #:image-size image-size #:full-boot? full-boot? @@ -942,6 +950,8 @@ Some ACTIONS support additional ARGS.\n")) --image-size=SIZE for 'vm-image', produce an image of SIZE")) (display (G_ " --no-bootloader for 'init', do not install a bootloader")) + (display (G_ " + --label=LABEL for 'disk-image', label disk image with LABEL")) (display (G_ " --save-provenance save provenance information")) (display (G_ " @@ -1008,6 +1018,9 @@ Some ACTIONS support additional ARGS.\n")) (option '("no-bootloader" "no-grub") #f #f (lambda (opt name arg result) (alist-cons 'install-bootloader? #f result))) + (option '("label") #t #f + (lambda (opt name arg result) + (alist-cons 'label arg result))) (option '("full-boot") #f #f (lambda (opt name arg result) (alist-cons 'full-boot? #t result))) @@ -1065,7 +1078,8 @@ Some ACTIONS support additional ARGS.\n")) (validate-reconfigure . ,ensure-forward-reconfigure) (file-system-type . "ext4") (image-size . guess) - (install-bootloader? . #t))) + (install-bootloader? . #t) + (label . #f))) (define (verbosity-level opts) "Return the verbosity level based on OPTS, the alist of parsed options." @@ -1119,6 +1133,7 @@ resulting from command-line parsing." (dry? (assoc-ref opts 'dry-run?)) (bootloader? (assoc-ref opts 'install-bootloader?)) + (label (assoc-ref opts 'label)) (target-file (match args ((first second) second) (_ #f))) @@ -1169,6 +1184,7 @@ resulting from command-line parsing." (_ #f)) opts) #:install-bootloader? bootloader? + #:label label #:target target-file #:bootloader-target bootloader-target #:gc-root (assoc-ref opts 'gc-root))))) -- 2.28.0 --MP_/P3HHZ==llbC0YlgTya0gJ34 Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-Makefile.am-Set-iso-label.patch From cd47229d93b6dd0d7a793230e6a103a40034f6a7 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Sat, 29 Aug 2020 15:36:40 +0200 Subject: [PATCH 2/2] Makefile.am: Set iso label. * Makefile.am (release): Add version number in disk image label. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 9c38c2f83c..7a658d157b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -838,6 +838,7 @@ release: dist-with-updated-version image=`$(top_builddir)/pre-inst-env \ guix system disk-image \ --file-system-type=iso9660 \ + --label="GUIX_IMAGE_$(VERSION)" \ --system=$$system --fallback \ gnu/system/install.scm` ; \ if [ ! -f "$$image" ] ; then \ -- 2.28.0 --MP_/P3HHZ==llbC0YlgTya0gJ34--