summaryrefslogtreecommitdiffstats
path: root/lib/MGA
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 /lib/MGA
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.
Diffstat (limited to 'lib/MGA')
-rw-r--r--lib/MGA/DrakISO/BuildLoop.pm9
1 files changed, 7 insertions, 2 deletions
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),