diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-11 13:59:13 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-11 14:11:30 +0200 |
commit | 33d5e09ccbf2bafe3d06f615b11bf29d07f47784 (patch) | |
tree | d9240bdf940cda58bcbb1dfdb58b3006b7445117 /mkfs/options.c | |
parent | 4b02470e6e8126918549d292cbed610a6cbfbf68 (diff) |
Add gensquashfs option to read xattrs from input files
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/options.c')
-rw-r--r-- | mkfs/options.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/mkfs/options.c b/mkfs/options.c index 340cb81..2778a9e 100644 --- a/mkfs/options.c +++ b/mkfs/options.c @@ -15,6 +15,9 @@ static struct option long_opts[] = { { "pack-file", required_argument, NULL, 'F' }, { "pack-dir", required_argument, NULL, 'D' }, { "keep-time", no_argument, NULL, 'k' }, +#ifdef HAVE_SYS_XATTR_H + { "keep-xattr", no_argument, NULL, 'x' }, +#endif { "one-file-system", no_argument, NULL, 'o' }, { "exportable", no_argument, NULL, 'e' }, { "force", no_argument, NULL, 'f' }, @@ -26,11 +29,14 @@ static struct option long_opts[] = { { "help", no_argument, NULL, 'h' }, }; +static const char *short_opts = "F:D:X:c:b:B:d:kxoefqhV" #ifdef WITH_SELINUX -static const char *short_opts = "s:F:D:X:c:b:B:d:koefqhV"; -#else -static const char *short_opts = "F:D:X:c:b:B:d:koefqhV"; +"s:" +#endif +#ifdef HAVE_SYS_XATTR_H +"x" #endif +; extern char *__progname; @@ -77,6 +83,8 @@ static const char *help_string = " --keep-time, -k When using --pack-dir only, use the timestamps\n" " from the input files instead of setting\n" " defaults on all input paths.\n" +" --keep-xattr, -x When using --pack-dir only, read and pack the\n" +" extended attributes from the input files.\n" " --one-file-system, -o When using --pack-dir only, stay in local file\n" " system and do not cross mount points.\n" " --exportable, -e Generate an export table for NFS support.\n" @@ -139,6 +147,7 @@ void process_command_line(options_t *opt, int argc, char **argv) opt->compressor = compressor_get_default(); opt->blksz = SQFS_DEFAULT_BLOCK_SIZE; opt->devblksz = SQFS_DEVBLK_SIZE; + opt->keep_xattr = false; opt->keep_time = false; opt->one_filesystem = false; opt->exportable = false; @@ -188,6 +197,11 @@ void process_command_line(options_t *opt, int argc, char **argv) case 'k': opt->keep_time = true; break; +#ifdef HAVE_SYS_XATTR_H + case 'x': + opt->keep_xattr = true; + break; +#endif case 'o': opt->one_filesystem = true; break; |