From 60cc35abae02e10f84f981fe4031092d4a9c75b6 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 14 Jan 2025 17:21:09 -0500 Subject: [PATCH 1/2] zfs: remove code for obsolete versions In cbc50da11c2dfb45d3ddfe352f24d49c3be81822, ZFS 2.1 was removed, this removes conditional parts of the build only needed for 2.1 and older. --- pkgs/os-specific/linux/zfs/generic.nix | 29 +------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index ad6fd902c682..e00db1d6229e 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -58,7 +58,6 @@ let optionals optional makeBinPath - versionAtLeast ; smartmon = smartmontools.override { inherit enableMail; }; @@ -71,7 +70,6 @@ let "user" "all" ]; - isAtLeast22Series = versionAtLeast version "2.2.0"; # XXX: You always want to build kernel modules with the same stdenv as the # kernel was built with. However, since zfs can also be built for userspace we @@ -121,8 +119,7 @@ let --replace-fail "/etc/default" "$out/etc/default" substituteInPlace ./contrib/initramfs/Makefile.am \ --replace-fail "/usr/share/initramfs-tools" "$out/usr/share/initramfs-tools" - '' - + optionalString isAtLeast22Series '' + substituteInPlace ./udev/vdev_id \ --replace-fail "PATH=/bin:/sbin:/usr/bin:/usr/sbin" \ "PATH=${ @@ -140,24 +137,6 @@ let "bashcompletiondir=$out/share/bash-completion/completions" substituteInPlace ./cmd/arc_summary --replace-fail "/sbin/modinfo" "modinfo" - '' - + optionalString (!isAtLeast22Series) '' - substituteInPlace ./etc/zfs/Makefile.am --replace-fail "\$(sysconfdir)/zfs" "$out/etc/zfs" - - find ./contrib/initramfs -name Makefile.am -exec sed -i -e 's|/usr/share/initramfs-tools|'$out'/share/initramfs-tools|g' {} \; - - substituteInPlace ./cmd/arc_summary/arc_summary3 --replace-fail "/sbin/modinfo" "modinfo" - substituteInPlace ./cmd/vdev_id/vdev_id \ - --replace-fail "PATH=/bin:/sbin:/usr/bin:/usr/sbin" \ - "PATH=${ - makeBinPath [ - coreutils - gawk - gnused - gnugrep - systemd - ] - }" ''; nativeBuildInputs = @@ -260,12 +239,6 @@ let # Remove tests because they add a runtime dependency on gcc rm -rf $out/share/zfs/zfs-tests - - ${optionalString (lib.versionOlder version "2.2") '' - # Add Bash completions. - install -v -m444 -D -t $out/share/bash-completion/completions contrib/bash_completion.d/zfs - (cd $out/share/bash-completion/completions; ln -s zfs zpool) - ''} ''; postFixup = From 5094795c607de240f689ff38787fe58d3b71ed55 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Tue, 14 Jan 2025 13:20:55 -0500 Subject: [PATCH 2/2] zfs: 2.2.7 -> 2.3.0 zfs_2_3 is already packaged, this just changes the default version. --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 42d2f8e9ef91..919d241f3f4b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12564,7 +12564,7 @@ with pkgs; zfs_2_2 zfs_2_3 zfs_unstable; - zfs = zfs_2_2; + zfs = zfs_2_3; ### DATA