diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
--- a/squashfs-tools/mksquashfs.c
+++ b/squashfs-tools/mksquashfs.c
/* Is filesystem stored at an offset from the start of the block device/file? */
long long start_offset = 0;
/* Is filesystem stored at an offset from the start of the block device/file? */
long long start_offset = 0;
/* File count statistics used to print summary and fill in superblock */
unsigned int file_count = 0, sym_count = 0, dev_count = 0, dir_count = 0,
fifo_count = 0, sock_count = 0, id_count = 0;
/* File count statistics used to print summary and fill in superblock */
unsigned int file_count = 0, sym_count = 0, dev_count = 0, dir_count = 0,
fifo_count = 0, sock_count = 0, id_count = 0;
-@@ -340,7 +346,7 @@ char *option_table[] = { "comp", "b", "mkfs-time", "fstime", "all-time",
+@@ -342,7 +348,7 @@ char *option_table[] = { "comp", "b", "mkfs-time", "fstime", "all-time",
"vaf", "taf", "faf", "read-queue", "write-queue", "fragment-queue",
"root-time", "root-uid", "root-gid", "xattrs-exclude", "xattrs-include",
"xattrs-add", "default-mode", "default-uid", "default-gid",
"vaf", "taf", "faf", "read-queue", "write-queue", "fragment-queue",
"root-time", "root-uid", "root-gid", "xattrs-exclude", "xattrs-include",
"xattrs-add", "default-mode", "default-uid", "default-gid",
};
char *sqfstar_option_table[] = { "comp", "b", "mkfs-time", "fstime", "all-time",
};
char *sqfstar_option_table[] = { "comp", "b", "mkfs-time", "fstime", "all-time",
-@@ -6239,6 +6245,8 @@ static void print_options(FILE *stream, char *name, int total_mem)
+@@ -6252,6 +6258,8 @@ static void print_options(FILE *stream, char *name, int total_mem)
fprintf(stream, "-keep-as-directory\tif one source directory is specified, ");
fprintf(stream, "create a root\n");
fprintf(stream, "\t\t\tdirectory containing that directory, rather than the\n");
fprintf(stream, "-keep-as-directory\tif one source directory is specified, ");
fprintf(stream, "create a root\n");
fprintf(stream, "\t\t\tdirectory containing that directory, rather than the\n");
fprintf(stream, "\t\t\tcontents of the directory\n");
fprintf(stream, "\nFilesystem filter options:\n");
fprintf(stream, "-p <pseudo-definition>\tadd pseudo file ");
fprintf(stream, "\t\t\tcontents of the directory\n");
fprintf(stream, "\nFilesystem filter options:\n");
fprintf(stream, "-p <pseudo-definition>\tadd pseudo file ");
-@@ -7541,6 +7549,7 @@ int sqfstar(int argc, char *argv[])
+@@ -7555,6 +7563,7 @@ int sqfstar(int argc, char *argv[])
SQUASHFS_MAJOR, SQUASHFS_MINOR,
destination_file, block_size);
SQUASHFS_MAJOR, SQUASHFS_MINOR,
destination_file, block_size);
/*
* store any compressor specific options after the superblock,
* and set the COMP_OPT flag to show that the filesystem has
/*
* store any compressor specific options after the superblock,
* and set the COMP_OPT flag to show that the filesystem has
-@@ -7554,11 +7563,9 @@ int sqfstar(int argc, char *argv[])
+@@ -7568,11 +7577,9 @@ int sqfstar(int argc, char *argv[])
sizeof(c_byte), &c_byte);
write_destination(fd, sizeof(struct squashfs_super_block) +
sizeof(c_byte), size, comp_data);
sizeof(c_byte), &c_byte);
write_destination(fd, sizeof(struct squashfs_super_block) +
sizeof(c_byte), size, comp_data);
-@@ -7579,7 +7586,7 @@ int sqfstar(int argc, char *argv[])
+@@ -7593,7 +7600,7 @@ int sqfstar(int argc, char *argv[])
sBlk.block_log = block_log;
sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, noId, no_fragments,
always_use_fragments, duplicate_checking, exportable,
sBlk.block_log = block_log;
sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, noId, no_fragments,
always_use_fragments, duplicate_checking, exportable,
-@@ -7629,6 +7636,70 @@ int sqfstar(int argc, char *argv[])
+@@ -7643,6 +7650,70 @@ int sqfstar(int argc, char *argv[])
int main(int argc, char *argv[])
{
struct stat buf, source_buf;
int main(int argc, char *argv[])
{
struct stat buf, source_buf;
-@@ -8420,6 +8491,20 @@ int main(int argc, char *argv[])
- } else if(strcmp(argv[i], "-comp") == 0) {
- /* parsed previously */
+@@ -8436,6 +8507,20 @@ int main(int argc, char *argv[])
+ } else if (strcmp(argv[i], "-label") == 0) {
+ if(++i == argc) {
+ ERROR("%s: -label: missing label\n",
+ } else if (strcmp(argv[i], "-label") == 0) {
+ if(++i == argc) {
+ ERROR("%s: -label: missing label\n",
} else {
ERROR("%s: invalid option\n\n", argv[0]);
print_options(stderr, argv[0], total_mem);
} else {
ERROR("%s: invalid option\n\n", argv[0]);
print_options(stderr, argv[0], total_mem);
-@@ -8645,6 +8730,7 @@ int main(int argc, char *argv[])
+@@ -8661,6 +8746,7 @@ int main(int argc, char *argv[])
exportable = SQUASHFS_EXPORTABLE(sBlk.flags);
no_xattrs = SQUASHFS_NO_XATTRS(sBlk.flags);
comp_opts = SQUASHFS_COMP_OPTS(sBlk.flags);
exportable = SQUASHFS_EXPORTABLE(sBlk.flags);
no_xattrs = SQUASHFS_NO_XATTRS(sBlk.flags);
comp_opts = SQUASHFS_COMP_OPTS(sBlk.flags);
}
initialise_threads(readq, fragq, bwriteq, fwriteq, !appending,
}
initialise_threads(readq, fragq, bwriteq, fwriteq, !appending,
-@@ -8666,33 +8752,44 @@ int main(int argc, char *argv[])
+@@ -8682,33 +8768,44 @@ int main(int argc, char *argv[])
} else {
unsigned int last_directory_block, inode_dir_file_size,
root_inode_size, inode_dir_start_block,
} else {
unsigned int last_directory_block, inode_dir_file_size,
root_inode_size, inode_dir_start_block,
-@@ -8852,7 +8949,7 @@ int main(int argc, char *argv[])
+@@ -8868,7 +8965,7 @@ int main(int argc, char *argv[])
sBlk.block_log = block_log;
sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, noId, no_fragments,
always_use_fragments, duplicate_checking, exportable,
sBlk.block_log = block_log;
sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, noId, no_fragments,
always_use_fragments, duplicate_checking, exportable,