summaryrefslogtreecommitdiff
path: root/mkfs/options.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-21 12:16:37 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-21 18:21:17 +0200
commitc9d3c2e1628e5b28a553ae098b3b9f3019c45a63 (patch)
treea02caaa953b757bbc74793994db37f62e23690e3 /mkfs/options.c
parent58ced38ac46976c1b0dfa91c513c8ccd170b4e26 (diff)
Add command line flag for compressor options, pass them to compressors
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/options.c')
-rw-r--r--mkfs/options.c11
1 files changed, 9 insertions, 2 deletions
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 <name> Select the compressor to use.\n"
" directories (defaults to 'xz').\n"
+" --comp-extra, -X <options> 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 <size> Block size to use for Squashfs image.\n"
" Defaults to %u.\n"
" --dev-block-size, -B <size> 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;