diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2024-05-30 16:00:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-30 16:00:19 +0000 |
commit | 091115594b82605bc9a957563a541e4a485149c5 (patch) | |
tree | c90ff28d5234d36d2ee0805aaf591cb86c1a384f /pkgs | |
parent | ef12b15a5b6308b84d2fdcdc50e922fafac7e832 (diff) | |
parent | 61113994ae4e75e6fd1c90747da41f09cb01aefa (diff) |
Merge pull request #315701 from Atemu/linux-variants-pname
buildLinux: allow changing the pname
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/os-specific/linux/kernel/generic.nix | 2 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-libre.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-rpi.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-rt-5.10.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-rt-5.15.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-rt-5.4.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-rt-6.1.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-rt-6.6.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/manual-config.nix | 5 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/xanmod-kernels.nix | 1 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/zen-kernels.nix | 1 | ||||
-rw-r--r-- | pkgs/top-level/linux-kernels.nix | 1 |
12 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 37c138402d00..081cfcaa8b60 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -97,7 +97,7 @@ let # For further context, see https://github.com/NixOS/nixpkgs/pull/143113#issuecomment-953319957 basicArgs = builtins.removeAttrs args - (lib.filter (x: ! (builtins.elem x [ "version" "src" ])) (lib.attrNames args)); + (lib.filter (x: ! (builtins.elem x [ "version" "pname" "src" ])) (lib.attrNames args)); # Combine the `features' attribute sets of all the kernel patches. kernelFeatures = lib.foldr (x: y: (x.features or {}) // y) ({ diff --git a/pkgs/os-specific/linux/kernel/linux-libre.nix b/pkgs/os-specific/linux/kernel/linux-libre.nix index 4bb2ebda3d02..9a03c39ec569 100644 --- a/pkgs/os-specific/linux/kernel/linux-libre.nix +++ b/pkgs/os-specific/linux/kernel/linux-libre.nix @@ -23,6 +23,7 @@ in linux.override { argsOverride = { modDirVersion = "${linux.modDirVersion}-${versionPrefix}"; isLibre = true; + pname = "linux-libre"; src = stdenv.mkDerivation { name = "${linux.name}-libre-src"; diff --git a/pkgs/os-specific/linux/kernel/linux-rpi.nix b/pkgs/os-specific/linux/kernel/linux-rpi.nix index f1449998984b..e0ce6549235d 100644 --- a/pkgs/os-specific/linux/kernel/linux-rpi.nix +++ b/pkgs/os-specific/linux/kernel/linux-rpi.nix @@ -8,6 +8,7 @@ in lib.overrideDerivation (buildLinux (args // { version = "${modDirVersion}-${tag}"; inherit modDirVersion; + pname = "linux-rpi"; src = fetchFromGitHub { owner = "raspberrypi"; diff --git a/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix b/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix index d2cc98b8159d..2792aacce342 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-5.10.nix @@ -11,6 +11,7 @@ let kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { inherit version; + pname = "linux-rt"; # modDirVersion needs a patch number, change X.Y-rtZ to X.Y.0-rtZ. modDirVersion = lib.versions.pad 3 version; diff --git a/pkgs/os-specific/linux/kernel/linux-rt-5.15.nix b/pkgs/os-specific/linux/kernel/linux-rt-5.15.nix index 5e43eca364d4..47634d116e9a 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-5.15.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-5.15.nix @@ -11,6 +11,7 @@ let kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { inherit version; + pname = "linux-rt"; # modDirVersion needs a patch number, change X.Y-rtZ to X.Y.0-rtZ. modDirVersion = if (builtins.match "[^.]*[.][^.]*-.*" version) == null then version diff --git a/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix b/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix index 463385036292..2fc18c76e570 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-5.4.nix @@ -11,6 +11,7 @@ let kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { inherit version; + pname = "linux-rt"; src = fetchurl { url = "mirror://kernel/linux/kernel/v5.x/linux-${kversion}.tar.xz"; diff --git a/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix b/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix index f7f21a71263b..0427f9c15986 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-6.1.nix @@ -11,6 +11,7 @@ let kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { inherit version; + pname = "linux-rt"; # modDirVersion needs a patch number, change X.Y-rtZ to X.Y.0-rtZ. modDirVersion = if (builtins.match "[^.]*[.][^.]*-.*" version) == null then version diff --git a/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix b/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix index 2f035b259b60..57c268fe397e 100644 --- a/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix +++ b/pkgs/os-specific/linux/kernel/linux-rt-6.6.nix @@ -11,6 +11,7 @@ let kversion = builtins.elemAt (lib.splitString "-" version) 0; in buildLinux (args // { inherit version; + pname = "linux-rt"; # modDirVersion needs a patch number, change X.Y-rtZ to X.Y.0-rtZ. modDirVersion = if (builtins.match "[^.]*[.][^.]*-.*" version) == null then version diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 0c176d3e12d9..cb75f013b624 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -20,6 +20,8 @@ let in lib.makeOverridable ({ # The kernel version version, + # The kernel pname (should be set for variants) + pname ? "linux", # Position of the Linux build expression pos ? null, # Additional kernel make flags @@ -408,8 +410,7 @@ assert lib.versionOlder version "5.8" -> libelf != null; assert lib.versionAtLeast version "5.8" -> elfutils != null; stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPatches configfile) // { - pname = "linux"; - inherit version; + inherit pname version; enableParallelBuilding = true; diff --git a/pkgs/os-specific/linux/kernel/xanmod-kernels.nix b/pkgs/os-specific/linux/kernel/xanmod-kernels.nix index 3135eefab984..edcdf92396b6 100644 --- a/pkgs/os-specific/linux/kernel/xanmod-kernels.nix +++ b/pkgs/os-specific/linux/kernel/xanmod-kernels.nix @@ -19,6 +19,7 @@ let xanmodKernelFor = { version, suffix ? "xanmod1", hash, variant }: buildLinux (args // rec { inherit version; + pname = "linux-xanmod"; modDirVersion = lib.versions.pad 3 "${version}-${suffix}"; src = fetchFromGitHub { diff --git a/pkgs/os-specific/linux/kernel/zen-kernels.nix b/pkgs/os-specific/linux/kernel/zen-kernels.nix index 89c776e611e5..0a9b0db76724 100644 --- a/pkgs/os-specific/linux/kernel/zen-kernels.nix +++ b/pkgs/os-specific/linux/kernel/zen-kernels.nix @@ -18,6 +18,7 @@ let }; zenKernelsFor = { version, suffix, sha256, isLqx }: buildLinux (args // { inherit version; + pname = "linux-${if isLqx then "lqx" else "zen"}"; modDirVersion = lib.versions.pad 3 "${version}-${suffix}"; isZen = true; diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index d5c5b7f945f9..813000310abd 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -40,6 +40,7 @@ let }; argsOverride = { inherit version; + pname = "linux-hardened"; modDirVersion = modDirVersion' + kernelPatches.hardened.${kernel.meta.branch}.extra; src = fetchurl { url = "mirror://kernel/linux/kernel/v${major}.x/linux-${version}.tar.xz"; |