diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix index 7f2a97d868eda..6b3b5594ef2ad 100644 --- a/pkgs/os-specific/linux/kernel/generic.nix +++ b/pkgs/os-specific/linux/kernel/generic.nix @@ -24,6 +24,10 @@ # Additional make flags passed to kbuild , extraMakeFlags ? [] +, # List of packages needed to build this specific kernel extra, additionally + # the default tools + nativeBuildInputs ? [] + , # kernel intermediate config overrides, as a set structuredExtraConfig ? {} @@ -112,6 +116,7 @@ let depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ perl gmp libmpc mpfr ] + ++ nativeBuildInputs ++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ]; platformName = stdenv.hostPlatform.linux-kernel.name; @@ -181,7 +186,7 @@ let }; # end of configfile derivation kernel = (callPackage ./manual-config.nix { inherit buildPackages; }) { - inherit version modDirVersion src kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile; + inherit version modDirVersion src kernelPatches randstructSeed lib stdenv extraMakeFlags extraMeta configfile nativeBuildInputs; config = { CONFIG_MODULES = "y"; CONFIG_FW_LOADER = "m"; }; }; diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 9c67df13d314c..b79c1937b11b1 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -38,6 +38,9 @@ in { # Use defaultMeta // extraMeta extraMeta ? {}, + # Extra build tools + nativeBuildInputs ? [], + # for module compatibility isZen ? false, isLibre ? false, @@ -313,6 +316,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr gawk zstd python3Minimal ] + ++ nativeBuildInputs ++ optional (stdenv.hostPlatform.linux-kernel.target == "uImage") buildPackages.ubootTools ++ optional (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf # Removed util-linuxMinimal since it should not be a dependency.