tools/squashfs4: update to 4.7.3
authorShiji Yang <[email protected]>
Fri, 7 Nov 2025 12:45:25 +0000 (20:45 +0800)
committerHauke Mehrtens <[email protected]>
Sun, 9 Nov 2025 21:45:12 +0000 (22:45 +0100)
Release Note:
  https://github.com/plougher/squashfs-tools/releases/tag/4.7.3

The three backported patches fixed the regression and build
issue on squashfs-tools v4.7.3.

Signed-off-by: Shiji Yang <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20683
Signed-off-by: Hauke Mehrtens <[email protected]>
tools/squashfs4/Makefile
tools/squashfs4/patches/0001-mksquashfs-fix-build-for-big-endian-architectures.patch [new file with mode: 0644]
tools/squashfs4/patches/0002-gzip_wrapper-fix-byte-swapping-prototype.patch [new file with mode: 0644]
tools/squashfs4/patches/0003-mksquashfs-fix-regression-introduced-by-SEEK_DATA-op.patch [new file with mode: 0644]

index 94679bd79d6d42fc2d48127b9e54ab51212c9aff..d5612e298a2e6960d203743a414edb3a4712a242 100644 (file)
@@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=squashfs4
 PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs
-PKG_VERSION:=4.7.2
+PKG_VERSION:=4.7.3
 PKG_RELEASE=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
-PKG_SOURCE_DATE:=2025-08-19
-PKG_SOURCE_VERSION:=99d23a31b471433c51e9c145aeba2ab1536e34df
-PKG_MIRROR_HASH:=229a1b8f465fa0f576b5ace1753a8e9d28a2c4254ec2b019668baa676094f6c3
+PKG_SOURCE_DATE:=2025-11-06
+PKG_SOURCE_VERSION:=a143ab5534cc9ad4aededf1116fe37bcb1c8674d
+PKG_MIRROR_HASH:=aafdeab814de1081882f858a0997d74e227081bf611fccd84e0d4990f9a51ec4
 
 HOST_BUILD_PARALLEL:=1
 
diff --git a/tools/squashfs4/patches/0001-mksquashfs-fix-build-for-big-endian-architectures.patch b/tools/squashfs4/patches/0001-mksquashfs-fix-build-for-big-endian-architectures.patch
new file mode 100644 (file)
index 0000000..a8efa7f
--- /dev/null
@@ -0,0 +1,29 @@
+From 65222d06c0fa76bdbcbcb83831dd2195c19d990a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20N=C3=A9ri?= <[email protected]>
+Date: Fri, 7 Nov 2025 11:58:37 +0100
+Subject: [PATCH 1/2] mksquashfs: fix build for big-endian architectures
+
+---
+ squashfs-tools/mksquashfs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -7313,7 +7313,7 @@ static int sqfstar(int argc, char *argv[
+               memset(&sblk, 0, sizeof(struct squashfs_super_block));
+               sblk.s_magic = SQUASHFS_MAGIC_STREAMED;
+-              SQUASHFS_INSWAP_SUPER_BLOCK(sblk);
++              SQUASHFS_INSWAP_SUPER_BLOCK(&sblk);
+               write_destination(fd, SQUASHFS_START,
+                       sizeof(struct squashfs_super_block), &sblk);
+       }
+@@ -8600,7 +8600,7 @@ int main(int argc, char *argv[])
+                               memset(&sblk, 0, sizeof(struct squashfs_super_block));
+                               sblk.s_magic = SQUASHFS_MAGIC_STREAMED;
+-                              SQUASHFS_INSWAP_SUPER_BLOCK(sblk);
++                              SQUASHFS_INSWAP_SUPER_BLOCK(&sblk);
+                               write_destination(fd, SQUASHFS_START,
+                                       sizeof(struct squashfs_super_block), &sblk);
+                       }
diff --git a/tools/squashfs4/patches/0002-gzip_wrapper-fix-byte-swapping-prototype.patch b/tools/squashfs4/patches/0002-gzip_wrapper-fix-byte-swapping-prototype.patch
new file mode 100644 (file)
index 0000000..0651634
--- /dev/null
@@ -0,0 +1,20 @@
+From bc9e11acadd441371e51696f555db031625a9065 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20N=C3=A9ri?= <[email protected]>
+Date: Fri, 7 Nov 2025 11:58:37 +0100
+Subject: [PATCH 2/2] gzip_wrapper: fix byte swapping prototype
+
+---
+ squashfs-tools/gzip_wrapper.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/squashfs-tools/gzip_wrapper.h
++++ b/squashfs-tools/gzip_wrapper.h
+@@ -27,7 +27,7 @@
+ #include "endian_compat.h"
+ #if __BYTE_ORDER == __BIG_ENDIAN
+-extern unsigned int inswap_le16(unsigned short);
++extern unsigned short inswap_le16(unsigned short);
+ extern unsigned int inswap_le32(unsigned int);
+ #define SQUASHFS_INSWAP_COMP_OPTS(s) { \
diff --git a/tools/squashfs4/patches/0003-mksquashfs-fix-regression-introduced-by-SEEK_DATA-op.patch b/tools/squashfs4/patches/0003-mksquashfs-fix-regression-introduced-by-SEEK_DATA-op.patch
new file mode 100644 (file)
index 0000000..4baf0b5
--- /dev/null
@@ -0,0 +1,48 @@
+From 02e51727923da21bd654ddf0ec8c006f751d86c9 Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <[email protected]>
+Date: Fri, 7 Nov 2025 23:13:03 +0000
+Subject: [PATCH] mksquashfs: fix regression introduced by SEEK_DATA
+ optimisation
+
+The representation of a sparse block was changed from 0 to a negative
+number.  This was to optimise sparse buffer passing between threads, and
+where a single buffer can now represent a multi-block sparse span.
+
+Unfortunately some code was not correctly updated, and this was not
+picked up in testing.
+
+Fixes: https://github.com/plougher/squashfs-tools/issues/336
+
+Signed-off-by: Phillip Lougher <[email protected]>
+---
+ squashfs-tools/mksquashfs.c        | 4 ++--
+ squashfs-tools/process_fragments.c | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -2889,11 +2889,11 @@ static struct file_info *write_file_proc
+                               sizeof(unsigned int));
+                       block_list[block ++] = read_buffer->c_byte;
+                       if(!is_sparse(read_buffer)) {
+-                              if(sparse_count(read_buffer) > 1)
+-                                      BAD_ERROR("Sparse block too large in write file process\n");
+                               file_bytes += read_buffer->size;
+                               put_write_buffer_hash(read_buffer);
+                       } else {
++                              if(sparse_count(read_buffer) > 1)
++                                      BAD_ERROR("Sparse block too large in write file process\n");
+                               sparse += read_buffer->size;
+                               gen_cache_block_put(read_buffer);
+                       }
+--- a/squashfs-tools/process_fragments.c
++++ b/squashfs-tools/process_fragments.c
+@@ -285,7 +285,7 @@ void *frag_thrd(void *destination_file)
+               int res;
+               if(sparse_files && sparse) {
+-                      file_buffer->c_byte = 0;
++                      set_sparse(file_buffer, 1);
+                       file_buffer->fragment = FALSE;
+               } else
+                       file_buffer->c_byte = file_buffer->size;