···323323 Defaults to 0, which waits forever.
324324 '';
325325 };
326326+327327+ removeLinuxDRM = lib.mkOption {
328328+ type = types.bool;
329329+ default = false;
330330+ description = lib.mdDoc ''
331331+ Linux 6.2 dropped some kernel symbols required on aarch64 required by zfs.
332332+ Enabling this option will bring them back to allow this kernel version.
333333+ Note that in some jurisdictions this may be illegal as it might be considered
334334+ removing copyright protection from the code.
335335+ See https://www.ifross.org/?q=en/artikel/ongoing-dispute-over-value-exportsymbolgpl-function for further information.
336336+337337+ If configure your kernel package with `zfs.latestCompatibleLinuxPackages`, you will need to also pass removeLinuxDRM to that package like this:
338338+339339+ ```
340340+ { pkgs, ... }: {
341341+ boot.kernelPackages = (pkgs.zfs.override {
342342+ removeLinuxDRM = pkgs.hostPlatform.isAarch64;
343343+ }).latestCompatibleLinuxPackages;
344344+345345+ boot.zfs.removeLinuxDRM = true;
346346+ }
347347+ ```
348348+ '';
349349+ };
326350 };
327351328352 services.zfs.autoSnapshot = {
···541565 # https://github.com/NixOS/nixpkgs/issues/106093
542566 kernelParams = lib.optionals (!config.boot.zfs.allowHibernation) [ "nohibernate" ];
543567544544- extraModulePackages = [
545545- (if config.boot.zfs.enableUnstable then
568568+ extraModulePackages = let
569569+ kernelPkg = if config.boot.zfs.enableUnstable then
546570 config.boot.kernelPackages.zfsUnstable
547571 else
548548- config.boot.kernelPackages.zfs)
572572+ config.boot.kernelPackages.zfs;
573573+ in [
574574+ (kernelPkg.override { inherit (cfgZfs) removeLinuxDRM; })
549575 ];
550576 };
551577···662688663689 services.udev.packages = [ cfgZfs.package ]; # to hook zvol naming, etc.
664690 systemd.packages = [ cfgZfs.package ];
691691+692692+ # Export kernel_neon_* symbols again.
693693+ # This change is necessary until ZFS figures out a solution
694694+ # with upstream or in their build system to fill the gap for
695695+ # this symbol.
696696+ # In the meantime, we restore what was once a working piece of code
697697+ # in the kernel.
698698+ boot.kernelPatches = lib.optional (cfgZfs.removeLinuxDRM && pkgs.stdenv.hostPlatform.system == "aarch64-linux") {
699699+ name = "export-neon-symbols-as-gpl";
700700+ patch = pkgs.fetchpatch {
701701+ url = "https://github.com/torvalds/linux/commit/aaeca98456431a8d9382ecf48ac4843e252c07b3.patch";
702702+ hash = "sha256-L2g4G1tlWPIi/QRckMuHDcdWBcKpObSWSRTvbHRIwIk=";
703703+ revert = true;
704704+ };
705705+ };
665706666707 systemd.services = let
667708 createImportService' = pool: createImportService {
+6-2
pkgs/os-specific/linux/zfs/stable.nix
···22, kernel ? null
33, stdenv
44, linuxKernel
55+, removeLinuxDRM ? false
56, ...
67} @ args:
78···1112callPackage ./generic.nix args {
1213 # check the release notes for compatible kernels
1314 kernelCompatible =
1414- if stdenv'.isx86_64
1515+ if stdenv'.isx86_64 || removeLinuxDRM
1516 then kernel.kernelOlder "6.4"
1617 else kernel.kernelOlder "6.2";
1717- latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_3;
1818+ latestCompatibleLinuxPackages = if stdenv'.isx86_64 || removeLinuxDRM then
1919+ linuxKernel.packages.linux_6_3
2020+ else
2121+ linuxKernel.packages.linux_6_1;
18221923 # this package should point to the latest release.
2024 version = "2.1.12";
+10-6
pkgs/os-specific/linux/zfs/unstable.nix
···22, kernel ? null
33, stdenv
44, linuxKernel
55+, removeLinuxDRM ? false
56, ...
67} @ args:
78···1314 # NOTE:
1415 # zfs-2.1.9<=x<=2.1.10 is broken with aarch64-linux-6.2
1516 # for future releases, please delete this condition.
1616- kernelCompatible = if stdenv'.isx86_64
1717- then kernel.kernelOlder "6.3"
1717+ kernelCompatible = if stdenv'.isx86_64 || removeLinuxDRM
1818+ then kernel.kernelOlder "6.4"
1819 else kernel.kernelOlder "6.2";
1919- latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_1;
2020+2121+ latestCompatibleLinuxPackages = if stdenv'.isx86_64 || removeLinuxDRM then
2222+ linuxKernel.packages.linux_6_3
2323+ else
2424+ linuxKernel.packages.linux_6_1;
20252126 # this package should point to a version / git revision compatible with the latest kernel release
2227 # IMPORTANT: Always use a tagged release candidate or commits from the
2328 # zfs-<version>-staging branch, because this is tested by the OpenZFS
2429 # maintainers.
2525- version = "2.1.12-staging-2023-04-18";
2626- rev = "e25f9131d679692704c11dc0c1df6d4585b70c35";
3030+ version = "2.1.12";
27312828- sha256 = "tJLwyqUj1l5F0WKZDeMGrEFa8fc/axKqm31xtN51a5M=";
3232+ sha256 = "eYUR5d4gpTrlFu6j1uL83DWL9uPGgAUDRdSEb73V5i4=";
29333034 isUnstable = true;
3135}