summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2018-03-08 11:11:51 -0500
committerGitHub <noreply@github.com>2018-03-08 11:11:51 -0500
commitce5a76274d9d74b42e7db107d90c9621e65d7467 (patch)
tree587ee9d1da5942c69e9d4ac400b238cdc7cffac6 /pkgs/os-specific
parentb61ac6697318314185df8d5eccc155ed9020d754 (diff)
parent3ccc65a36cbb9871830d746e1b2c9b1a09e71291 (diff)
downloadnixlib-ce5a76274d9d74b42e7db107d90c9621e65d7467.tar
nixlib-ce5a76274d9d74b42e7db107d90c9621e65d7467.tar.gz
nixlib-ce5a76274d9d74b42e7db107d90c9621e65d7467.tar.bz2
nixlib-ce5a76274d9d74b42e7db107d90c9621e65d7467.tar.lz
nixlib-ce5a76274d9d74b42e7db107d90c9621e65d7467.tar.xz
nixlib-ce5a76274d9d74b42e7db107d90c9621e65d7467.tar.zst
nixlib-ce5a76274d9d74b42e7db107d90c9621e65d7467.zip
Merge pull request #34672 from teto/kernel_overrides
buildLinux: add overrides for modules
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix27
1 files changed, 14 insertions, 13 deletions
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index f69865cdc4df..1b8c3f76155e 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -1,12 +1,10 @@
-{ buildPackages, runCommand, nettools, bc, bison, flex, perl, gmp, libmpc, mpfr, openssl
+{ buildPackages
 , ncurses
-, libelf
-, utillinux
-, writeTextFile, ubootTools
 , callPackage
-}:
-
-{ stdenv, buildPackages, perl, buildLinux
+, perl
+, bison ? null
+, flex ? null
+, stdenv
 
 , # The kernel source tarball.
   src
@@ -35,6 +33,12 @@
                        hostPlatform != stdenv.buildPlatform
 , extraMeta ? {}
 , hostPlatform
+
+# easy overrides to hostPlatform.platform members
+, autoModules ? hostPlatform.platform.kernelAutoModules
+, preferBuiltin ? hostPlatform.platform.kernelPreferBuiltin or false
+, kernelArch ? hostPlatform.platform.kernelArch
+
 , ...
 } @ args:
 
@@ -67,7 +71,7 @@ let
     in lib.concatStringsSep "\n" ([baseConfig] ++ configFromPatches);
 
   configfile = stdenv.mkDerivation {
-    inherit ignoreConfigErrors;
+    inherit ignoreConfigErrors autoModules preferBuiltin kernelArch;
     name = "linux-config-${version}";
 
     generateConfig = ./generate-config.pl;
@@ -83,9 +87,6 @@ let
     kernelBaseConfig = hostPlatform.platform.kernelBaseConfig;
     # e.g. "bzImage"
     kernelTarget = hostPlatform.platform.kernelTarget;
-    autoModules = hostPlatform.platform.kernelAutoModules;
-    preferBuiltin = hostPlatform.platform.kernelPreferBuiltin or false;
-    arch = hostPlatform.platform.kernelArch;
 
     prePatch = kernel.prePatch + ''
       # Patch kconfig to print "###" after every question so that
@@ -99,12 +100,12 @@ let
       export buildRoot="''${buildRoot:-build}"
 
       # Get a basic config file for later refinement with $generateConfig.
-      make HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc -C . O="$buildRoot" $kernelBaseConfig ARCH=$arch
+      make HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc -C . O="$buildRoot" $kernelBaseConfig ARCH=$kernelArch
 
       # Create the config file.
       echo "generating kernel configuration..."
       echo "$kernelConfig" > "$buildRoot/kernel-config"
-      DEBUG=1 ARCH=$arch KERNEL_CONFIG="$buildRoot/kernel-config" AUTO_MODULES=$autoModules \
+      DEBUG=1 ARCH=$kernelArch KERNEL_CONFIG="$buildRoot/kernel-config" AUTO_MODULES=$autoModules \
            PREFER_BUILTIN=$preferBuiltin BUILD_ROOT="$buildRoot" SRC=. perl -w $generateConfig
     '';