summaryrefslogtreecommitdiff
path: root/unpack/options.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-28 13:01:17 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-28 15:07:34 +0200
commitd92e4dc101bcb6f807accff8c8ecad4030f41afb (patch)
treeb1a10fcac9280b1ff2bdfc75852bc597b67be2e1 /unpack/options.c
parent4e017928c7b5b590d2c7e04e42cb497eb3a4f8cf (diff)
Add support for unpacking sparse files as sparse files
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack/options.c')
-rw-r--r--unpack/options.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/unpack/options.c b/unpack/options.c
index 84c17cf..c42f16a 100644
--- a/unpack/options.c
+++ b/unpack/options.c
@@ -11,6 +11,7 @@ static struct option long_opts[] = {
{ "no-fifo", no_argument, NULL, 'F' },
{ "no-slink", no_argument, NULL, 'L' },
{ "no-empty-dir", no_argument, NULL, 'E' },
+ { "no-sparse", no_argument, NULL, 'Z' },
{ "describe", no_argument, NULL, 'd' },
{ "chmod", no_argument, NULL, 'C' },
{ "chown", no_argument, NULL, 'O' },
@@ -19,7 +20,7 @@ static struct option long_opts[] = {
{ "version", no_argument, NULL, 'V' },
};
-static const char *short_opts = "l:c:u:p:DSFLCOEdqhV";
+static const char *short_opts = "l:c:u:p:DSFLCOEZdqhV";
static const char *help_string =
"Usage: %s [OPTIONS] <squashfs-file>\n"
@@ -47,6 +48,8 @@ static const char *help_string =
" --no-slink, -L Do not unpack symbolic links.\n"
" --no-empty-dir, -E Do not unpack directories that would end up\n"
" empty after applying the above rules.\n"
+" --no-sparse, -Z Do not create sparse files, always write zero\n"
+" blocks to disk.\n"
" --chmod, -C Change permission flags of unpacked files to\n"
" those store in the squashfs image.\n"
" --chown, -O Change ownership of unpacked files to the\n"
@@ -118,6 +121,9 @@ void process_command_line(options_t *opt, int argc, char **argv)
case 'O':
opt->flags |= UNPACK_CHOWN;
break;
+ case 'Z':
+ opt->flags |= UNPACK_NO_SPARSE;
+ break;
case 'c':
opt->op = OP_CAT;
opt->cmdpath = get_path(opt->cmdpath, optarg);