Browse Source

zfs: update to 2.4.2

Waldemar Brodkorb 3 months ago
parent
commit
73912af12d

+ 11 - 9
package/zfs/Makefile

@@ -4,18 +4,20 @@
 include $(ADK_TOPDIR)/rules.mk
 
 PKG_NAME:=		zfs
-PKG_VERSION:=		2.2.6
+PKG_VERSION:=		2.4.2
 PKG_RELEASE:=		1
-PKG_HASH:=		c92e02103ac5dd77bf01d7209eabdca55c7b3356aa747bb2357ec4222652a2a7
-PKG_DESCR:=		Advanced file system and volume manager
+PKG_HASH:=		7e260d0e6af295bea4c5e241cac0a1aef07b58d8dd8035f7898ade3b1bbec78f
+PKG_DESCR:=		advanced file system and volume manager
 PKG_SECTION:=		sys/fs
-PKG_DEPENDS:=		libcurl
+PKG_DEPENDS:=		libcurl libuuid libblkid libtirpc
+PKG_BUILDDEP:=		util-linux curl libtirpc
+# needs zlib-deflate and zlib-enflate which are otherwise optimized out by miniconfig procedure
+# use crpyto-deflate instead
+PKG_KDEPENDS:=		crypto-deflate
+PKG_NEEDS:=		intl
 PKG_URL:=		https://openzfs.org
 PKG_SITES:=		https://github.com/openzfs/zfs/releases/download/${PKG_NAME}-${PKG_VERSION}/
 
-# needs a older kernel then 6.10
-PKG_CFLINE_ZFS:=	depends on ADK_BROKEN
-
 DISTFILES:=             $(PKG_NAME)-$(PKG_VERSION).tar.gz
 
 PKG_SUBPKGS:=		ZFS ZFS_TESTS
@@ -30,8 +32,8 @@ include ${ADK_TOPDIR}/mk/kernel-vars.mk
 $(eval $(call PKG_template,ZFS,zfs,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
 $(eval $(call PKG_template,ZFS_TESTS,zfs-tests,$(PKG_VERSION)-$(PKG_RELEASE),$(PKGSS_ZFS_TESTS),$(PKGSD_ZFS_TESTS),$(PKGSC_ZFS_TESTS)))
 
-AUTOTOOL_STYLE:=	autoreconf
-CONFIGURE_ARGS+=	--with-linux=${LINUX_DIR} --without-python
+CONFIGURE_ARGS+=	--with-linux=${LINUX_DIR} \
+			--without-python
 CONFIGURE_ENV+=		KERNEL_CC="${TARGET_CC}" \
 			KERNEL_CROSS_COMPILE="${TARGET_CROSS}" \
 			KERNEL_ARCH="${ADK_TARGET_KARCH}"

+ 0 - 53
package/zfs/patches/0001-Support-for-cross-compiling-kernel-modules.patch

@@ -1,53 +0,0 @@
-From 1d566bf169297faba7afbe59df151ac479b234d5 Mon Sep 17 00:00:00 2001
-From: Phil Sutter <phil@nwl.cc>
-Date: Fri, 3 Jan 2025 16:30:24 +0100
-Subject: [PATCH] Support for cross-compiling kernel modules
-
-In order to correctly cross-compile, one has to pass ARCH and
-CROSS_COMPILE make flags to kernel module build calls. Facilitate this
-in the same way as for custom CC flag by recognizing KERNEL_-prefixed
-configure environment variables of same name.
-
-Signed-off-by: Phil Sutter <phil@nwl.cc>
----
- config/kernel.m4   | 5 +++++
- module/Makefile.in | 2 ++
- 2 files changed, 7 insertions(+)
-
-diff --git a/config/kernel.m4 b/config/kernel.m4
-index 173c78a2a561a..c0a8355945dce 100644
---- a/config/kernel.m4
-+++ b/config/kernel.m4
-@@ -663,11 +663,16 @@ AC_DEFUN([ZFS_LINUX_COMPILE], [
- 		building kernel modules])
- 	AC_ARG_VAR([KERNEL_LLVM], [Binary option to
- 		build kernel modules with LLVM/CLANG toolchain])
-+	AC_ARG_VAR([KERNEL_CROSS_COMPILE], [Cross compile prefix
-+		for kernel module builds])
-+	AC_ARG_VAR([KERNEL_ARCH], [Architecture to build kernel modules for])
- 	AC_TRY_COMMAND([
- 	    KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6"
- 	    make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC}
- 	    ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM}
- 	    CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES
-+	    ${KERNEL_CROSS_COMPILE:+CROSS_COMPILE=$KERNEL_CROSS_COMPILE}
-+	    ${KERNEL_ARCH:+ARCH=$KERNEL_ARCH}
- 	    -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1])
- 	AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4])
- ])
-diff --git a/module/Makefile.in b/module/Makefile.in
-index b6338430e8125..b6e3c8e88ccac 100644
---- a/module/Makefile.in
-+++ b/module/Makefile.in
-@@ -54,6 +54,8 @@ FMAKE = env -u MAKEFLAGS make $(FMAKEFLAGS)
- 	list='$(SUBDIR_TARGETS)'; for td in $$list; do $(MAKE) -C $$td; done
- 	$(MAKE) -C @LINUX_OBJ@ $(if @KERNEL_CC@,CC=@KERNEL_CC@) \
- 		$(if @KERNEL_LD@,LD=@KERNEL_LD@) $(if @KERNEL_LLVM@,LLVM=@KERNEL_LLVM@) \
-+		$(if @KERNEL_CROSS_COMPILE@,CROSS_COMPILE=@KERNEL_CROSS_COMPILE@) \
-+		$(if @KERNEL_ARCH@,ARCH=@KERNEL_ARCH@) \
- 		M="$$PWD" @KERNEL_MAKE@ CONFIG_ZFS=m modules
- 
- modules-FreeBSD:
--- 
-2.43.0
-

