@@ -33,6 +33,12 @@
3333 hostPlatform != stdenv.buildPlatform
3434, extraMeta ? {}
3535, hostPlatform
36+
37+# easy overrides to hostPlatform.platform members
38+, autoModules ? hostPlatform.platform.kernelAutoModules
39+, preferBuiltin ? hostPlatform.platform.kernelPreferBuiltin or false
40+, kernelArch ? hostPlatform.platform.kernelArch
41+
3642, ...
3743} @ args:
3844
@@ -65,7 +71,7 @@ let
6571 in lib.concatStringsSep "\n" ([baseConfig] ++ configFromPatches);
6672
6773 configfile = stdenv.mkDerivation {
68− inherit ignoreConfigErrors;
74+ inherit ignoreConfigErrors autoModules preferBuiltin kernelArch;
6975 name = "linux-config-${version}";
7076
7177 generateConfig = ./generate-config.pl;
@@ -81,9 +87,6 @@ let
8187 kernelBaseConfig = hostPlatform.platform.kernelBaseConfig;
8288 # e.g. "bzImage"
8389 kernelTarget = hostPlatform.platform.kernelTarget;
84− autoModules = hostPlatform.platform.kernelAutoModules;
85− preferBuiltin = hostPlatform.platform.kernelPreferBuiltin or false;
86− arch = hostPlatform.platform.kernelArch;
8790
8891 prePatch = kernel.prePatch + ''
8992 # Patch kconfig to print "###" after every question so that
@@ -97,12 +100,12 @@ let
97100 export buildRoot="''${buildRoot:-build}"
98101
99102 # Get a basic config file for later refinement with $generateConfig.
100− make HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc -C . O="$buildRoot" $kernelBaseConfig ARCH=$arch
103+ make HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc -C . O="$buildRoot" $kernelBaseConfig ARCH=$kernelArch
101104
102105 # Create the config file.
103106 echo "generating kernel configuration..."
104107 echo "$kernelConfig" > "$buildRoot/kernel-config"
105− DEBUG=1 ARCH=$arch KERNEL_CONFIG="$buildRoot/kernel-config" AUTO_MODULES=$autoModules \
108+ DEBUG=1 ARCH=$kernelArch KERNEL_CONFIG="$buildRoot/kernel-config" AUTO_MODULES=$autoModules \
106109 PREFER_BUILTIN=$preferBuiltin BUILD_ROOT="$buildRoot" SRC=. perl -w $generateConfig
107110 '';
108111