From 2b9f0438230377995efb9a6efeec5f8572967643 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 26 Feb 2024 12:12:27 +0100 Subject: [PATCH] zfs: update latestCompatibleLinuxPackages ZFS no longer tries to use GPL-only symbols on aarch64. Tested by building nixosTests.zfs.stable (modified to use Linux 6.6) and nixosTests.zfs.unstable. --- nixos/modules/tasks/filesystems/zfs.nix | 6 ++++-- pkgs/os-specific/linux/zfs/stable.nix | 10 ++-------- pkgs/os-specific/linux/zfs/unstable.nix | 10 ++-------- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/nixos/modules/tasks/filesystems/zfs.nix b/nixos/modules/tasks/filesystems/zfs.nix index 98df6a40e8a1b..c6a153cfcb2d7 100644 --- a/nixos/modules/tasks/filesystems/zfs.nix +++ b/nixos/modules/tasks/filesystems/zfs.nix @@ -588,7 +588,9 @@ in kernelParams = lib.optionals (!config.boot.zfs.allowHibernation) [ "nohibernate" ]; extraModulePackages = [ - (cfgZfs.modulePackage.override { inherit (cfgZfs) removeLinuxDRM; }) + (cfgZfs.modulePackage.override + (lib.optionalAttrs (lib.versionOlder cfgZfs.package.version "2.2.3") + { inherit (cfgZfs) removeLinuxDRM; })) ]; }; @@ -731,7 +733,7 @@ in # this symbol. # In the meantime, we restore what was once a working piece of code # in the kernel. - boot.kernelPatches = lib.optional (cfgZfs.removeLinuxDRM && pkgs.stdenv.hostPlatform.system == "aarch64-linux") { + boot.kernelPatches = lib.optional (lib.versionOlder cfgZfs.package.version "2.2.3" && cfgZfs.removeLinuxDRM && pkgs.stdenv.hostPlatform.system == "aarch64-linux") { name = "export-neon-symbols-as-gpl"; patch = pkgs.fetchpatch { url = "https://github.com/torvalds/linux/commit/aaeca98456431a8d9382ecf48ac4843e252c07b3.patch"; diff --git a/pkgs/os-specific/linux/zfs/stable.nix b/pkgs/os-specific/linux/zfs/stable.nix index df06ea9a32854..7ca1d5be3787d 100644 --- a/pkgs/os-specific/linux/zfs/stable.nix +++ b/pkgs/os-specific/linux/zfs/stable.nix @@ -2,7 +2,6 @@ , kernel ? null , stdenv , linuxKernel -, removeLinuxDRM ? false , nixosTests , ... } @ args: @@ -15,14 +14,9 @@ callPackage ./generic.nix args { # this attribute is the correct one for this package. kernelModuleAttribute = "zfs"; # check the release notes for compatible kernels - kernelCompatible = - if stdenv'.isx86_64 || removeLinuxDRM - then kernel.kernelOlder "6.8" - else kernel.kernelOlder "6.2"; + kernelCompatible = kernel.kernelOlder "6.8"; - latestCompatibleLinuxPackages = if stdenv'.isx86_64 || removeLinuxDRM - then linuxKernel.packages.linux_6_7 - else linuxKernel.packages.linux_6_1; + latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_7; # this package should point to the latest release. version = "2.2.3"; diff --git a/pkgs/os-specific/linux/zfs/unstable.nix b/pkgs/os-specific/linux/zfs/unstable.nix index 64a1e79550003..2bd06e0d6b749 100644 --- a/pkgs/os-specific/linux/zfs/unstable.nix +++ b/pkgs/os-specific/linux/zfs/unstable.nix @@ -2,7 +2,6 @@ , kernel ? null , stdenv , linuxKernel -, removeLinuxDRM ? false , nixosTests , ... } @ args: @@ -15,14 +14,9 @@ callPackage ./generic.nix args { # this attribute is the correct one for this package. kernelModuleAttribute = "zfsUnstable"; # check the release notes for compatible kernels - kernelCompatible = - if stdenv'.isx86_64 || removeLinuxDRM - then kernel.kernelOlder "6.9" - else kernel.kernelOlder "6.2"; + kernelCompatible = kernel.kernelOlder "6.9"; - latestCompatibleLinuxPackages = if stdenv'.isx86_64 || removeLinuxDRM - then linuxKernel.packages.linux_6_7 - else linuxKernel.packages.linux_6_1; + latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_7; # 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