about summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2023-01-06 19:56:41 +0000
committerGitHub <noreply@github.com>2023-01-06 19:56:41 +0000
commit8552d36ed32e172a5d29361a4129384aba9625dc (patch)
tree2b6dbdbae388a03e7269a93583fb6ae0f6a17352 /pkgs/os-specific
parent776355258894cb642434b8367a84bdd1f14798c5 (diff)
parentbe5854b57b06ad7acefe6d4511d7373a149b5ca3 (diff)
Merge pull request #204673 from whiteley/5.15-rt
Add linux-rt-5.15
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/kernel/linux-rt-5.15.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kernel/linux-rt-5.15.nix b/pkgs/os-specific/linux/kernel/linux-rt-5.15.nix
new file mode 100644
index 0000000000000..15ddf9df91474
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/linux-rt-5.15.nix
@@ -0,0 +1,45 @@
+{ lib, buildLinux, fetchurl
+, kernelPatches ? [ ]
+, structuredExtraConfig ? {}
+, extraMeta ? {}
+, argsOverride ? {}
+, ... } @ args:
+
+let
+  version = "5.15.86-rt56"; # updated by ./update-rt.sh
+  branch = lib.versions.majorMinor version;
+  kversion = builtins.elemAt (lib.splitString "-" version) 0;
+in buildLinux (args // {
+  inherit version;
+
+  # modDirVersion needs a patch number, change X.Y-rtZ to X.Y.0-rtZ.
+  modDirVersion = if (builtins.match "[^.]*[.][^.]*-.*" version) == null then version
+    else lib.replaceStrings ["-"] [".0-"] version;
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/kernel/v5.x/linux-${kversion}.tar.xz";
+    sha256 = "1vpjnmwqsx6akph2nvbsv2jl7pp8b7xns3vmwbljsl23lkpxkz40";
+  };
+
+  kernelPatches = let rt-patch = {
+    name = "rt";
+    patch = fetchurl {
+      url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
+      sha256 = "0y7pkzacxh1fsvnbmjq0ljfb4zjw6dq9br6rl8kr3w4dj56fmaxs";
+    };
+  }; in [ rt-patch ] ++ kernelPatches;
+
+  structuredExtraConfig = with lib.kernel; {
+    PREEMPT_RT = yes;
+    # Fix error: unused option: PREEMPT_RT.
+    EXPERT = yes; # PREEMPT_RT depends on it (in kernel/Kconfig.preempt)
+    # Fix error: option not set correctly: PREEMPT_VOLUNTARY (wanted 'y', got 'n').
+    PREEMPT_VOLUNTARY = lib.mkForce no; # PREEMPT_RT deselects it.
+    # Fix error: unused option: RT_GROUP_SCHED.
+    RT_GROUP_SCHED = lib.mkForce (option no); # Removed by sched-disable-rt-group-sched-on-rt.patch.
+  } // structuredExtraConfig;
+
+  extraMeta = extraMeta // {
+    inherit branch;
+  };
+} // argsOverride)