From 64432358e098b444682ceedf9d385ed9aaaed4e4 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Fri, 7 Nov 2025 20:45:25 +0800 Subject: [PATCH] tools/squashfs4: update to 4.7.3 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 Link: https://github.com/openwrt/openwrt/pull/20683 Signed-off-by: Hauke Mehrtens --- tools/squashfs4/Makefile | 8 ++-- ...x-build-for-big-endian-architectures.patch | 29 +++++++++++ ..._wrapper-fix-byte-swapping-prototype.patch | 20 ++++++++ ...egression-introduced-by-SEEK_DATA-op.patch | 48 +++++++++++++++++++ 4 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 tools/squashfs4/patches/0001-mksquashfs-fix-build-for-big-endian-architectures.patch create mode 100644 tools/squashfs4/patches/0002-gzip_wrapper-fix-byte-swapping-prototype.patch create mode 100644 tools/squashfs4/patches/0003-mksquashfs-fix-regression-introduced-by-SEEK_DATA-op.patch diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile index 94679bd79d..d5612e298a 100644 --- a/tools/squashfs4/Makefile +++ b/tools/squashfs4/Makefile @@ -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 index 0000000000..a8efa7f3b4 --- /dev/null +++ b/tools/squashfs4/patches/0001-mksquashfs-fix-build-for-big-endian-architectures.patch @@ -0,0 +1,29 @@ +From 65222d06c0fa76bdbcbcb83831dd2195c19d990a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20N=C3=A9ri?= +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 index 0000000000..0651634bea --- /dev/null +++ b/tools/squashfs4/patches/0002-gzip_wrapper-fix-byte-swapping-prototype.patch @@ -0,0 +1,20 @@ +From bc9e11acadd441371e51696f555db031625a9065 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20N=C3=A9ri?= +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 index 0000000000..4baf0b5f50 --- /dev/null +++ b/tools/squashfs4/patches/0003-mksquashfs-fix-regression-introduced-by-SEEK_DATA-op.patch @@ -0,0 +1,48 @@ +From 02e51727923da21bd654ddf0ec8c006f751d86c9 Mon Sep 17 00:00:00 2001 +From: Phillip Lougher +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 +--- + 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; -- 2.30.2