From 109e4e82810868a11c972c088d2e775c5ffd9c84 Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Mon, 31 Jul 2023 10:29:20 -0500 Subject: [PATCH 1/2] zfs: update to 2.2.0. --- .../zfs/patches/0002-fix-dracut-root.patch | 56 ------------------- srcpkgs/zfs/template | 15 +++-- 2 files changed, 10 insertions(+), 61 deletions(-) delete mode 100644 srcpkgs/zfs/patches/0002-fix-dracut-root.patch diff --git a/srcpkgs/zfs/patches/0002-fix-dracut-root.patch b/srcpkgs/zfs/patches/0002-fix-dracut-root.patch deleted file mode 100644 index 384f08355f73f..0000000000000 --- a/srcpkgs/zfs/patches/0002-fix-dracut-root.patch +++ /dev/null @@ -1,56 +0,0 @@ -From eefe83eaa68f7cb4a49c580dd940d3688e42c849 Mon Sep 17 00:00:00 2001 -From: Toyam Cox -Date: Thu, 30 Jun 2022 13:47:58 -0400 -Subject: [PATCH] dracut: fix boot on non-zfs-root systems - -Simply prevent overwriting root until it needs to be overwritten. - -Dracut could change this value before this module is called, but won't -change the kernel command line. - -Reviewed-by: Andrew J. Hesford -Signed-off-by: Toyam Cox -Closes #13592 ---- - contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in -index e44673c2d75..3a43e514d6f 100755 ---- a/contrib/dracut/90zfs/zfs-lib.sh.in -+++ b/contrib/dracut/90zfs/zfs-lib.sh.in -@@ -88,11 +88,11 @@ decode_root_args() { - return - fi - -- root=$(getarg root=) -+ xroot=$(getarg root=) - rootfstype=$(getarg rootfstype=) - - # shellcheck disable=SC2249 -- case "$root" in -+ case "$xroot" in - ""|zfs|zfs:|zfs:AUTO) - root=zfs:AUTO - rootfstype=zfs -@@ -100,7 +100,7 @@ decode_root_args() { - ;; - - ZFS=*|zfs:*) -- root="${root#zfs:}" -+ root="${xroot#zfs:}" - root="${root#ZFS=}" - root=$(echo "$root" | tr '+' ' ') - rootfstype=zfs -@@ -109,9 +109,9 @@ decode_root_args() { - esac - - if [ "$rootfstype" = "zfs" ]; then -- case "$root" in -+ case "$xroot" in - "") root=zfs:AUTO ;; -- *) root=$(echo "$root" | tr '+' ' ') ;; -+ *) root=$(echo "$xroot" | tr '+' ' ') ;; - esac - return 0 - fi diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template index 496999fc50fa6..e5194a290c95c 100644 --- a/srcpkgs/zfs/template +++ b/srcpkgs/zfs/template @@ -1,7 +1,7 @@ # Template file for 'zfs' pkgname=zfs -version=2.1.12 -revision=2 +version=2.2.0 +revision=1 build_style=gnu-configure configure_args="--with-config=user --with-mounthelperdir=/usr/bin --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d @@ -10,13 +10,13 @@ hostmakedepends="dracut libtool pkg-config python3 automake" makedepends="pam-devel zlib-devel libuuid-devel libblkid-devel libtirpc-devel attr-devel" depends="dkms>=2.2.0.3_9 perl python3 xbps-triggers>=0.121_1 libzfs>=${version}_${revision}" -conf_files="/etc/zfs/zed.d/zed.rc" +conf_files="/etc/zfs/zed.d/zed.rc /usr/src/zfs-${version}/META" short_desc="Z File System -- userland, pyzfs, and kernel modules (using DKMS)" maintainer="Toyam Cox " license="CDDL-1.0" homepage="https://openzfs.github.io/openzfs-docs/" -distfiles="https://github.com/openzfs/zfs/releases/download/zfs-${version}/zfs-${version}.tar.gz" -checksum=64daa26aed3e12c931f6f4413d7527c4ebdb8da35416b356152b5f9fdd4c6e6d +distfiles="https://github.com/openzfs/zfs/releases/download/zfs-${version}-rc4/zfs-${version}-rc4.tar.gz" +checksum=276c911ab4aa24b5c261e1e1822f74ed824a424cacf3f39b14da1aa08ce1906c # dkms must be before initramfs-regenerate to build modules before images triggers="dkms initramfs-regenerate" dkms_modules="zfs ${version}" @@ -55,6 +55,11 @@ post_install() { # Contains ELF binaries. Remove it until upstream has a way to move this # into /usr/libexec or similiar. rm -rf ${DESTDIR}/usr/share/zfs/zfs-tests + + # move bash completions to a policy compliant directory + vmkdir usr/share/bash-completion/completions + mv ${DESTDIR}/etc/bash_completion.d/* \ + ${DESTDIR}/usr/share/bash-completion/completions } libzfs_package() { From c94b37b32a7207f8204630f6db7bd698d3a21598 Mon Sep 17 00:00:00 2001 From: Zach Dykstra Date: Wed, 23 Aug 2023 14:28:12 -0500 Subject: [PATCH 2/2] New package: zfs-lts-2.1.12. --- srcpkgs/libzfs-lts | 1 + srcpkgs/zfs-lts-devel | 1 + srcpkgs/zfs-lts-pam | 1 + srcpkgs/zfs-lts/files/zed/run | 4 + ...1-only-build-the-module-in-dkms.conf.patch | 44 +++++++++ .../patches/0002-fix-dracut-root.patch | 56 +++++++++++ srcpkgs/zfs-lts/template | 92 +++++++++++++++++++ srcpkgs/zfs-lts/update | 1 + srcpkgs/zfs/template | 4 + 9 files changed, 204 insertions(+) create mode 120000 srcpkgs/libzfs-lts create mode 120000 srcpkgs/zfs-lts-devel create mode 120000 srcpkgs/zfs-lts-pam create mode 100755 srcpkgs/zfs-lts/files/zed/run create mode 100644 srcpkgs/zfs-lts/patches/0001-only-build-the-module-in-dkms.conf.patch create mode 100644 srcpkgs/zfs-lts/patches/0002-fix-dracut-root.patch create mode 100644 srcpkgs/zfs-lts/template create mode 100644 srcpkgs/zfs-lts/update diff --git a/srcpkgs/libzfs-lts b/srcpkgs/libzfs-lts new file mode 120000 index 0000000000000..083c9d5fe6b00 --- /dev/null +++ b/srcpkgs/libzfs-lts @@ -0,0 +1 @@ +zfs-lts \ No newline at end of file diff --git a/srcpkgs/zfs-lts-devel b/srcpkgs/zfs-lts-devel new file mode 120000 index 0000000000000..083c9d5fe6b00 --- /dev/null +++ b/srcpkgs/zfs-lts-devel @@ -0,0 +1 @@ +zfs-lts \ No newline at end of file diff --git a/srcpkgs/zfs-lts-pam b/srcpkgs/zfs-lts-pam new file mode 120000 index 0000000000000..083c9d5fe6b00 --- /dev/null +++ b/srcpkgs/zfs-lts-pam @@ -0,0 +1 @@ +zfs-lts \ No newline at end of file diff --git a/srcpkgs/zfs-lts/files/zed/run b/srcpkgs/zfs-lts/files/zed/run new file mode 100755 index 0000000000000..63deda22b506b --- /dev/null +++ b/srcpkgs/zfs-lts/files/zed/run @@ -0,0 +1,4 @@ +#!/bin/sh +exec 2>&1 +[ -r conf ] && . conf +exec zed -F $OPTS diff --git a/srcpkgs/zfs-lts/patches/0001-only-build-the-module-in-dkms.conf.patch b/srcpkgs/zfs-lts/patches/0001-only-build-the-module-in-dkms.conf.patch new file mode 100644 index 0000000000000..944618bb86c1f --- /dev/null +++ b/srcpkgs/zfs-lts/patches/0001-only-build-the-module-in-dkms.conf.patch @@ -0,0 +1,44 @@ +# Patch adapted from +# +# https://aur.archlinux.org/cgit/aur.git/tree/0001-only-build-the-module-in-dkms.conf.patch?h=zfs-dkms +# +# rebased for zfs-2.1.5. +# +# Avoids recompiling ZFS userland utilities with DKMS rebuilds +From b4a2c0b184c9c9599421b15a430fb88deb5dbd17 Mon Sep 17 00:00:00 2001 +From: Eli Schwartz +Date: Sun, 28 Oct 2018 15:01:58 -0400 +Subject: [PATCH] only build the module in dkms.conf + +--- + scripts/dkms.mkconf | 19 ++----------------- + 1 file changed, 2 insertions(+), 17 deletions(-) + +diff --git a/scripts/dkms.mkconf b/scripts/dkms.mkconf +--- a/scripts/dkms.mkconf ++++ b/scripts/dkms.mkconf +@@ -28,14 +28,7 @@ + PRE_BUILD="configure + --prefix=/usr + --with-config=kernel +- --with-linux=\$( +- if [ -e "\${kernel_source_dir/%build/source}" ] +- then +- echo "\${kernel_source_dir/%build/source}" +- else +- echo "\${kernel_source_dir}" +- fi +- ) ++ --with-linux="\${kernel_source_dir}" + --with-linux-obj="\${kernel_source_dir}" + \$( + [[ -n \"\${ICP_ROOT}\" ]] && \\ +@@ -68,7 +61,7 @@ + -t \${dkms_tree} + " + AUTOINSTALL="yes" +-MAKE[0]="make" ++MAKE[0]="make -C module/" + STRIP[0]="\$( + [[ -r \${PACKAGE_CONFIG} ]] \\ + && source \${PACKAGE_CONFIG} \\ diff --git a/srcpkgs/zfs-lts/patches/0002-fix-dracut-root.patch b/srcpkgs/zfs-lts/patches/0002-fix-dracut-root.patch new file mode 100644 index 0000000000000..384f08355f73f --- /dev/null +++ b/srcpkgs/zfs-lts/patches/0002-fix-dracut-root.patch @@ -0,0 +1,56 @@ +From eefe83eaa68f7cb4a49c580dd940d3688e42c849 Mon Sep 17 00:00:00 2001 +From: Toyam Cox +Date: Thu, 30 Jun 2022 13:47:58 -0400 +Subject: [PATCH] dracut: fix boot on non-zfs-root systems + +Simply prevent overwriting root until it needs to be overwritten. + +Dracut could change this value before this module is called, but won't +change the kernel command line. + +Reviewed-by: Andrew J. Hesford +Signed-off-by: Toyam Cox +Closes #13592 +--- + contrib/dracut/90zfs/zfs-lib.sh.in | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/contrib/dracut/90zfs/zfs-lib.sh.in b/contrib/dracut/90zfs/zfs-lib.sh.in +index e44673c2d75..3a43e514d6f 100755 +--- a/contrib/dracut/90zfs/zfs-lib.sh.in ++++ b/contrib/dracut/90zfs/zfs-lib.sh.in +@@ -88,11 +88,11 @@ decode_root_args() { + return + fi + +- root=$(getarg root=) ++ xroot=$(getarg root=) + rootfstype=$(getarg rootfstype=) + + # shellcheck disable=SC2249 +- case "$root" in ++ case "$xroot" in + ""|zfs|zfs:|zfs:AUTO) + root=zfs:AUTO + rootfstype=zfs +@@ -100,7 +100,7 @@ decode_root_args() { + ;; + + ZFS=*|zfs:*) +- root="${root#zfs:}" ++ root="${xroot#zfs:}" + root="${root#ZFS=}" + root=$(echo "$root" | tr '+' ' ') + rootfstype=zfs +@@ -109,9 +109,9 @@ decode_root_args() { + esac + + if [ "$rootfstype" = "zfs" ]; then +- case "$root" in ++ case "$xroot" in + "") root=zfs:AUTO ;; +- *) root=$(echo "$root" | tr '+' ' ') ;; ++ *) root=$(echo "$xroot" | tr '+' ' ') ;; + esac + return 0 + fi diff --git a/srcpkgs/zfs-lts/template b/srcpkgs/zfs-lts/template new file mode 100644 index 0000000000000..50533a2a12573 --- /dev/null +++ b/srcpkgs/zfs-lts/template @@ -0,0 +1,92 @@ +# Template file for 'zfs-lts' +pkgname=zfs-lts +version=2.1.12 +revision=1 +build_style=gnu-configure +configure_args="--with-config=user --with-mounthelperdir=/usr/bin + --with-udevdir=/usr/lib/udev --with-udevruledir=/usr/lib/udev/rules.d + --with-dracutdir=/usr/lib/dracut --with-tirpc" +hostmakedepends="dracut libtool pkg-config python3 automake" +makedepends="pam-devel zlib-devel libuuid-devel libblkid-devel libtirpc-devel attr-devel" +depends="dkms>=2.2.0.3_9 perl python3 xbps-triggers>=0.121_1 + libzfs>=${version}_${revision}" +conf_files="/etc/zfs/zed.d/zed.rc" +short_desc="Z File System -- userland, pyzfs, and kernel modules (using DKMS)" +maintainer="Toyam Cox " +license="CDDL-1.0" +homepage="https://openzfs.github.io/openzfs-docs/" +distfiles="https://github.com/openzfs/zfs/releases/download/zfs-${version}/zfs-${version}.tar.gz" +checksum=64daa26aed3e12c931f6f4413d7527c4ebdb8da35416b356152b5f9fdd4c6e6d +# dkms must be before initramfs-regenerate to build modules before images +triggers="dkms initramfs-regenerate" +dkms_modules="zfs ${version}" + +replaces="spl<=0.7.13_1" # Because SPL was merged into zfs in 0.8.0 +conflicts="zfs" + +pre_configure() { + export CFLAGS+=" -I${XBPS_CROSS_BASE}/usr/include/tirpc/" + autoreconf -fi +} + +post_install() { + vlicense COPYRIGHT + vlicense LICENSE + vlicense NOTICE + + vsv zed + + make dist-gzip + vmkdir usr/src/ + tar xf ${pkgname/%-lts}-${version}.tar.gz -C ${DESTDIR}/usr/src/ + scripts/dkms.mkconf -v ${version} -f ${DESTDIR}/usr/src/${pkgname/%-lts}-${version}/dkms.conf -n zfs + + # Remove init and service control pieces not used in Void + rm -rf ${DESTDIR}/usr/lib/systemd + rm -rf ${DESTDIR}/etc/init.d + rm -rf ${DESTDIR}/etc/default + rm -f ${DESTDIR}/etc/zfs/zfs-functions + + # Remove pam config framework file not used in Void + rm -f ${DESTDIR}/usr/share/pam-configs/zfs_key + + # zfs-mount-generator is a systemd helper, no need for its man page + rm -f ${DESTDIR}/usr/share/man/man8/zfs-mount-generator.8 + + # Contains ELF binaries. Remove it until upstream has a way to move this + # into /usr/libexec or similiar. + rm -rf ${DESTDIR}/usr/share/zfs/zfs-tests +} + +libzfs-lts_package() { + short_desc="Z File System - libraries" + conflicts="libzfs" + pkg_install() { + vmove "usr/lib/*.so.*" + } +} + +zfs-lts-devel_package() { + depends="libzfs>=${version}_${revision}" + short_desc="Z File System -- development files" + conflicts="zfs-devel" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + } +} + +zfs-lts-pam_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc="Z File System -- PAM integration" + conflicts="zfs-pam" + pkg_install() { + vmove usr/lib/security/pam_zfs_key.so + } +} + +# REMARKS: +# Did not split out pyzfs, because it's distributed with zfs, and no reason to +# send separately. diff --git a/srcpkgs/zfs-lts/update b/srcpkgs/zfs-lts/update new file mode 100644 index 0000000000000..5c99eb844abc0 --- /dev/null +++ b/srcpkgs/zfs-lts/update @@ -0,0 +1 @@ +ignore="2.1.99" diff --git a/srcpkgs/zfs/template b/srcpkgs/zfs/template index e5194a290c95c..b18d46acb1e2d 100644 --- a/srcpkgs/zfs/template +++ b/srcpkgs/zfs/template @@ -22,6 +22,7 @@ triggers="dkms initramfs-regenerate" dkms_modules="zfs ${version}" replaces="spl<=0.7.13_1" # Because SPL was merged into zfs in 0.8.0 +conflicts="zfs-lts" pre_configure() { export CFLAGS+=" -I${XBPS_CROSS_BASE}/usr/include/tirpc/" @@ -64,6 +65,7 @@ post_install() { libzfs_package() { short_desc="Z File System - libraries" + conflicts="libzfs-lts" pkg_install() { vmove "usr/lib/*.so.*" } @@ -72,6 +74,7 @@ libzfs_package() { zfs-devel_package() { depends="libzfs>=${version}_${revision}" short_desc="Z File System -- development files" + conflicts="zfs-lts-devel" pkg_install() { vmove usr/include vmove "usr/lib/*.a" @@ -83,6 +86,7 @@ zfs-devel_package() { zfs-pam_package() { depends="${sourcepkg}>=${version}_${revision}" short_desc="Z File System -- PAM integration" + conflicts="zfs-lts-pam" pkg_install() { vmove usr/lib/security/pam_zfs_key.so }