diff mbox series

[bug#40514] vm: Transparently compress iso9660 images.

Message ID 20200408210132.23612-1-me@tobias.gr
State Accepted
Headers show
Series [bug#40514] vm: Transparently compress iso9660 images. | expand

Checks

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

Commit Message

guix--- via Guix-patches via April 8, 2020, 9:01 p.m. UTC
* gnu/build/vm.scm (make-iso9660-image): Use the ‘--zisofs’ xorriso
filter at the highest compression settings for supported directories.
---
 gnu/build/vm.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Danny Milosavljevic April 9, 2020, 9:34 p.m. UTC | #1
Hi T G-R,

On Wed,  8 Apr 2020 23:01:32 +0200
Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org> wrote:

> * gnu/build/vm.scm (make-iso9660-image): Use the ‘--zisofs’ xorriso
> filter at the highest compression settings for supported directories.
> ---
>  gnu/build/vm.scm | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
> index 79eed48c1f..972eb4bdf9 100644
> --- a/gnu/build/vm.scm
> +++ b/gnu/build/vm.scm
> @@ -533,6 +533,24 @@ GRUB configuration and OS-DRV as the stuff in it."
>                  ;; Set all timestamps to 1.
>                  "-volume_date" "all_file_dates" "=1"
>  
> +                ;; ‘zisofs’ compression reduces the total image size by ~60%.
> +                "-zisofs" "level=9:block_size=128k" ; highest compression
> +                ;; It's transparent to our Linux-Libre kernel but not to GRUB.
> +                ;; Don't compress the kernel, initrd, and other files read by
> +                ;; grub.cfg, as well as common already-compressed file names.
> +                "-find" "/" "-type" "f"
> +                ;; XXX Even after "--" above, and despite documentation claiming
> +                ;; otherwise, "-or" is stolen by grub-mkrescue which then chokes
> +                ;; on it (as ‘-o …’) and dies.  Don't use "-or".
> +                "-not" "-wholename" "/boot/*"
> +                "-not" "-wholename" "/System/*"
> +                "-not" "-name" "unicode.pf2"
> +                "-not" "-name" "bzImage"
> +                "-not" "-name" "*.gz"   ; initrd & all man pages
> +                "-not" "-name" "*.png"  ; includes grub-image.png
> +                "-exec" "set_filter" "--zisofs"
> +                "--"
> +
>                  "-volid" (string-upcase volume-id)
>                  (if volume-uuid
>                      `("-volume_date" "uuid"

LGTM!

Tested it and it works, and I see no downside either.
guix--- via Guix-patches via April 10, 2020, 12:02 a.m. UTC | #2
Danny,

Danny Milosavljevic 写道:
> Tested it and it works

Thanks!  Pushed as 26c1bd9dfafb5a954d2174b7a000304cd7ae6345.

> and I see no downside either.

We can now fit a Gnome 3 desktop on an image the size of the 
previous installer.  I'm sure someone considers that a downside.

Kind regards,

T G-R
diff mbox series

Patch

diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm
index 79eed48c1f..972eb4bdf9 100644
--- a/gnu/build/vm.scm
+++ b/gnu/build/vm.scm
@@ -533,6 +533,24 @@  GRUB configuration and OS-DRV as the stuff in it."
                 ;; Set all timestamps to 1.
                 "-volume_date" "all_file_dates" "=1"
 
+                ;; ‘zisofs’ compression reduces the total image size by ~60%.
+                "-zisofs" "level=9:block_size=128k" ; highest compression
+                ;; It's transparent to our Linux-Libre kernel but not to GRUB.
+                ;; Don't compress the kernel, initrd, and other files read by
+                ;; grub.cfg, as well as common already-compressed file names.
+                "-find" "/" "-type" "f"
+                ;; XXX Even after "--" above, and despite documentation claiming
+                ;; otherwise, "-or" is stolen by grub-mkrescue which then chokes
+                ;; on it (as ‘-o …’) and dies.  Don't use "-or".
+                "-not" "-wholename" "/boot/*"
+                "-not" "-wholename" "/System/*"
+                "-not" "-name" "unicode.pf2"
+                "-not" "-name" "bzImage"
+                "-not" "-name" "*.gz"   ; initrd & all man pages
+                "-not" "-name" "*.png"  ; includes grub-image.png
+                "-exec" "set_filter" "--zisofs"
+                "--"
+
                 "-volid" (string-upcase volume-id)
                 (if volume-uuid
                     `("-volume_date" "uuid"