From: Scott Worley Date: Wed, 3 Jun 2026 12:15:36 +0000 (-0700) Subject: Adjust squashfs-tools patch to apply cleanly on top of nixpkgs' 4k-align patch X-Git-Url: http://git.scottworley.com/nixos-qemu-vm-isolation/commitdiff_plain/25a9b000f9b69a58d0ef090f8c31f601d728cbbe Adjust squashfs-tools patch to apply cleanly on top of nixpkgs' 4k-align patch --- diff --git a/modules/squashfs-tools-label.patch b/modules/squashfs-tools-label.patch index 7df2522..bc9c1ad 100644 --- a/modules/squashfs-tools-label.patch +++ b/modules/squashfs-tools-label.patch @@ -2,7 +2,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c --- a/squashfs-tools/mksquashfs.c +++ b/squashfs-tools/mksquashfs.c -@@ -180,6 +180,12 @@ int exit_on_error = FALSE; +@@ -182,6 +182,12 @@ int exit_on_error = FALSE; /* Is filesystem stored at an offset from the start of the block device/file? */ long long start_offset = 0; @@ -15,7 +15,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c /* 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", @@ -24,7 +24,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c }; 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"); @@ -33,7 +33,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c fprintf(stream, "\t\t\tcontents of the directory\n"); fprintf(stream, "\nFilesystem filter options:\n"); fprintf(stream, "-p \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); @@ -41,7 +41,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c /* * 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); @@ -55,7 +55,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c if(path) paths = add_subdir(paths, path); -@@ -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, @@ -64,7 +64,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c sBlk.mkfs_time = mkfs_time_opt ? mkfs_time : time(NULL); disable_info(); -@@ -7629,6 +7636,70 @@ int sqfstar(int argc, char *argv[]) +@@ -7643,6 +7650,70 @@ int sqfstar(int argc, char *argv[]) } @@ -135,10 +135,10 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c 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[]) i++; + } else if(strcmp(argv[i], "-4k-align") == 0) { + do_4k_align = TRUE; + } else if (strcmp(argv[i], "-label") == 0) { + if(++i == argc) { + ERROR("%s: -label: missing label\n", @@ -156,7 +156,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c } 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); @@ -164,7 +164,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c } 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[]) memset(dupl_frag, 0, block_size * sizeof(struct file_info *)); if(!appending) { @@ -220,7 +220,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c } 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,