summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-03-24 19:50:19 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-03-24 19:50:19 +0000
commit7847adb9b8723c79d4c529a6c350f5824b1b8ce5 (patch)
tree2ce4c2a25724d750b95ed3857751b2a802e8c579
parentb42dabf49dad9008dfef5f0d95f9d1c48ac269fb (diff)
downloaddrakiso-7847adb9b8723c79d4c529a6c350f5824b1b8ce5.tar
drakiso-7847adb9b8723c79d4c529a6c350f5824b1b8ce5.tar.gz
drakiso-7847adb9b8723c79d4c529a6c350f5824b1b8ce5.tar.bz2
drakiso-7847adb9b8723c79d4c529a6c350f5824b1b8ce5.tar.xz
drakiso-7847adb9b8723c79d4c529a6c350f5824b1b8ce5.zip
Allow user to select compression type/level for mksquashfs.
Default to zstd, level 18. This takes approximately the same time as using xz, but results in a squashfs image ~10% larger. The upside is the live system is much faster to boot and to open applications.
-rw-r--r--NEWS3
-rw-r--r--lib/MGA/DrakISO/BuildLoop.pm9
2 files changed, 10 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 21e3781..314790d 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- allow user to select compression type/level for mksquashfs
+ - default to zstd, level 18
+
1.13
- bootloader: in grub 2.04 linux16/linuxefi are included in linux module
diff --git a/lib/MGA/DrakISO/BuildLoop.pm b/lib/MGA/DrakISO/BuildLoop.pm
index ebaef11..d47b6e9 100644
--- a/lib/MGA/DrakISO/BuildLoop.pm
+++ b/lib/MGA/DrakISO/BuildLoop.pm
@@ -1,6 +1,6 @@
# Copyright (C) 2005 Mandriva
# Olivier Blin <oblin@mandriva.com>
-# Copyright (C) 2017-2018 Mageia
+# Copyright (C) 2017-2020 Mageia
# Martin Whitaker <mageia@martin-whitaker.me.uk>
#
# This program is free software; you can redistribute it and/or modify
@@ -58,12 +58,17 @@ sub build_live_loopback_file {
my @excluded_files = expand_file_list($build, @{$build->{loopbacks}{exclude} || []});
output_p($exclude_list, map { $root . "$_\n" } grep { run_as_root('test', '-e', $root . $_) } @excluded_files);
+ my ($compress_type, $compress_level) = split(':', $build->{loopbacks}{compression} || 'zstd:18');
+
my $sort = $build->{settings}{config_root} . '/config/distrib.sort';
run_as_root(join(' ',
'mksquashfs',
$root, $dest,
'-noappend',
- '-comp', 'xz',
+ '-comp', $compress_type,
+ if_($compress_type eq 'zstd' && $compress_level,
+ '-Xcompression-level', $compress_level
+ ),
'-b', '1048576',
'-ef', $exclude_list,
if_(-f $sort, '-sort', $sort),