lol

squashfsTools: 4.5 -> 4.5.1

The patch that was previously fetched from GitHub is now part of the
4.5.1 release, and is no longer needed. Furthermore, 4.5.1 introduces
some new scripts to build manpages, and some new build inputs are
required to make that work.

This also rebases the Darwin patch. I don't have a Mac so I can't test
this personally. There was one conflict:

diff --cc squashfs-tools/read_xattrs.c
index 2067f80,b28c3a0..0000000
--- a/squashfs-tools/read_xattrs.c
+++ b/squashfs-tools/read_xattrs.c
@@@ -36,9 -38,7 +38,7 @@@
#include "xattr.h"
#include "error.h"

- #include <stdlib.h>
-
-extern int read_fs_bytes(int, long long, int, void *);
+extern int read_fs_bytes(int, long long, long long, void *);
extern int read_block(int, long long, long long *, int, void *);

static struct hash_entry {

Resolved by updating the signature from int to long long.

+30 -31
+18 -18
pkgs/tools/filesystems/squashfs/darwin.patch
··· 5 See also https://github.com/plougher/squashfs-tools/pull/69. 6 7 diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c 8 - index 4b06ccb..3cad2ab 100644 9 --- a/squashfs-tools/action.c 10 +++ b/squashfs-tools/action.c 11 @@ -39,6 +39,10 @@ ··· 19 #include "squashfs_fs.h" 20 #include "mksquashfs.h" 21 #include "action.h" 22 - @@ -2414,9 +2418,12 @@ static char *get_start(char *s, int n) 23 24 static int subpathname_fn(struct atom *atom, struct action_data *action_data) 25 { ··· 34 35 /* 36 diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c 37 - index fe23d78..5c2f835 100644 38 --- a/squashfs-tools/info.c 39 +++ b/squashfs-tools/info.c 40 @@ -144,31 +144,22 @@ void dump_state() ··· 89 } 90 91 diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c 92 - index a45b77f..3607448 100644 93 --- a/squashfs-tools/mksquashfs.c 94 +++ b/squashfs-tools/mksquashfs.c 95 @@ -35,7 +35,12 @@ ··· 117 118 #ifndef linux 119 #include <sys/sysctl.h> 120 - @@ -5022,6 +5030,7 @@ static void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, 121 sigemptyset(&sigmask); 122 sigaddset(&sigmask, SIGQUIT); 123 sigaddset(&sigmask, SIGHUP); ··· 125 if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0) 126 BAD_ERROR("Failed to set signal mask in intialise_threads\n"); 127 128 - @@ -5760,6 +5769,35 @@ static int get_physical_memory() 129 long long page_size = sysconf(_SC_PAGESIZE); 130 int phys_mem; 131 ··· 161 if(num_pages == -1 || page_size == -1) { 162 struct sysinfo sys; 163 int res = sysinfo(&sys); 164 - @@ -5772,6 +5810,7 @@ static int get_physical_memory() 165 } 166 167 phys_mem = num_pages * page_size >> 20; ··· 170 if(phys_mem < SQUASHFS_LOWMEM) 171 BAD_ERROR("Mksquashfs requires more physical memory than is " 172 diff --git a/squashfs-tools/read_xattrs.c b/squashfs-tools/read_xattrs.c 173 - index 4debedf..3257c30 100644 174 --- a/squashfs-tools/read_xattrs.c 175 +++ b/squashfs-tools/read_xattrs.c 176 @@ -31,13 +31,13 @@ ··· 186 187 -#include <stdlib.h> 188 - 189 - extern int read_fs_bytes(int, long long, int, void *); 190 extern int read_block(int, long long, long long *, int, void *); 191 192 diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c 193 - index 727f1d5..c1a6183 100644 194 --- a/squashfs-tools/unsquashfs.c 195 +++ b/squashfs-tools/unsquashfs.c 196 @@ -32,8 +32,12 @@ ··· 206 #include <sys/types.h> 207 #include <sys/time.h> 208 #include <sys/resource.h> 209 - @@ -1175,7 +1179,7 @@ int create_inode(char *pathname, struct inode *i) 210 break; 211 case SQUASHFS_SYMLINK_TYPE: 212 case SQUASHFS_LSYMLINK_TYPE: { ··· 215 { i->time, 0 }, 216 { i->time, 0 } 217 }; 218 - @@ -1194,8 +1198,7 @@ int create_inode(char *pathname, struct inode *i) 219 goto failed; 220 } 221 ··· 225 if(res == -1) { 226 EXIT_UNSQUASH_STRICT("create_inode: failed to" 227 " set time on %s, because %s\n", 228 - @@ -2683,6 +2686,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size, int cat_ 229 sigemptyset(&sigmask); 230 sigaddset(&sigmask, SIGQUIT); 231 sigaddset(&sigmask, SIGHUP); ··· 234 EXIT_UNSQUASH("Failed to set signal mask in initialise_threads\n"); 235 236 diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h 237 - index 934618b..0e680ab 100644 238 --- a/squashfs-tools/unsquashfs.h 239 +++ b/squashfs-tools/unsquashfs.h 240 @@ -46,6 +46,10 @@ ··· 249 #include "squashfs_fs.h" 250 #include "unsquashfs_error.h" 251 diff --git a/squashfs-tools/unsquashfs_info.c b/squashfs-tools/unsquashfs_info.c 252 - index c8e2b9b..7d4f7af 100644 253 --- a/squashfs-tools/unsquashfs_info.c 254 +++ b/squashfs-tools/unsquashfs_info.c 255 @@ -96,31 +96,22 @@ void dump_state() ··· 304 } 305 306 diff --git a/squashfs-tools/unsquashfs_xattr.c b/squashfs-tools/unsquashfs_xattr.c 307 - index 7742dfe..f8cd3b6 100644 308 --- a/squashfs-tools/unsquashfs_xattr.c 309 +++ b/squashfs-tools/unsquashfs_xattr.c 310 @@ -27,6 +27,11 @@ ··· 320 321 extern int root_process; 322 diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c 323 - index 64dfd82..d82d186 100644 324 --- a/squashfs-tools/xattr.c 325 +++ b/squashfs-tools/xattr.c 326 @@ -22,6 +22,14 @@ ··· 353 #include "squashfs_swap.h" 354 #include "mksquashfs.h" 355 -- 356 - 2.23.0 357
··· 5 See also https://github.com/plougher/squashfs-tools/pull/69. 6 7 diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c 8 + index ea2f604..9c979f8 100644 9 --- a/squashfs-tools/action.c 10 +++ b/squashfs-tools/action.c 11 @@ -39,6 +39,10 @@ ··· 19 #include "squashfs_fs.h" 20 #include "mksquashfs.h" 21 #include "action.h" 22 + @@ -2415,9 +2419,12 @@ static char *get_start(char *s, int n) 23 24 static int subpathname_fn(struct atom *atom, struct action_data *action_data) 25 { ··· 34 35 /* 36 diff --git a/squashfs-tools/info.c b/squashfs-tools/info.c 37 + index 216b979..eea2ec9 100644 38 --- a/squashfs-tools/info.c 39 +++ b/squashfs-tools/info.c 40 @@ -144,31 +144,22 @@ void dump_state() ··· 89 } 90 91 diff --git a/squashfs-tools/mksquashfs.c b/squashfs-tools/mksquashfs.c 92 + index 843f9f4..ed2c3a6 100644 93 --- a/squashfs-tools/mksquashfs.c 94 +++ b/squashfs-tools/mksquashfs.c 95 @@ -35,7 +35,12 @@ ··· 117 118 #ifndef linux 119 #include <sys/sysctl.h> 120 + @@ -5064,6 +5072,7 @@ static void initialise_threads(int readq, int fragq, int bwriteq, int fwriteq, 121 sigemptyset(&sigmask); 122 sigaddset(&sigmask, SIGQUIT); 123 sigaddset(&sigmask, SIGHUP); ··· 125 if(pthread_sigmask(SIG_BLOCK, &sigmask, NULL) != 0) 126 BAD_ERROR("Failed to set signal mask in intialise_threads\n"); 127 128 + @@ -5802,6 +5811,35 @@ static int get_physical_memory() 129 long long page_size = sysconf(_SC_PAGESIZE); 130 int phys_mem; 131 ··· 161 if(num_pages == -1 || page_size == -1) { 162 struct sysinfo sys; 163 int res = sysinfo(&sys); 164 + @@ -5814,6 +5852,7 @@ static int get_physical_memory() 165 } 166 167 phys_mem = num_pages * page_size >> 20; ··· 170 if(phys_mem < SQUASHFS_LOWMEM) 171 BAD_ERROR("Mksquashfs requires more physical memory than is " 172 diff --git a/squashfs-tools/read_xattrs.c b/squashfs-tools/read_xattrs.c 173 + index 2067f80..ca8b7f4 100644 174 --- a/squashfs-tools/read_xattrs.c 175 +++ b/squashfs-tools/read_xattrs.c 176 @@ -31,13 +31,13 @@ ··· 186 187 -#include <stdlib.h> 188 - 189 + extern int read_fs_bytes(int, long long, long long, void *); 190 extern int read_block(int, long long, long long *, int, void *); 191 192 diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c 193 + index d434b42..1208e45 100644 194 --- a/squashfs-tools/unsquashfs.c 195 +++ b/squashfs-tools/unsquashfs.c 196 @@ -32,8 +32,12 @@ ··· 206 #include <sys/types.h> 207 #include <sys/time.h> 208 #include <sys/resource.h> 209 + @@ -1182,7 +1186,7 @@ int create_inode(char *pathname, struct inode *i) 210 break; 211 case SQUASHFS_SYMLINK_TYPE: 212 case SQUASHFS_LSYMLINK_TYPE: { ··· 215 { i->time, 0 }, 216 { i->time, 0 } 217 }; 218 + @@ -1201,8 +1205,7 @@ int create_inode(char *pathname, struct inode *i) 219 goto failed; 220 } 221 ··· 225 if(res == -1) { 226 EXIT_UNSQUASH_STRICT("create_inode: failed to" 227 " set time on %s, because %s\n", 228 + @@ -2687,6 +2690,7 @@ void initialise_threads(int fragment_buffer_size, int data_buffer_size, int cat_ 229 sigemptyset(&sigmask); 230 sigaddset(&sigmask, SIGQUIT); 231 sigaddset(&sigmask, SIGHUP); ··· 234 EXIT_UNSQUASH("Failed to set signal mask in initialise_threads\n"); 235 236 diff --git a/squashfs-tools/unsquashfs.h b/squashfs-tools/unsquashfs.h 237 + index 1099678..5b6a038 100644 238 --- a/squashfs-tools/unsquashfs.h 239 +++ b/squashfs-tools/unsquashfs.h 240 @@ -46,6 +46,10 @@ ··· 249 #include "squashfs_fs.h" 250 #include "unsquashfs_error.h" 251 diff --git a/squashfs-tools/unsquashfs_info.c b/squashfs-tools/unsquashfs_info.c 252 + index e906eaf..f1e68c2 100644 253 --- a/squashfs-tools/unsquashfs_info.c 254 +++ b/squashfs-tools/unsquashfs_info.c 255 @@ -96,31 +96,22 @@ void dump_state() ··· 304 } 305 306 diff --git a/squashfs-tools/unsquashfs_xattr.c b/squashfs-tools/unsquashfs_xattr.c 307 + index 61910e1..73e0090 100644 308 --- a/squashfs-tools/unsquashfs_xattr.c 309 +++ b/squashfs-tools/unsquashfs_xattr.c 310 @@ -27,6 +27,11 @@ ··· 320 321 extern int root_process; 322 diff --git a/squashfs-tools/xattr.c b/squashfs-tools/xattr.c 323 + index b1c0089..6d7ed98 100644 324 --- a/squashfs-tools/xattr.c 325 +++ b/squashfs-tools/xattr.c 326 @@ -22,6 +22,14 @@ ··· 353 #include "squashfs_swap.h" 354 #include "mksquashfs.h" 355 -- 356 + 2.35.1 357
+12 -13
pkgs/tools/filesystems/squashfs/default.nix
··· 2 , stdenv 3 , fetchFromGitHub 4 , fetchpatch 5 - , zlib 6 - , xz 7 , lz4 8 , lzo 9 , zstd 10 - , nixosTests 11 }: 12 13 stdenv.mkDerivation rec { 14 pname = "squashfs"; 15 - version = "4.5"; 16 17 src = fetchFromGitHub { 18 owner = "plougher"; 19 repo = "squashfs-tools"; 20 rev = version; 21 - sha256 = "1nanwz5qvsakxfm37md5i7xqagv69nfik9hpj8qlp6ymw266vgxr"; 22 }; 23 24 patches = [ 25 # This patch adds an option to pad filesystems (increasing size) in 26 # exchange for better chunking / binary diff calculation. 27 ./4k-align.patch 28 - # Otherwise sizes of some files may break in our ISO; see 29 - # https://github.com/NixOS/nixpkgs/issues/132286 30 - (fetchpatch { 31 - url = "https://github.com/plougher/squashfs-tools/commit/19b161c1cd3e31f7a396ea92dea4390ad43f27b9.diff"; 32 - sha256 = "15ng8m2my3a6a9hnfx474bip2vwdh08hzs2k0l5gwd36jv2z1h3f"; 33 - }) 34 ] ++ lib.optional stdenv.isDarwin ./darwin.patch; 35 36 - buildInputs = [ zlib xz zstd lz4 lzo ]; 37 38 preBuild = '' 39 cd squashfs-tools 40 '' ; 41 42 - installFlags = [ "INSTALL_DIR=${placeholder "out"}/bin" ]; 43 44 makeFlags = [ 45 "XZ_SUPPORT=1"
··· 2 , stdenv 3 , fetchFromGitHub 4 , fetchpatch 5 + , help2man 6 , lz4 7 , lzo 8 + , nixosTests 9 + , which 10 + , xz 11 + , zlib 12 , zstd 13 }: 14 15 stdenv.mkDerivation rec { 16 pname = "squashfs"; 17 + version = "4.5.1"; 18 19 src = fetchFromGitHub { 20 owner = "plougher"; 21 repo = "squashfs-tools"; 22 rev = version; 23 + sha256 = "sha256-Y3ZPjeE9HN1F+NtGe6EchYziWrTPVQ4SuKaCvNbXMKI="; 24 }; 25 26 patches = [ 27 # This patch adds an option to pad filesystems (increasing size) in 28 # exchange for better chunking / binary diff calculation. 29 ./4k-align.patch 30 ] ++ lib.optional stdenv.isDarwin ./darwin.patch; 31 32 + buildInputs = [ zlib xz zstd lz4 lzo which help2man ]; 33 34 preBuild = '' 35 cd squashfs-tools 36 '' ; 37 38 + installFlags = [ 39 + "INSTALL_DIR=${placeholder "out"}/bin" 40 + "INSTALL_MANPAGES_DIR=${placeholder "out"}/share/man/man1" 41 + ]; 42 43 makeFlags = [ 44 "XZ_SUPPORT=1"