unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#43101] [PATCH] Add version number in release ISO
@ 2020-08-29 13:44 Julien Lepiller
  2020-08-30 13:47 ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Julien Lepiller @ 2020-08-29 13:44 UTC (permalink / raw)
  To: 43101

[-- Attachment #1: Type: text/plain, Size: 445 bytes --]

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.

[-- Attachment #2: 0001-guix-system-Add-label-option.patch --]
[-- Type: text/x-patch, Size: 4821 bytes --]

From a6d4cb90825b9e45c0baeaeaa653c57a9100b21a Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
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


[-- Attachment #3: 0002-Makefile.am-Set-iso-label.patch --]
[-- Type: text/x-patch, Size: 801 bytes --]

From cd47229d93b6dd0d7a793230e6a103a40034f6a7 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH] Add version number in release ISO
  2020-08-29 13:44 [bug#43101] [PATCH] Add version number in release ISO Julien Lepiller
@ 2020-08-30 13:47 ` Ludovic Courtès
  2020-08-30 14:35   ` Julien Lepiller
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2020-08-30 13:47 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 43101

Hi,

Julien Lepiller <julien@lepiller.eu> skribis:

> 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

Good idea.

>>From a6d4cb90825b9e45c0baeaeaa653c57a9100b21a Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> 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'.

Please describe the other changes (to ‘system-derivation-for-action’,
etc.)

> +        (partitions (match (image-partitions base-image)
> +                      ((boot others ...)
> +                       (cons
> +                         ((@ (gnu image) partition)
> +                           (inherit boot)
> +                           (label (or label (partition-label boot))))

Please include (gnu image) and avoid ‘@’.

> +  (display (G_ "
> +      --label=LABEL      for 'disk-image', label disk image with LABEL"))

Make sure to add it to doc/guix.texi as well.

>>From cd47229d93b6dd0d7a793230e6a103a40034f6a7 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> 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.

LGTM.

Thank you!  :-)

Ludo’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH] Add version number in release ISO
  2020-08-30 13:47 ` Ludovic Courtès
@ 2020-08-30 14:35   ` Julien Lepiller
  2020-08-30 15:05     ` Mathieu Othacehe
  0 siblings, 1 reply; 11+ messages in thread
From: Julien Lepiller @ 2020-08-30 14:35 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 43101



Le 30 août 2020 09:47:04 GMT-04:00, "Ludovic Courtès" <ludo@gnu.org> a écrit :
>Hi,
>
>Julien Lepiller <julien@lepiller.eu> skribis:
>
>> 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
>
>Good idea.
>
>>>From a6d4cb90825b9e45c0baeaeaa653c57a9100b21a Mon Sep 17 00:00:00
>2001
>> From: Julien Lepiller <julien@lepiller.eu>
>> 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'.
>
>Please describe the other changes (to ‘system-derivation-for-action’,
>etc.)
>
>> +        (partitions (match (image-partitions base-image)
>> +                      ((boot others ...)
>> +                       (cons
>> +                         ((@ (gnu image) partition)
>> +                           (inherit boot)
>> +                           (label (or label (partition-label
>boot))))
>
>Please include (gnu image) and avoid ‘@’.

(gnu image) is already imported, but conflicts with another module for partition, leading to a compilation error. What should I do?

>
>> +  (display (G_ "
>> +      --label=LABEL      for 'disk-image', label disk image with
>LABEL"))
>
>Make sure to add it to doc/guix.texi as well.
>
>>>From cd47229d93b6dd0d7a793230e6a103a40034f6a7 Mon Sep 17 00:00:00
>2001
>> From: Julien Lepiller <julien@lepiller.eu>
>> 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.
>
>LGTM.

I'll add the architecture in there too, as per discussion in the osinfo-db MR.

>
>Thank you!  :-)
>
>Ludo’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH] Add version number in release ISO
  2020-08-30 14:35   ` Julien Lepiller
@ 2020-08-30 15:05     ` Mathieu Othacehe
  2020-08-30 15:11       ` Julien Lepiller
  0 siblings, 1 reply; 11+ messages in thread
From: Mathieu Othacehe @ 2020-08-30 15:05 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: Ludovic Courtès, 43101


Hello Julien,

Thanks for this patch!

>>Please include (gnu image) and avoid ‘@’.
>
> (gnu image) is already imported, but conflicts with another module for partition, leading to a compilation error. What should I do?

You can maybe write something like:

--8<---------------cut here---------------start------------->8---
#:use-module ((srfi srfi-1) #:hide (partition))
--8<---------------cut here---------------end--------------->8---

> I'll add the architecture in there too, as per discussion in the osinfo-db MR.

Do you think it could be useful to add the same mechanism to ISO images
built by the CI? In that case, you could maybe use the same mechanism in
(gnu ci) and label the boot partition with %guix-version?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH] Add version number in release ISO
  2020-08-30 15:05     ` Mathieu Othacehe
@ 2020-08-30 15:11       ` Julien Lepiller
  2020-08-30 19:52         ` [bug#43101] [PATCH v2] " Julien Lepiller
  0 siblings, 1 reply; 11+ messages in thread
From: Julien Lepiller @ 2020-08-30 15:11 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 43101

[-- Attachment #1: Type: text/plain, Size: 952 bytes --]

Yes, it makes sense! I'll send a patch for that too. Thank you!

Le 30 août 2020 11:05:27 GMT-04:00, Mathieu Othacehe <othacehe@gnu.org> a écrit :
>
>Hello Julien,
>
>Thanks for this patch!
>
>>>Please include (gnu image) and avoid ‘@’.
>>
>> (gnu image) is already imported, but conflicts with another module
>for partition, leading to a compilation error. What should I do?
>
>You can maybe write something like:
>
>--8<---------------cut here---------------start------------->8---
>#:use-module ((srfi srfi-1) #:hide (partition))
>--8<---------------cut here---------------end--------------->8---
>
>> I'll add the architecture in there too, as per discussion in the
>osinfo-db MR.
>
>Do you think it could be useful to add the same mechanism to ISO images
>built by the CI? In that case, you could maybe use the same mechanism
>in
>(gnu ci) and label the boot partition with %guix-version?
>
>Thanks,
>
>Mathieu

[-- Attachment #2: Type: text/html, Size: 1617 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH v2] Add version number in release ISO
  2020-08-30 15:11       ` Julien Lepiller
@ 2020-08-30 19:52         ` Julien Lepiller
  2020-08-31  6:18           ` Mathieu Othacehe
  2020-08-31 12:12           ` Ludovic Courtès
  0 siblings, 2 replies; 11+ messages in thread
From: Julien Lepiller @ 2020-08-30 19:52 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Ludovic Courtès, 43101

[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]

Here's v2 of the patch series. I've added one patch to (gnu ci) to set
the version number in generated ISOs, and fixed other issues in the
previous version of the patches.

Le Sun, 30 Aug 2020 11:11:08 -0400,
Julien Lepiller <julien@lepiller.eu> a écrit :

> Yes, it makes sense! I'll send a patch for that too. Thank you!
> 
> Le 30 août 2020 11:05:27 GMT-04:00, Mathieu Othacehe
> <othacehe@gnu.org> a écrit :
> >
> >Hello Julien,
> >
> >Thanks for this patch!
> >  
> >>>Please include (gnu image) and avoid ‘@’.  
> >>
> >> (gnu image) is already imported, but conflicts with another module
> >>  
> >for partition, leading to a compilation error. What should I do?
> >
> >You can maybe write something like:
> >
> >--8<---------------cut here---------------start------------->8---
> >#:use-module ((srfi srfi-1) #:hide (partition))
> >--8<---------------cut here---------------end--------------->8---
> >  
> >> I'll add the architecture in there too, as per discussion in the  
> >osinfo-db MR.
> >
> >Do you think it could be useful to add the same mechanism to ISO
> >images built by the CI? In that case, you could maybe use the same
> >mechanism in
> >(gnu ci) and label the boot partition with %guix-version?
> >
> >Thanks,
> >
> >Mathieu  


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-guix-system-Add-label-option.patch --]
[-- Type: text/x-patch, Size: 6502 bytes --]

From a502fa70b0230d3f91ddf05410f24a1f4fcad521 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sat, 29 Aug 2020 15:34:56 +0200
Subject: [PATCH 1/3] guix: system: Add `--label' option.

* guix/scripts/system.scm (%options): Add `--label'.
(system-derivation-for-action): Take a #:label key to set volume ID.
(perform-action): Take a #:label key.
(%default-options): Add default label value.
(process-action): Pass label value from command-line to perform-action.
---
 doc/guix.texi           |  4 +++-
 guix/scripts/system.scm | 27 ++++++++++++++++++++++-----
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 6206a93857..56b1cd8976 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -28836,7 +28836,9 @@ the @option{--image-size} option is ignored in the case of
 @code{docker-image}.
 
 You can specify the root file system type by using the
-@option{--file-system-type} option.  It defaults to @code{ext4}.
+@option{--file-system-type} option.  It defaults to @code{ext4}.  When its
+value is @code{iso9660}, the @option{--label} option can be used to specify
+a volume ID with @code{disk-image}.
 
 When using @code{vm-image}, the returned image is in qcow2 format, which
 the QEMU emulator can efficiently use. @xref{Running Guix in a VM},
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index f6d20382b6..33f4c8e4e8 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -6,6 +6,7 @@
 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2019 Christopher Baines <mail@cbaines.net>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
+;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -67,7 +68,7 @@
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:use-module (gnu services herd)
-  #:use-module (srfi srfi-1)
+  #:use-module ((srfi srfi-1) #:hide (partition))
   #:use-module (srfi srfi-11)
   #:use-module (srfi srfi-19)
   #:use-module (srfi srfi-26)
@@ -662,7 +663,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 +689,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
+                         (partition
+                           (inherit boot)
+                           (label (or label (partition-label boot))))
+                         others))))))))
     ((docker-image)
      (system-docker-image os #:shared-network? container-shared-network?))))
 
@@ -741,7 +749,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 +803,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 +951,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 +1019,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 +1079,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 +1134,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 +1185,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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-ci-Set-label-in-iso9660-jobs.patch --]
[-- Type: text/x-patch, Size: 1988 bytes --]

From d98a5b9d36a74d47348a5a838209993f6b2539e0 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sun, 30 Aug 2020 20:43:42 +0200
Subject: [PATCH 2/3] gnu: ci: Set label in iso9660 jobs.

* gnu/ci.scm (image-jobs): Set label of generated ISOs.
---
 gnu/ci.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/ci.scm b/gnu/ci.scm
index af0bb66775..c15baa99d3 100644
--- a/gnu/ci.scm
+++ b/gnu/ci.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018, 2019 Clément Lassieur <clement@lassieur.org>
+;;; Copyright © 2020 Julien Lepiller <julien@lepiller.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,6 +26,7 @@
   #:use-module (guix profiles)
   #:use-module (guix packages)
   #:use-module (guix channels)
+  #:use-module (guix config)
   #:use-module (guix derivations)
   #:use-module (guix build-system)
   #:use-module (guix monads)
@@ -234,7 +236,15 @@ system.")
                 (build-image
                  (image
                   (inherit iso9660-image)
-                  (operating-system installation-os))))
+                  (operating-system installation-os)
+                  (partitions (match (image-partitions iso9660-image)
+                                ((boot others ...)
+                                 (cons
+                                   (partition
+                                     (inherit boot)
+                                     (label (string-append "GUIX_" system "_"
+                                                           %guix-version)))
+                                   others)))))))
         ;; Only cross-compile Guix System images from x86_64-linux for now.
         ,@(if (string=? system "x86_64-linux")
               (map (lambda (image)
-- 
2.28.0


[-- Attachment #4: 0003-Makefile.am-Set-iso-label.patch --]
[-- Type: text/x-patch, Size: 806 bytes --]

From 2e8ca2e8ece588932d00d1bc12182e9a9a7f53e3 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sat, 29 Aug 2020 15:36:40 +0200
Subject: [PATCH 3/3] 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 4c10bd37bc..063556c7ac 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -834,6 +834,7 @@ release: dist-with-updated-version
 	  image=`$(top_builddir)/pre-inst-env						\
 	    guix system disk-image							\
 	    --file-system-type=iso9660							\
+	    --label="GUIX_$${system}_$(VERSION)"						\
             --system=$$system --fallback						\
 	    gnu/system/install.scm` ;							\
 	  if [ ! -f "$$image" ] ; then							\
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH v2] Add version number in release ISO
  2020-08-30 19:52         ` [bug#43101] [PATCH v2] " Julien Lepiller
@ 2020-08-31  6:18           ` Mathieu Othacehe
  2020-08-31 14:13             ` bug#43101: " Julien Lepiller
  2020-08-31 12:12           ` Ludovic Courtès
  1 sibling, 1 reply; 11+ messages in thread
From: Mathieu Othacehe @ 2020-08-31  6:18 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: Ludovic Courtès, 43101


Hey Julien,

Thanks for the v2 :)

>                    (inherit iso9660-image)
> -                  (operating-system installation-os))))
> +                  (operating-system installation-os)
> +                  (partitions (match (image-partitions iso9660-image)
> +                                ((boot others ...)
> +                                 (cons
> +                                   (partition
> +                                     (inherit boot)
> +                                     (label (string-append "GUIX_" system "_"
> +                                                           %guix-version)))
> +                                   others)))))))

We could maybe factorize this in something like:

--8<---------------cut here---------------start------------->8---
(define (image-with-label image label)
...)
--8<---------------cut here---------------end--------------->8---

that would be put in (gnu system image).

Otherwise, looks fine to me :)

Thanks again,

Mathieu




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH v2] Add version number in release ISO
  2020-08-30 19:52         ` [bug#43101] [PATCH v2] " Julien Lepiller
  2020-08-31  6:18           ` Mathieu Othacehe
@ 2020-08-31 12:12           ` Ludovic Courtès
  1 sibling, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2020-08-31 12:12 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: Mathieu Othacehe, 43101

Hi!

Julien Lepiller <julien@lepiller.eu> skribis:

> From a502fa70b0230d3f91ddf05410f24a1f4fcad521 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Sat, 29 Aug 2020 15:34:56 +0200
> Subject: [PATCH 1/3] guix: system: Add `--label' option.
>
> * guix/scripts/system.scm (%options): Add `--label'.
> (system-derivation-for-action): Take a #:label key to set volume ID.
> (perform-action): Take a #:label key.
> (%default-options): Add default label value.
> (process-action): Pass label value from command-line to perform-action.
> ---
>  doc/guix.texi           |  4 +++-
>  guix/scripts/system.scm | 27 ++++++++++++++++++++++-----

Please mention the doc/guix.texi changes as well in the log.  :-)

> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -28836,7 +28836,9 @@ the @option{--image-size} option is ignored in the case of
>  @code{docker-image}.
>  
>  You can specify the root file system type by using the
> -@option{--file-system-type} option.  It defaults to @code{ext4}.
> +@option{--file-system-type} option.  It defaults to @code{ext4}.  When its
> +value is @code{iso9660}, the @option{--label} option can be used to specify
> +a volume ID with @code{disk-image}.

Could you also add an @item for --label, just like we have for the other
options?

I’m also fine with what Mathieu suggests.

OK for me with changes along these lines!

Thank you,
Ludo’.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#43101: [PATCH v2] Add version number in release ISO
  2020-08-31  6:18           ` Mathieu Othacehe
@ 2020-08-31 14:13             ` Julien Lepiller
  2020-09-03 11:10               ` [bug#43101] " Mathieu Othacehe
  0 siblings, 1 reply; 11+ messages in thread
From: Julien Lepiller @ 2020-08-31 14:13 UTC (permalink / raw)
  To: 43101-done

Le Mon, 31 Aug 2020 08:18:44 +0200,
Mathieu Othacehe <othacehe@gnu.org> a écrit :

> Hey Julien,
> 
> Thanks for the v2 :)
> 
> >                    (inherit iso9660-image)
> > -                  (operating-system installation-os))))
> > +                  (operating-system installation-os)
> > +                  (partitions (match (image-partitions
> > iso9660-image)
> > +                                ((boot others ...)
> > +                                 (cons
> > +                                   (partition
> > +                                     (inherit boot)
> > +                                     (label (string-append "GUIX_"
> > system "_"
> > +
> > %guix-version)))
> > +                                   others)))))))  
> 
> We could maybe factorize this in something like:
> 
> --8<---------------cut here---------------start------------->8---
> (define (image-with-label image label)
> ...)
> --8<---------------cut here---------------end--------------->8---
> 
> that would be put in (gnu system image).
> 
> Otherwise, looks fine to me :)
> 
> Thanks again,
> 
> Mathieu

Pushed as 036f23f053ee6bd34c6d387debb4a9166561dd02 to
7b2ac4768721ccab1782daad99a7cb1be0ed01ee, thank you!




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH v2] Add version number in release ISO
  2020-08-31 14:13             ` bug#43101: " Julien Lepiller
@ 2020-09-03 11:10               ` Mathieu Othacehe
  2020-09-03 12:10                 ` Julien Lepiller
  0 siblings, 1 reply; 11+ messages in thread
From: Mathieu Othacehe @ 2020-09-03 11:10 UTC (permalink / raw)
  To: 43101; +Cc: julien


Hello Julien,

> Pushed as 036f23f053ee6bd34c6d387debb4a9166561dd02 to
> 7b2ac4768721ccab1782daad99a7cb1be0ed01ee, thank you!

It seems that the new ISO labels are hitting a 32 characters limit, see:
https://ci.guix.gnu.org/log/alcb138l3gk5hzb0s2idgbkx5kg9n1ja-iso9660-image.

I would propose to truncate the commit hash to 7 characters. Could you
have a look?

Thanks,

Mathieu




^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#43101] [PATCH v2] Add version number in release ISO
  2020-09-03 11:10               ` [bug#43101] " Mathieu Othacehe
@ 2020-09-03 12:10                 ` Julien Lepiller
  0 siblings, 0 replies; 11+ messages in thread
From: Julien Lepiller @ 2020-09-03 12:10 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 43101

Le Thu, 03 Sep 2020 13:10:34 +0200,
Mathieu Othacehe <othacehe@gnu.org> a écrit :

> Hello Julien,
> 
> > Pushed as 036f23f053ee6bd34c6d387debb4a9166561dd02 to
> > 7b2ac4768721ccab1782daad99a7cb1be0ed01ee, thank you!  
> 
> It seems that the new ISO labels are hitting a 32 characters limit,
> see:
> https://ci.guix.gnu.org/log/alcb138l3gk5hzb0s2idgbkx5kg9n1ja-iso9660-image.
> 
> I would propose to truncate the commit hash to 7 characters. Could you
> have a look?
> 
> Thanks,
> 
> Mathieu

Thanks for the heads up, I pushed another commit to reduce the number
of characters as 7596ae1034a6878ecbe9e65a642a1434a78b1cf0




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-09-03 12:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-29 13:44 [bug#43101] [PATCH] Add version number in release ISO Julien Lepiller
2020-08-30 13:47 ` Ludovic Courtès
2020-08-30 14:35   ` Julien Lepiller
2020-08-30 15:05     ` Mathieu Othacehe
2020-08-30 15:11       ` Julien Lepiller
2020-08-30 19:52         ` [bug#43101] [PATCH v2] " Julien Lepiller
2020-08-31  6:18           ` Mathieu Othacehe
2020-08-31 14:13             ` bug#43101: " Julien Lepiller
2020-09-03 11:10               ` [bug#43101] " Mathieu Othacehe
2020-09-03 12:10                 ` Julien Lepiller
2020-08-31 12:12           ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).