about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/manual-config.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2012-07-29 04:48:50 -0400
committerShea Levy <shea@shealevy.com>2012-07-29 04:48:50 -0400
commit98341e0bda814d6e92e9fef8522840eec738db4b (patch)
treea8ecf71c0c3ec75e7f5fe6fc36a43e932984ee4a /pkgs/os-specific/linux/kernel/manual-config.nix
parenta9a70856845625bd6b9f988d07553774f88d18d4 (diff)
linux/kernel/manual-config: Use the kernel's make install
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix34
1 files changed, 17 insertions, 17 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 730983d895fe4..777b33a84731c 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -1,4 +1,4 @@
-{ stdenv, runCommand, nettools, perl, kmod }:
+{ stdenv, runCommand, nettools, perl, kmod, writeTextFile }:
 
 with stdenv.lib;
 
@@ -54,7 +54,20 @@ in
   features ? readFeatures config
 }:
 
-let commonMakeFlags = [ "O=../build" ]; in
+let
+  commonMakeFlags = [
+    "O=../build"
+    "INSTALL_PATH=$(out)"
+    "INSTALLKERNEL=${installkernel}"
+  ];
+
+  installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
+    #!/bin/sh
+    mkdir $4
+    mv -v $2 $4
+    mv -v $3 $4
+  '';};
+in
 
 stdenv.mkDerivation ({
   name = "linux-${version}";
@@ -70,9 +83,8 @@ stdenv.mkDerivation ({
   prePatch = ''
     for mf in $(find -name Makefile -o -name Makefile.include); do
         echo "stripping FHS paths in \`$mf'..."
-        sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g'
+        sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g ; s|/sbin/||g'
     done
-    sed -i -e 's|/sbin/depmod|${kmod}/sbin/depmod|' Makefile
   '';
 
   configurePhase = ''
@@ -85,19 +97,7 @@ stdenv.mkDerivation ({
     runHook postConfigure
   '';
 
-  INSTALL_PATH = "$(out)";
-
-  buildNativeInputs = [ perl nettools ];
-
-  installPhase = ''
-    runHook preInstall
-    mkdir $out
-    mv -v ../build/System.map $out
-    # !!! Assumes x86
-    mv -v ../build/arch/x86/boot/bzImage $out
-    mv -v ../build/vmlinux $out
-    runHook postInstall
-  '';
+  buildNativeInputs = [ perl nettools kmod ];
 
   makeFlags = commonMakeFlags;
 } // optionalAttrs features.modular {