]> git.scottworley.com Git - nixos-qemu-vm-isolation/commitdiff
Adjust squashfs-tools patch to apply cleanly on top of nixpkgs' 4k-align patch
authorScott Worley <scottworley@scottworley.com>
Wed, 3 Jun 2026 12:15:36 +0000 (05:15 -0700)
committerScott Worley <scottworley@scottworley.com>
Thu, 4 Jun 2026 21:10:33 +0000 (14:10 -0700)
modules/squashfs-tools-label.patch

index 7df25229af2d7050d8927159972f3d6568ba9b27..bc9c1ad6dd1cd5c02de9066f06a081f19d5edf42 100644 (file)
@@ -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
 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;
  
  /* 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;
  /* 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",
@@ -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",
  };
  
  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");
@@ -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 <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);
  
@@ -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
        /*
         * 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);
@@ -55,7 +55,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
  
        if(path)
                paths = add_subdir(paths, path);
  
        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,
        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();
        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;
  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++;
                        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",
 +              } 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);
                } 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);
@@ -164,7 +164,7 @@ diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c
        }
  
        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[])
        memset(dupl_frag, 0, block_size * sizeof(struct file_info *));
  
        if(!appending) {
        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,
        } 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,