From e69e03a49d0794d0cd8f5562b3d3b15ca0b560cf Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Tue, 3 Mar 2026 19:25:02 +0800 Subject: [PATCH] tools/squashfs4: update to 4.7.5 Release Note: https://github.com/plougher/squashfs-tools/releases/tag/4.7.5 Remove upstreamed patch: - 0001-mksquashfs-don-t-create-duplicate-virtual-real-disk-.patch Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/22249 Signed-off-by: Christian Marangi --- tools/squashfs4/Makefile | 10 +- ...mksquashfs-use-st_atimespec-on-macOS.patch | 25 +++++ ...-create-duplicate-virtual-real-disk-.patch | 101 ------------------ 3 files changed, 30 insertions(+), 106 deletions(-) create mode 100644 tools/squashfs4/patches/0001-fix-mksquashfs-use-st_atimespec-on-macOS.patch delete mode 100644 tools/squashfs4/patches/0001-mksquashfs-don-t-create-duplicate-virtual-real-disk-.patch diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile index 43891a1d5d..57cf78594d 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.4 -PKG_RELEASE=2 +PKG_VERSION:=4.7.5 +PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools -PKG_SOURCE_DATE:=2025-11-10 -PKG_SOURCE_VERSION:=53e5a67aac42e0bc9ad4a249156d7d549ce7436c -PKG_MIRROR_HASH:=7ce390d95af4b7b4ce768cec18aeb9ac61b8ca413d0ced2c42a81446d9dd8690 +PKG_SOURCE_DATE:=2026-03-02 +PKG_SOURCE_VERSION:=708c59ae80853b0845017c33b42e56061cc546cd +PKG_MIRROR_HASH:=504dbc8e6709ac904c4e6929ebba6f88c125b2b9775371f0cd5d9967bfba89e1 HOST_BUILD_PARALLEL:=1 diff --git a/tools/squashfs4/patches/0001-fix-mksquashfs-use-st_atimespec-on-macOS.patch b/tools/squashfs4/patches/0001-fix-mksquashfs-use-st_atimespec-on-macOS.patch new file mode 100644 index 0000000000..cf1488d2e1 --- /dev/null +++ b/tools/squashfs4/patches/0001-fix-mksquashfs-use-st_atimespec-on-macOS.patch @@ -0,0 +1,25 @@ +From f88f4a659d6ab432a57e90fe2f6191149c6b343f Mon Sep 17 00:00:00 2001 +From: Rui Chen +Date: Sun, 1 Mar 2026 22:10:34 -0500 +Subject: [PATCH] fix(mksquashfs): use st_atimespec on macOS + +Darwin struct stat does not expose st_atim. Use st_atimespec on macOS while keeping existing behavior on other platforms. + +Signed-off-by: Rui Chen +--- + squashfs-tools/mksquashfs.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -3372,7 +3372,9 @@ static struct inode_info *lookup_inode4( + * lazytime or relatime and the file has been created or + * modified since the last access. + */ +-#ifdef st_atime ++#ifdef __APPLE__ ++ memset(&buf->st_atimespec, 0, sizeof(buf->st_atimespec)); ++#elif defined(st_atime) + memset(&buf->st_atim, 0, sizeof(buf->st_atim)); + #else + memset(&buf->st_atime, 0, sizeof(buf->st_atime)); diff --git a/tools/squashfs4/patches/0001-mksquashfs-don-t-create-duplicate-virtual-real-disk-.patch b/tools/squashfs4/patches/0001-mksquashfs-don-t-create-duplicate-virtual-real-disk-.patch deleted file mode 100644 index 5f2d7ad7bd..0000000000 --- a/tools/squashfs4/patches/0001-mksquashfs-don-t-create-duplicate-virtual-real-disk-.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 767d44ceff8fc8e1e7a47a0bcafdcc40eaeb6503 Mon Sep 17 00:00:00 2001 -From: Phillip Lougher -Date: Thu, 8 Jan 2026 01:20:40 +0000 -Subject: [PATCH] mksquashfs: don't create duplicate virtual -> real disk - mappings - -This bug is caused by commit 472588dc40292fa3d047369f1e758016a6b26e70, -but it is exposed by commit 078529915caab11e85299aac1304671151d507a3. - -The first commit adds a virtual -> real disk mapping in cases where a -multi-block file contains all sparse blocks. In this case no data -block has been written for this file, and it may mean no virtual -> real -disk mapping will exist otherwise. - -However, a side effect of this is two duplicate virtual -> real disk -mappings may be created, with different values. - -Now previously before commit 078529915caab11e85299aac1304671151d507a3, -Mksquashfs waited for all outstanding data blocks to be processed by the -orderer thread before creating the metadata. At this point all the -duplicate virtual -> real disk mappings will exist, and the lookup -routine will return the last one created - which happens to be the -correct one. - -After commit 078529915caab11e85299aac1304671151d507a3, Mksquashfs no -longer waits for all outstanding data blocks to be processed by the -orderer thread, which means when the lookup takes place in metadata -creation, there may exist only the first wrong duplicate, which will be -returned. Obviously there may exist both duplicate values in which case -the correct one will be returned. In other words this is a race -condition, and it is highly dependent on hardware and input data -whether it triggers. - -The fix is to increment the virtual disk position after creating a -mapping when a multi-block file contains all sparse blocks. This -obviously prevents duplicate mappings from being created. - -Fixes https://github.com/plougher/squashfs-tools/issues/339 - -Signed-off-by: Phillip Lougher ---- - squashfs-tools/mksquashfs.c | 12 +++++++++--- - squashfs-tools/virt_disk_pos.h | 9 +++++++++ - 2 files changed, 18 insertions(+), 3 deletions(-) - ---- a/squashfs-tools/mksquashfs.c -+++ b/squashfs-tools/mksquashfs.c -@@ -2923,8 +2923,10 @@ static struct file_info *write_file_proc - fragment_buffer ? fragment_buffer->checksum : 0, FALSE, - TRUE); - -- if(!is_vpos_marked()) -+ if(!is_vpos_marked()) { - send_orderer_create_map(get_marked_vpos()); -+ inc_vpos(); -+ } - - gen_cache_block_put(fragment_buffer); - file_count ++; -@@ -3027,8 +3029,10 @@ static struct file_info *write_file_bloc - if(buffer_list[block]) - put_write_buffer_hash(buffer_list[block]); - -- if(!is_vpos_marked()) -+ if(!is_vpos_marked()) { - send_orderer_create_map(get_marked_vpos()); -+ inc_vpos(); -+ } - } else { - for(block = thresh; block < blocks; block ++) - gen_cache_block_put(buffer_list[block]); -@@ -3140,8 +3144,10 @@ static struct file_info *write_file_bloc - block_list, get_marked_vpos(), fragment, 0, fragment_buffer ? - fragment_buffer->checksum : 0, FALSE, TRUE); - -- if(!is_vpos_marked()) -+ if(!is_vpos_marked()) { - send_orderer_create_map(get_marked_vpos()); -+ inc_vpos(); -+ } - - gen_cache_block_put(fragment_buffer); - file_count ++; ---- a/squashfs-tools/virt_disk_pos.h -+++ b/squashfs-tools/virt_disk_pos.h -@@ -96,6 +96,15 @@ static inline long long get_and_inc_vpos - } - - -+static inline void inc_vpos() -+{ -+ if(marked_vpos == 0) -+ BAD_ERROR("BUG: Saved write position is empty!\n"); -+ -+ vpos ++; -+} -+ -+ - static inline int reset_vpos(void) - { - if(marked_vpos == 0)