From 7847adb9b8723c79d4c529a6c350f5824b1b8ce5 Mon Sep 17 00:00:00 2001 From: Martin Whitaker Date: Tue, 24 Mar 2020 19:50:19 +0000 Subject: 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. --- NEWS | 3 +++ lib/MGA/DrakISO/BuildLoop.pm | 9 +++++++-- 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 -# Copyright (C) 2017-2018 Mageia +# Copyright (C) 2017-2020 Mageia # Martin Whitaker # # 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), -- cgit v1.2.1