diff --git a/nixos/tests/zfs.nix b/nixos/tests/zfs.nix index 851fced2c5e1ec6..26a045f3e69818f 100644 --- a/nixos/tests/zfs.nix +++ b/nixos/tests/zfs.nix @@ -213,8 +213,8 @@ in { enableSystemdStage1 = true; }; - installerBoot = (import ./installer.nix { }).separateBootZfs; - installer = (import ./installer.nix { }).zfsroot; + installerBoot = (import ./installer.nix { inherit system; }).separateBootZfs; + installer = (import ./installer.nix { inherit system; }).zfsroot; expand-partitions = makeTest { name = "multi-disk-zfs"; diff --git a/pkgs/os-specific/linux/zfs/2_1.nix b/pkgs/os-specific/linux/zfs/2_1.nix index 97173a5154a592a..d950f5cac15d23f 100644 --- a/pkgs/os-specific/linux/zfs/2_1.nix +++ b/pkgs/os-specific/linux/zfs/2_1.nix @@ -1,7 +1,6 @@ { callPackage , kernel ? null , stdenv -, linuxKernel , lib , nixosTests , ... @@ -15,9 +14,7 @@ callPackage ./generic.nix args { # this attribute is the correct one for this package. kernelModuleAttribute = "zfs_2_1"; # check the release notes for compatible kernels - kernelCompatible = kernel.kernelOlder "6.8"; - - latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_6; + kernelCompatible = kernel: kernel.kernelOlder "6.8"; # This is a fixed version to the 2.1.x series, move only # if the 2.1.x series moves. diff --git a/pkgs/os-specific/linux/zfs/2_2.nix b/pkgs/os-specific/linux/zfs/2_2.nix index 9e3fde0780f0bf7..befb83b2056909f 100644 --- a/pkgs/os-specific/linux/zfs/2_2.nix +++ b/pkgs/os-specific/linux/zfs/2_2.nix @@ -2,7 +2,6 @@ , kernel ? null , stdenv , lib -, linuxKernel , nixosTests , ... } @ args: @@ -15,12 +14,10 @@ callPackage ./generic.nix args { # this attribute is the correct one for this package. kernelModuleAttribute = "zfs_2_2"; # check the release notes for compatible kernels - kernelCompatible = kernel.kernelOlder "6.10"; - - latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_6; + kernelCompatible = kernel: kernel.kernelOlder "6.11"; # this package should point to the latest release. - version = "2.2.5"; + version = "2.2.6"; tests = [ nixosTests.zfs.installer @@ -29,5 +26,5 @@ callPackage ./generic.nix args { maintainers = with lib.maintainers; [ adamcstephens amarshall ]; - hash = "sha256-BkwcNPk+jX8CXp5xEVrg4THof7o/5j8RY2SY6+IPNTg="; + hash = "sha256-wkgoYg6uQOHVq8a9sJXzO/QXJ6q28l7JXWkC+BFvOb0="; } diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index a7264a3ded59d70..0973cd2a95c4b5e 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -2,6 +2,7 @@ let genericBuild = { pkgs, lib, stdenv, fetchFromGitHub, fetchpatch , autoreconfHook269, util-linux, nukeReferences, coreutils + , linuxKernel , perl , configFile ? "all" @@ -27,8 +28,6 @@ let , kernelModuleAttribute , extraPatches ? [] , rev ? "zfs-${version}" - , isUnstable ? false - , latestCompatibleLinuxPackages , kernelCompatible ? null , maintainers ? (with lib.maintainers; [ amarshall ]) , tests @@ -183,9 +182,11 @@ let # Remove tests because they add a runtime dependency on gcc rm -rf $out/share/zfs/zfs-tests - # 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) + ${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 = let @@ -199,7 +200,13 @@ let outputs = [ "out" ] ++ optionals buildUser [ "dev" ]; passthru = { - inherit enableMail latestCompatibleLinuxPackages kernelModuleAttribute; + inherit enableMail kernelModuleAttribute; + latestCompatibleLinuxPackages = lib.pipe linuxKernel.packages [ + builtins.attrValues + (builtins.filter (kPkgs: (builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname == "linux" && kernelCompatible kPkgs.kernel)) + (builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version))) + lib.last + ]; # The corresponding userspace tools to this instantiation # of the ZFS package set. userspaceTools = genericBuild (outerArgs // { @@ -236,7 +243,7 @@ let mainProgram = "zfs"; # If your Linux kernel version is not yet supported by zfs, try zfs_unstable. # On NixOS set the option `boot.zfs.package = pkgs.zfs_unstable`. - broken = buildKernel && (kernelCompatible != null) && !kernelCompatible; + broken = buildKernel && (kernelCompatible != null) && !(kernelCompatible kernel); }; }; in diff --git a/pkgs/os-specific/linux/zfs/unstable.nix b/pkgs/os-specific/linux/zfs/unstable.nix index 59667d981319e41..e635c8950c0ef9c 100644 --- a/pkgs/os-specific/linux/zfs/unstable.nix +++ b/pkgs/os-specific/linux/zfs/unstable.nix @@ -1,7 +1,6 @@ { callPackage , kernel ? null , stdenv -, linuxKernel , nixosTests , ... } @ args: @@ -14,21 +13,18 @@ callPackage ./generic.nix args { # this attribute is the correct one for this package. kernelModuleAttribute = "zfs_unstable"; # check the release notes for compatible kernels - kernelCompatible = kernel.kernelOlder "6.11"; - - latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_10; + kernelCompatible = kernel: kernel.kernelOlder "6.11"; # this package should point to a version / git revision compatible with the latest kernel release # IMPORTANT: Always use a tagged release candidate or commits from the # zfs--staging branch, because this is tested by the OpenZFS # maintainers. - version = "2.2.5"; + version = "2.2.6"; # rev = ""; - isUnstable = true; tests = [ nixosTests.zfs.unstable ]; - hash = "sha256-BkwcNPk+jX8CXp5xEVrg4THof7o/5j8RY2SY6+IPNTg="; + hash = "sha256-wkgoYg6uQOHVq8a9sJXzO/QXJ6q28l7JXWkC+BFvOb0="; }