diff mbox series

[bug#43101,v2] Add version number in release ISO

Message ID 20200830215230.3dd526fd@tachikoma.lepiller.eu
State Accepted
Headers show
Series [bug#43101,v2] Add version number in release ISO | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Julien Lepiller Aug. 30, 2020, 7:52 p.m. UTC
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

Comments

Mathieu Othacehe Aug. 31, 2020, 6:18 a.m. UTC | #1
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
Ludovic Courtès Aug. 31, 2020, 12:12 p.m. UTC | #2
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’.
Julien Lepiller Aug. 31, 2020, 2:13 p.m. UTC | #3
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!
Mathieu Othacehe Sept. 3, 2020, 11:10 a.m. UTC | #4
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
Julien Lepiller Sept. 3, 2020, 12:10 p.m. UTC | #5
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
diff mbox series

Patch

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