lol

Merge #221855: squashfsTools: 4.5.1 -> 4.6

...into staging

+34 -37
+32 -30
pkgs/tools/filesystems/squashfs/4k-align.patch
··· 1 1 This patch is an old patch; see below for the original message body. The patch 2 - has been updated twice: Once to apply to squashfs 4.4, commit 3 - 52eb4c279cd283ed9802dd1ceb686560b22ffb67, and later to apply to squashfs 4.5, 4 - commit 0496d7c3de3e09da37ba492081c86159806ebb07. 2 + has been updated several times to be compatible with new releases. 5 3 6 - From 7bda7c75748f36b0a50f93e46144d5a4de4974ad Mon Sep 17 00:00:00 2001 4 + * To apply to squashfs 4.4, commit 52eb4c279cd283ed9802dd1ceb686560b22ffb67. 5 + * To apply to squashfs 4.5, commit 0496d7c3de3e09da37ba492081c86159806ebb07. 6 + * To apply to squashfs 4.6, commit f7623b3d9953a1190fec181708c9489ef3522b9f. 7 + 8 + From af8a6dca694ddd38d8a775a2b5f9a24fe2d10153 Mon Sep 17 00:00:00 2001 7 9 From: Amin Hassani <ahassani@google.com> 8 10 Date: Thu, 15 Dec 2016 10:43:15 -0800 9 11 Subject: [PATCH] mksquashfs 4K aligns the files inside the squashfs image ··· 21 23 22 24 The 4k alignment can be enabled by flag '-4k-align' 23 25 --- 24 - squashfs-tools/mksquashfs.c | 17 +++++++++++++++++ 25 - 1 file changed, 17 insertions(+) 26 + squashfs-tools/mksquashfs.c | 16 ++++++++++++++++ 27 + 1 file changed, 16 insertions(+) 26 28 27 29 diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c 28 - index aaa4b00..eb2fb23 100644 30 + index 3429aac..db164c2 100644 29 31 --- a/squashfs-tools/mksquashfs.c 30 32 +++ b/squashfs-tools/mksquashfs.c 31 - @@ -99,6 +99,8 @@ int nopad = FALSE; 32 - int exit_on_error = FALSE; 33 - long long start_offset = 0; 34 - int sleep_time = 0; 33 + @@ -82,6 +82,8 @@ int noI = FALSE; 34 + int noId = FALSE; 35 + int noD = FALSE; 36 + int noX = FALSE; 35 37 +int do_4k_align = FALSE; 36 38 +#define ALIGN_UP(bytes, size) (bytes = (bytes + size - 1) & ~(size - 1)) 37 39 38 - long long global_uid = -1, global_gid = -1; 39 - 40 - @@ -1553,6 +1555,9 @@ static void unlock_fragments() 40 + /* block size used to build filesystem */ 41 + int block_size = SQUASHFS_FILE_SIZE; 42 + @@ -1624,6 +1626,9 @@ static void unlock_fragments() 41 43 * queue at this time. 42 44 */ 43 45 while(!queue_empty(locked_fragment)) { ··· 47 49 write_buffer = queue_get(locked_fragment); 48 50 frg = write_buffer->block; 49 51 size = SQUASHFS_COMPRESSED_SIZE_BLOCK(fragment_table[frg].size); 50 - @@ -2460,6 +2465,9 @@ static void *frag_deflator(void *arg) 52 + @@ -2627,6 +2632,9 @@ static void *frag_deflator(void *arg) 51 53 write_buffer->size = compressed_size; 52 54 pthread_mutex_lock(&fragment_mutex); 53 55 if(fragments_locked == FALSE) { ··· 57 59 fragment_table[file_buffer->block].size = c_byte; 58 60 fragment_table[file_buffer->block].start_block = bytes; 59 61 write_buffer->block = bytes; 60 - @@ -2850,6 +2858,10 @@ static struct file_info *write_file_blocks(int *status, struct dir_ent *dir_ent, 62 + @@ -3021,6 +3029,10 @@ static struct file_info *write_file_blocks(int *status, struct dir_ent *dir_ent, 61 63 struct file_info *file; 62 64 int bl_hash = 0; 63 65 ··· 68 70 if(pre_duplicate(read_size, dir_ent->inode, read_buffer, &bl_hash)) 69 71 return write_file_blocks_dup(status, dir_ent, read_buffer, dup, bl_hash); 70 72 71 - @@ -5975,6 +5987,7 @@ static void print_options(FILE *stream, char *name, int total_mem) 72 - fprintf(stream, "actions from <f>\n"); 73 - fprintf(stream, "-false-action-file <f>\tas -false-action, but read "); 74 - fprintf(stream, "actions from <f>\n"); 73 + @@ -6169,6 +6181,7 @@ static void print_options(FILE *stream, char *name, int total_mem) 74 + fprintf(stream, "or metadata. This is\n\t\t\tequivalent to "); 75 + fprintf(stream, "specifying -noI -noD -noF and -noX\n"); 76 + fprintf(stream, "\nFilesystem build options:\n"); 75 77 + fprintf(stream, "-4k-align\t\tenables 4k alignment of all files\n"); 76 - fprintf(stream, "\nFilesystem filter options:\n"); 77 - fprintf(stream, "-p <pseudo-definition>\tAdd pseudo file definition\n"); 78 - fprintf(stream, "-pf <pseudo-file>\tAdd list of pseudo file definitions\n"); 79 - @@ -6198,6 +6211,7 @@ static void print_summary() 78 + fprintf(stream, "-tar\t\t\tread uncompressed tar file from standard in (stdin)\n"); 79 + fprintf(stream, "-no-strip\t\tact like tar, and do not strip leading "); 80 + fprintf(stream, "directories\n\t\t\tfrom source files\n"); 81 + @@ -6690,6 +6703,7 @@ static void print_summary() 80 82 "compressed", no_fragments ? "no" : noF ? "uncompressed" : 81 83 "compressed", no_xattrs ? "no" : noX ? "uncompressed" : 82 84 "compressed", noI || noId ? "uncompressed" : "compressed"); ··· 84 86 printf("\tduplicates are %sremoved\n", duplicate_checking ? "" : 85 87 "not "); 86 88 printf("Filesystem size %.2f Kbytes (%.2f Mbytes)\n", bytes / 1024.0, 87 - @@ -7499,6 +7513,9 @@ print_compressor_options: 88 - root_name = argv[i]; 89 - } else if(strcmp(argv[i], "-version") == 0) { 90 - print_version("mksquashfs"); 91 - + 89 + @@ -8417,6 +8431,8 @@ print_compressor_options: 90 + } else if(strcmp(argv[i], "-comp") == 0) { 91 + /* parsed previously */ 92 + i++; 92 93 + } else if(strcmp(argv[i], "-4k-align") == 0) { 93 94 + do_4k_align = TRUE; 94 95 } else { 95 96 ERROR("%s: invalid option\n\n", argv[0]); 96 97 print_options(stderr, argv[0], total_mem); 97 98 -- 98 - 2.32.0 99 + 2.39.2 100 +
+2 -7
pkgs/tools/filesystems/squashfs/default.nix
··· 14 14 15 15 stdenv.mkDerivation rec { 16 16 pname = "squashfs"; 17 - version = "4.5.1"; 17 + version = "4.6.1"; 18 18 19 19 src = fetchFromGitHub { 20 20 owner = "plougher"; 21 21 repo = "squashfs-tools"; 22 22 rev = version; 23 - sha256 = "sha256-Y3ZPjeE9HN1F+NtGe6EchYziWrTPVQ4SuKaCvNbXMKI="; 23 + hash = "sha256-C/awQpp1Q/0adx3YVNTq6ruEAzcjL5G7SkOCgpvAA50="; 24 24 }; 25 25 26 26 patches = [ 27 - # remove once https://github.com/plougher/squashfs-tools/pull/177 is merged and in a release 28 - (fetchpatch { 29 - url = "https://github.com/plougher/squashfs-tools/commit/6100e82c7e7f18f503c003c67c87791025d5f01b.patch"; 30 - sha256 = "sha256-bMBQsbSKQ4E7r9avns2QaomGAYl3s82m58gYyTQdB08="; 31 - }) 32 27 # This patch adds an option to pad filesystems (increasing size) in 33 28 # exchange for better chunking / binary diff calculation. 34 29 ./4k-align.patch