about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/generic.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/kernel/generic.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix16
1 files changed, 12 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index 888dcf1e9a51..5cb6745da122 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -69,18 +69,26 @@ let
         ignoreConfigErrors = true;
 
         kernelConfig = kernelConfigFun configCross;
+
+        inherit (kernel.crossDrv) src patches prePatch preUnpack;
       };
-    buildCommand = ''
+
+    inherit (kernel) src patches prePatch preUnpack;
+
+    buildPhase = ''
+      cd $buildRoot
+
       # Get a basic config file for later refinement with $generateConfig.
-      make -C ${kernel.sourceRoot} O=$PWD $kernelBaseConfig ARCH=$arch
+      make -C ../$sourceRoot O=$PWD $kernelBaseConfig ARCH=$arch
 
       # Create the config file.
       echo "generating kernel configuration..."
       echo "$kernelConfig" > kernel-config
       DEBUG=1 ARCH=$arch KERNEL_CONFIG=kernel-config AUTO_MODULES=$autoModules \
-           SRC=${kernel.sourceRoot} perl -w $generateConfig
-      mv .config $out
+           SRC=../$sourceRoot perl -w $generateConfig
     '';
+
+    installPhase = "mv .config $out";
   };
 
   kernel = linuxManualConfig {