From c9d3c2e1628e5b28a553ae098b3b9f3019c45a63 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 21 May 2019 12:16:37 +0200 Subject: Add command line flag for compressor options, pass them to compressors Signed-off-by: David Oberhollenzer --- mkfs/options.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mkfs/options.c') diff --git a/mkfs/options.c b/mkfs/options.c index d7bdf16..14c648d 100644 --- a/mkfs/options.c +++ b/mkfs/options.c @@ -16,6 +16,7 @@ static struct option long_opts[] = { { "block-size", required_argument, NULL, 'b' }, { "dev-block-size", required_argument, NULL, 'B' }, { "defaults", required_argument, NULL, 'd' }, + { "comp-extra", required_argument, NULL, 'X' }, { "force", no_argument, NULL, 'f' }, { "quiet", no_argument, NULL, 'q' }, #ifdef WITH_SELINUX @@ -26,9 +27,9 @@ static struct option long_opts[] = { }; #ifdef WITH_SELINUX -static const char *short_opts = "s:c:b:B:d:fqhV"; +static const char *short_opts = "s:X:c:b:B:d:fqhV"; #else -static const char *short_opts = "c:b:B:d:fqhV"; +static const char *short_opts = "X:c:b:B:d:fqhV"; #endif enum { @@ -91,6 +92,9 @@ static const char *help_string = "\n" " --compressor, -c Select the compressor to use.\n" " directories (defaults to 'xz').\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" " --block-size, -b Block size to use for Squashfs image.\n" " Defaults to %u.\n" " --dev-block-size, -B Device block size to padd the image to.\n" @@ -276,6 +280,9 @@ void process_command_line(options_t *opt, int argc, char **argv) case 'q': opt->quiet = true; break; + case 'X': + opt->comp_extra = optarg; + break; #ifdef WITH_SELINUX case 's': opt->selinux = optarg; -- cgit v1.2.3