[openwrt/openwrt] tools/squashfs4: fix compile on Alpine Linux

LEDE Commits lede-commits at lists.infradead.org
Thu Jul 3 02:23:43 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/7f939d99e771250f16e87e687540caecbec7e9c7

commit 7f939d99e771250f16e87e687540caecbec7e9c7
Author: Rany Hany <rany_hany at riseup.net>
AuthorDate: Wed Jul 2 16:53:39 2025 +0000

    tools/squashfs4: fix compile on Alpine Linux
    
    This backports upstream commit 05a895b3f996[1] to fix
    compilation when using musl on the host machine.
    
    [1]: https://github.com/plougher/squashfs-tools/commit/05a895b3f996d1ac157d95b04980f5f047e7dbf7
    
    Signed-off-by: Rany Hany <rany_hany at riseup.net>
    Link: https://github.com/openwrt/openwrt/pull/19285
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 tools/squashfs4/Makefile                           |  2 +-
 .../002-print_pager-add-missing-includes.patch     | 34 ++++++++++++++++++++++
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile
index 27aa1fa653..910502114b 100644
--- a/tools/squashfs4/Makefile
+++ b/tools/squashfs4/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=squashfs4
 PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs
 PKG_VERSION:=4.7.0
-PKG_RELEASE=1
+PKG_RELEASE=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
diff --git a/tools/squashfs4/patches/002-print_pager-add-missing-includes.patch b/tools/squashfs4/patches/002-print_pager-add-missing-includes.patch
new file mode 100644
index 0000000000..4e29c1e2f5
--- /dev/null
+++ b/tools/squashfs4/patches/002-print_pager-add-missing-includes.patch
@@ -0,0 +1,34 @@
+From 05a895b3f996d1ac157d95b04980f5f047e7dbf7 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton at arm.com>
+Date: Fri, 6 Jun 2025 15:23:07 +0100
+Subject: [PATCH] print_pager: add missing includes
+
+When building with musl:
+
+  print_pager.h:33:25: error: unknown type name 'pid_t'
+     33 | extern void wait_to_die(pid_t process);
+        |                         ^~~~~
+  print_pager.h:34:25: error: unknown type name 'pid_t'
+     34 | extern FILE *exec_pager(pid_t *process);
+        |                         ^~~~~
+
+print_pager.h uses pid_t and FILE, so add the required #includes to
+ensure that these are defined.
+
+Signed-off-by: Ross Burton <ross.burton at arm.com>
+---
+ squashfs-tools/print_pager.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/squashfs-tools/print_pager.h
++++ b/squashfs-tools/print_pager.h
+@@ -30,6 +30,9 @@
+ #define MORE_PAGER 2
+ #define UNKNOWN_PAGER 3
+ 
++#include <stdio.h>
++#include <sys/types.h>
++
+ extern void wait_to_die(pid_t process);
+ extern FILE *exec_pager(pid_t *process);
+ extern int get_column_width();




More information about the lede-commits mailing list