@@ -1,12 +1,10 @@
1−{ buildPackages, runCommand, nettools, bc, bison, flex, perl, gmp, libmpc, mpfr, openssl
1+{ buildPackages
22, ncurses
3−, libelf
4−, utillinux
5−, writeTextFile, ubootTools
63, callPackage
7−}:
8−
9−{ stdenv, buildPackages, perl, buildLinux
4+, perl
5+, bison ? null
6+, flex ? null
7+, stdenv
108
119, # The kernel source tarball.
1210 src
@@ -35,6 +33,12 @@
3533 hostPlatform != stdenv.buildPlatform
3634, extraMeta ? {}
3735, 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+
3842, ...
3943} @ args:
4044
@@ -67,7 +71,7 @@ let
6771 in lib.concatStringsSep "\n" ([baseConfig] ++ configFromPatches);
6872
6973 configfile = stdenv.mkDerivation {
70− inherit ignoreConfigErrors;
74+ inherit ignoreConfigErrors autoModules preferBuiltin kernelArch;
7175 name = "linux-config-${version}";
7276
7377 generateConfig = ./generate-config.pl;
@@ -83,9 +87,6 @@ let
8387 kernelBaseConfig = hostPlatform.platform.kernelBaseConfig;
8488 # e.g. "bzImage"
8589 kernelTarget = hostPlatform.platform.kernelTarget;
86− autoModules = hostPlatform.platform.kernelAutoModules;
87− preferBuiltin = hostPlatform.platform.kernelPreferBuiltin or false;
88− arch = hostPlatform.platform.kernelArch;
8990
9091 prePatch = kernel.prePatch + ''
9192 # Patch kconfig to print "###" after every question so that
@@ -99,12 +100,12 @@ let
99100 export buildRoot="''${buildRoot:-build}"
100101
101102 # Get a basic config file for later refinement with $generateConfig.
102− 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
103104
104105 # Create the config file.
105106 echo "generating kernel configuration..."
106107 echo "$kernelConfig" > "$buildRoot/kernel-config"
107− 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 \
108109 PREFER_BUILTIN=$preferBuiltin BUILD_ROOT="$buildRoot" SRC=. perl -w $generateConfig
109110 '';
110111