+ 49 - 0
package/zfs/patches/0001-tests-zfs-tests-cmd-statx.c-avoid-statx-conflicts.patch

@@ -0,0 +1,49 @@
+From d363aafe0a773cd55890a385694cf05cb6225c5a Mon Sep 17 00:00:00 2001
+From: Julien Olivain <ju.o@free.fr>
+Date: Sun, 15 Mar 2026 13:18:07 +0100
+Subject: [PATCH] tests/zfs-tests/cmd/statx.c: avoid statx() conflicts
+
+With some libc, such as uclibc >= 1.0.57, the libc defines the statx()
+function, while also internally including <sys/stat.h> (from <fcntl.h>
+from example), which results to a compilation error due to conflicting
+types.
+
+This commit fixes the issue by only defining the statx() prototype only
+if the libc was detected not to have a working statx() wrapper, and
+explicitly include the <sys/stat.h> otherwise.
+
+Upstream: Discussed in: https://github.com/openzfs/zfs/pull/18316#issuecomment-4062904581
+Signed-off-by: Julien Olivain <ju.o@free.fr>
+---
+ tests/zfs-tests/cmd/statx.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/tests/zfs-tests/cmd/statx.c b/tests/zfs-tests/cmd/statx.c
+index 1acc7e58c..c292fdbdf 100644
+--- a/tests/zfs-tests/cmd/statx.c
++++ b/tests/zfs-tests/cmd/statx.c
+@@ -34,6 +34,9 @@
+  * statx() may be available in the kernel, but not in the libc, so we build
+  * our own wrapper if we can't link one.
+  */
++#ifdef HAVE_STATX
++#include <sys/stat.h>
++#endif
+ 
+ #ifndef __NR_statx
+ #if defined(__x86_64__)
+@@ -54,9 +57,11 @@
+ #endif /* __NR_statx */
+ 
+ 
++#ifndef HAVE_STATX
+ int
+ statx(int, const char *, int, unsigned int, void *)
+     __attribute__((weak));
++#endif
+ 
+ static inline int
+ _statx(int fd, const char *path, int flags, unsigned int mask, void *stx)
+-- 
+2.53.0
+