From 1026c02f6d71e5ba8cc969d0b4ab743881f8a094 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 8 Dec 2020 16:38:30 +0000 Subject: [PATCH 1/2] zfs: fix build with linux-rt --- pkgs/os-specific/linux/zfs/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix index a83e554b6f0a..a2464aeb5865 100644 --- a/pkgs/os-specific/linux/zfs/default.nix +++ b/pkgs/os-specific/linux/zfs/default.nix @@ -176,6 +176,11 @@ let maintainers = with maintainers; [ hmenke jcumming jonringer wizeman fpletz globin mic92 ]; }; }; + + linux-rt-patch = fetchpatch { + url = "https://github.com/openzfs/zfs/commit/ab4fb9b74e9d089fc9a261c4f41e19697ad6a4ca.patch"; + sha256 = "1nrxmb4rhrkgncav6dzwm66l0700fi72qkkcs0w6pkm850srws36"; + }; in { # also check if kernel version constraints in # ./nixos/modules/tasks/filesystems/zfs.nix needs @@ -188,6 +193,8 @@ in { version = "2.0.0"; sha256 = "1kriz6pg8wj98izvjc60wp23lgcp4k3mzhpkgj74np73rzgy6v8r"; + + extraPatches = [ linux-rt-patch ]; }; zfsUnstable = common { @@ -198,5 +205,7 @@ in { version = "2.0.0"; sha256 = "1kriz6pg8wj98izvjc60wp23lgcp4k3mzhpkgj74np73rzgy6v8r"; + + extraPatches = [ linux-rt-patch ]; }; } From 4376b91b4067dc77b0a9a7ae3fe4ac20d0ff6f51 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Tue, 8 Dec 2020 15:23:51 +0000 Subject: [PATCH 2/2] linux-rt_5_9: export symbols needed by zfs Upstream issue: https://github.com/openzfs/zfs/issues/11097#issuecomment-740682245 --- .../linux/kernel/export-rt-sched-migrate.patch | 11 +++++++++++ pkgs/os-specific/linux/kernel/patches.nix | 5 +++++ pkgs/top-level/all-packages.nix | 1 + 3 files changed, 17 insertions(+) create mode 100644 pkgs/os-specific/linux/kernel/export-rt-sched-migrate.patch diff --git a/pkgs/os-specific/linux/kernel/export-rt-sched-migrate.patch b/pkgs/os-specific/linux/kernel/export-rt-sched-migrate.patch new file mode 100644 index 000000000000..1d8ed6f712cb --- /dev/null +++ b/pkgs/os-specific/linux/kernel/export-rt-sched-migrate.patch @@ -0,0 +1,11 @@ +Export linux-rt (PREEMPT_RT) specific symbols needed by ZFS. +(Regular kernel provides them static inline in linux/preempt.h.) + +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -1812 +1812 @@ void migrate_disable(void) +-EXPORT_SYMBOL_GPL(migrate_disable); ++EXPORT_SYMBOL(migrate_disable); +@@ -1843 +1843 @@ void migrate_enable(void) +-EXPORT_SYMBOL_GPL(migrate_enable); ++EXPORT_SYMBOL(migrate_enable); diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix index 8ce1ac2b587c..e2805c315b8b 100644 --- a/pkgs/os-specific/linux/kernel/patches.nix +++ b/pkgs/os-specific/linux/kernel/patches.nix @@ -87,6 +87,11 @@ }; }; + export-rt-sched-migrate = { + name = "export-rt-sched-migrate"; + patch = ./export-rt-sched-migrate.patch; + }; + # patches from https://lkml.org/lkml/2019/7/15/1748 mac_nvme_t2 = rec { name = "mac_nvme_t2"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6674a5612791..5a33e8a023d9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18363,6 +18363,7 @@ in kernelPatches.bridge_stp_helper kernelPatches.request_key_helper kernelPatches.export_kernel_fpu_functions."5.3" + kernelPatches.export-rt-sched-migrate ]; };