aboutsummaryrefslogtreecommitdiff
path: root/bin/gensquashfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gensquashfs/src')
-rw-r--r--bin/gensquashfs/src/glob.c5
-rw-r--r--bin/gensquashfs/src/options.c14
2 files changed, 18 insertions, 1 deletions
diff --git a/bin/gensquashfs/src/glob.c b/bin/gensquashfs/src/glob.c
index 27b7baa..bc6edee 100644
--- a/bin/gensquashfs/src/glob.c
+++ b/bin/gensquashfs/src/glob.c
@@ -47,6 +47,7 @@ static const struct {
{ "-mount", DIR_SCAN_ONE_FILESYSTEM },
{ "-keeptime", DIR_SCAN_KEEP_TIME },
{ "-nonrecursive", DIR_SCAN_NO_RECURSION },
+ { "-nohardlinks", DIR_SCAN_NO_HARDLINKS },
};
static bool set_scan_flag(const char *arg, dir_tree_cfg_t *cfg)
@@ -176,6 +177,10 @@ int glob_files(fstree_t *fs, const char *filename, size_t line_num,
cfg.prefix = prefix;
cfg.flags = glob_flags;
+#if defined(_WIN32) || defined(__WINDOWS__)
+ cfg.flags |= DIR_SCAN_NO_HARDLINKS;
+#endif
+
while (sep->count != 0) {
if (sep->args[0][0] != '-')
break;
diff --git a/bin/gensquashfs/src/options.c b/bin/gensquashfs/src/options.c
index f263bce..c8bf64b 100644
--- a/bin/gensquashfs/src/options.c
+++ b/bin/gensquashfs/src/options.c
@@ -35,6 +35,7 @@ static struct option long_opts[] = {
#ifdef WITH_SELINUX
{ "selinux", required_argument, NULL, 's' },
#endif
+ { "no-hard-links", no_argument, NULL, 'H' },
{ "xattr-file", required_argument, NULL, 'A' },
{ "sort-file", required_argument, NULL, 'S' },
{ "version", no_argument, NULL, 'V' },
@@ -42,7 +43,7 @@ static struct option long_opts[] = {
{ NULL, 0, NULL, 0 },
};
-static const char *short_opts = "F:D:X:c:b:B:d:u:g:j:Q:S:A:kxoefqThV"
+static const char *short_opts = "HF:D:X:c:b:B:d:u:g:j:Q:S:A:kxoefqThV"
#ifdef WITH_SELINUX
"s:"
#endif
@@ -123,6 +124,10 @@ const char *extra_options =
" --exportable, -e Generate an export table for NFS support.\n"
" --no-tail-packing, -T Do not perform tail end packing on files that\n"
" are larger than block size.\n"
+#if !defined(_WIN32) && !defined(__WINDOWS__)
+" --no-hard-links, -H When scanning a directory, do not attempt to\n"
+" detect hard links.\n"
+#endif
" --force, -f Overwrite the output file if it exists.\n"
" --quiet, -q Do not print out progress reports.\n"
" --help, -h Print help text and exit.\n"
@@ -223,6 +228,9 @@ void process_command_line(options_t *opt, int argc, char **argv)
case 'T':
opt->no_tail_packing = true;
break;
+ case 'H':
+ opt->dirscan_flags |= DIR_SCAN_NO_HARDLINKS;
+ break;
case 'c':
have_compressor = true;
ret = sqfs_compressor_id_from_name(optarg);
@@ -332,6 +340,10 @@ void process_command_line(options_t *opt, int argc, char **argv)
}
}
+#if defined(_WIN32) || defined(__WINDOWS__)
+ opt->dirscan_flags |= DIR_SCAN_NO_HARDLINKS;
+#endif
+
if (opt->cfg.num_jobs < 1)
opt->cfg.num_jobs = 1;