From a3a47476c5ceed1688e37a5af8a5a988b504832e Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 11 Jun 2019 15:04:59 +0200 Subject: Cleanup dependency handling Always try to gather all compressor libraries available, but only complain about missing a one if it has been *explicitly* selected. If a compressor has been explicityl disabled, we can still turn it off after checking. Also, rework gensquashfs to set the default compressor based on what's available. Signed-off-by: David Oberhollenzer --- mkfs/options.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mkfs') diff --git a/mkfs/options.c b/mkfs/options.c index e1223ad..69e66f4 100644 --- a/mkfs/options.c +++ b/mkfs/options.c @@ -61,7 +61,7 @@ static const char *help_string = "\n" " --compressor, -c Select the compressor to use.\n" " A list of available compressors is below.\n" -" Defaults to 'xz'.\n" +" Defaults to '%s'.\n" " --comp-extra, -X A comma seperated list of extra options for\n" " the selected compressor. Specify 'help' to\n" " get a list of available options.\n" @@ -240,7 +240,7 @@ void process_command_line(options_t *opt, int argc, char **argv) opt->def_mode = 0755; opt->def_mtime = 0; opt->outmode = O_WRONLY | O_CREAT | O_EXCL; - opt->compressor = SQFS_COMP_XZ; + opt->compressor = compressor_get_default(); opt->blksz = SQFS_DEFAULT_BLOCK_SIZE; opt->devblksz = SQFS_DEVBLK_SIZE; opt->quiet = false; @@ -308,6 +308,7 @@ void process_command_line(options_t *opt, int argc, char **argv) #endif case 'h': printf(help_string, __progname, + compressors[compressor_get_default()], SQFS_DEFAULT_BLOCK_SIZE, SQFS_DEVBLK_SIZE); fputs("Available compressors:\n", stdout); -- cgit v1.2.3