Skip to content

Commit

Permalink
zfs: update latestCompatibleLinuxPackages
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 2b9f043)
  • Loading branch information
alyssais authored and Ma27 committed Apr 8, 2024
1 parent e42377b commit 22f2c32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
6 changes: 4 additions & 2 deletions nixos/modules/tasks/filesystems/zfs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,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; }))
];
};

Expand Down Expand Up @@ -716,7 +718,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";
Expand Down
6 changes: 1 addition & 5 deletions pkgs/os-specific/linux/zfs/stable.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
, kernel ? null
, stdenv
, linuxKernel
, removeLinuxDRM ? false
, nixosTests
, ...
} @ args:
Expand All @@ -15,10 +14,7 @@ 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 = linuxKernel.packages.linux_6_6;

Expand Down
7 changes: 2 additions & 5 deletions pkgs/os-specific/linux/zfs/unstable.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
, kernel ? null
, stdenv
, linuxKernel
, removeLinuxDRM ? false
, nixosTests
, ...
} @ args:
Expand All @@ -14,11 +13,9 @@ callPackage ./generic.nix args {
# You have to ensure that in `pkgs/top-level/linux-kernels.nix`
# 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.7"
else kernel.kernelOlder "6.2";
kernelCompatible = kernel.kernelOlder "6.9";

latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_6;

Expand Down

0 comments on commit 22f2c32

Please sign in to comment.