|
323 | 323 | Defaults to 0, which waits forever.
|
324 | 324 | '';
|
325 | 325 | };
|
| 326 | + |
| 327 | + removeLinuxDRM = lib.mkOption { |
| 328 | + type = types.bool; |
| 329 | + default = false; |
| 330 | + description = lib.mdDoc '' |
| 331 | + Linux 6.2 dropped some kernel symbols required on aarch64 required by zfs. |
| 332 | + Enabling this option will bring them back to allow this kernel version. |
| 333 | + Note that in some jurisdictions this may be illegal as it might be considered |
| 334 | + removing copyright protection from the code. |
| 335 | + See https://www.ifross.org/?q=en/artikel/ongoing-dispute-over-value-exportsymbolgpl-function for further information. |
| 336 | +
|
| 337 | + If configure your kernel package with `zfs.latestCompatibleLinuxPackages`, you will need to also pass removeLinuxDRM to that package like this: |
| 338 | +
|
| 339 | + ``` |
| 340 | + { pkgs, ... }: { |
| 341 | + boot.kernelPackages = (pkgs.zfs.override { |
| 342 | + removeLinuxDRM = pkgs.hostPlatform.isAarch64; |
| 343 | + }).latestCompatibleLinuxPackages; |
| 344 | +
|
| 345 | + boot.zfs.removeLinuxDRM = true; |
| 346 | + } |
| 347 | + ``` |
| 348 | + ''; |
| 349 | + }; |
326 | 350 | };
|
327 | 351 |
|
328 | 352 | services.zfs.autoSnapshot = {
|
|
532 | 556 | # https://github.com/NixOS/nixpkgs/issues/106093
|
533 | 557 | kernelParams = lib.optionals (!config.boot.zfs.allowHibernation) [ "nohibernate" ];
|
534 | 558 |
|
535 |
| - extraModulePackages = [ |
536 |
| - (if config.boot.zfs.enableUnstable then |
| 559 | + extraModulePackages = let |
| 560 | + kernelPkg = if config.boot.zfs.enableUnstable then |
537 | 561 | config.boot.kernelPackages.zfsUnstable
|
538 | 562 | else
|
539 |
| - config.boot.kernelPackages.zfs) |
| 563 | + config.boot.kernelPackages.zfs; |
| 564 | + in [ |
| 565 | + (kernelPkg.override { inherit (cfgZfs) removeLinuxDRM; }) |
540 | 566 | ];
|
541 | 567 | };
|
542 | 568 |
|
|
654 | 680 | services.udev.packages = [ cfgZfs.package ]; # to hook zvol naming, etc.
|
655 | 681 | systemd.packages = [ cfgZfs.package ];
|
656 | 682 |
|
| 683 | + # Export kernel_neon_* symbols again. |
| 684 | + # This change is necessary until ZFS figures out a solution |
| 685 | + # with upstream or in their build system to fill the gap for |
| 686 | + # this symbol. |
| 687 | + # In the meantime, we restore what was once a working piece of code |
| 688 | + # in the kernel. |
| 689 | + boot.kernelPatches = lib.optional (cfgZfs.removeLinuxDRM && pkgs.stdenv.hostPlatform.system == "aarch64-linux") { |
| 690 | + name = "export-neon-symbols-as-gpl"; |
| 691 | + patch = pkgs.fetchpatch { |
| 692 | + url = "https://github.com/torvalds/linux/commit/aaeca98456431a8d9382ecf48ac4843e252c07b3.patch"; |
| 693 | + hash = "sha256-L2g4G1tlWPIi/QRckMuHDcdWBcKpObSWSRTvbHRIwIk="; |
| 694 | + revert = true; |
| 695 | + }; |
| 696 | + }; |
| 697 | + |
657 | 698 | systemd.services = let
|
658 | 699 | createImportService' = pool: createImportService {
|
659 | 700 | inherit pool;
|
|
0 commit comments