diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index cab11cc87ae2..dd3050a93eef 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -45,6 +45,11 @@ stdenv.hostPlatform != stdenv.buildPlatform , extraMeta ? {} +, isXen ? features.xen_dom0 or false +, isZen ? false +, isLibre ? false +, isHardened ? false + # easy overrides to stdenv.hostPlatform.platform members , autoModules ? stdenv.hostPlatform.platform.kernelAutoModules , preferBuiltin ? stdenv.hostPlatform.platform.kernelPreferBuiltin or false @@ -175,7 +180,9 @@ let passthru = { features = kernelFeatures; - inherit commonStructuredConfig; + inherit commonStructuredConfig isXen isZen isHardened isLibre; + kernelOlder = lib.versionOlder version; + kernelAtLeast = lib.versionAtLeast version; passthru = kernel.passthru // (removeAttrs passthru [ "passthru" ]); }; diff --git a/pkgs/os-specific/linux/kernel/linux-libre.nix b/pkgs/os-specific/linux/kernel/linux-libre.nix index 7a831e61ae49..1e8514e9c2c8 100644 --- a/pkgs/os-specific/linux/kernel/linux-libre.nix +++ b/pkgs/os-specific/linux/kernel/linux-libre.nix @@ -17,6 +17,7 @@ let in linux.override { argsOverride = { modDirVersion = "${linux.modDirVersion}-gnu"; + isLibre = true; src = stdenv.mkDerivation { name = "${linux.name}-libre-src"; diff --git a/pkgs/os-specific/linux/kernel/linux-zen.nix b/pkgs/os-specific/linux/kernel/linux-zen.nix index 947aa7c19ab3..f4b0f3870f29 100644 --- a/pkgs/os-specific/linux/kernel/linux-zen.nix +++ b/pkgs/os-specific/linux/kernel/linux-zen.nix @@ -7,6 +7,7 @@ in buildLinux (args // { modDirVersion = "${version}-zen1"; inherit version; + isZen = true; src = fetchFromGitHub { owner = "zen-kernel"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 319d24d2e25d..d017efe6dfb1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18014,6 +18014,10 @@ in inherit kernel; inherit (kernel) stdenv; # in particular, use the same compiler by default + # to help determine module compatibility + inherit (kernel) isXen isZen isHardened isLibre; + inherit (kernel) kernelOlder kernelAtLeast; + # Obsolete aliases (these packages do not depend on the kernel). inherit (pkgs) odp-dpdk pktgen; # added 2018-05 @@ -18277,6 +18281,7 @@ in kernelPatches.hardened.${kernel.meta.branch} ]; modDirVersionArg = kernel.modDirVersion + "-hardened"; + isHardened = true; }); linuxPackages_hardened = recurseIntoAttrs (hardenedLinuxPackagesFor pkgs.linux { });