Merge pull request #72287 from oxalica/fix-linux-config
linuxConfig: fix deps and cross-compiling behavior
This commit is contained in:
commit
60b52e240a
@ -16519,17 +16519,26 @@ in
|
|||||||
linuxManualConfig = makeOverridable (callPackage ../os-specific/linux/kernel/manual-config.nix {});
|
linuxManualConfig = makeOverridable (callPackage ../os-specific/linux/kernel/manual-config.nix {});
|
||||||
|
|
||||||
# Derive one of the default .config files
|
# Derive one of the default .config files
|
||||||
linuxConfig = { src, makeTarget ? "defconfig", name ? "kernel.config" }:
|
linuxConfig = {
|
||||||
stdenv.mkDerivation {
|
src,
|
||||||
inherit name src;
|
version ? (builtins.parseDrvName src.name).version,
|
||||||
buildPhase = ''
|
makeTarget ? "defconfig",
|
||||||
set -x
|
name ? "kernel.config",
|
||||||
make ${makeTarget}
|
}: stdenvNoCC.mkDerivation {
|
||||||
'';
|
inherit name src;
|
||||||
installPhase = ''
|
depsBuildBuild = [ buildPackages.stdenv.cc ]
|
||||||
cp .config $out
|
++ lib.optionals (lib.versionAtLeast version "4.16") [ buildPackages.bison buildPackages.flex ];
|
||||||
'';
|
buildPhase = ''
|
||||||
};
|
set -x
|
||||||
|
make \
|
||||||
|
ARCH=${stdenv.hostPlatform.kernelArch} \
|
||||||
|
HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
|
||||||
|
${makeTarget}
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
cp .config $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
buildLinux = attrs: callPackage ../os-specific/linux/kernel/generic.nix attrs;
|
buildLinux = attrs: callPackage ../os-specific/linux/kernel/generic.nix attrs;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user