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-08-01 14:15:26 -0400
committerShea Levy <shea@shealevy.com>2012-08-01 15:39:49 -0400
commitfd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3 (patch)
tree38db5fa9ee1a178ebfe0a486ce5bec4596582ab2 /pkgs/os-specific/linux/kernel/manual-config.nix
parentf4847262ae1d638b9b352374a9b678c052218de5 (diff)
downloadnixpkgs-fd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3.tar
nixpkgs-fd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3.tar.gz
nixpkgs-fd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3.tar.bz2
nixpkgs-fd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3.tar.lz
nixpkgs-fd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3.tar.xz
nixpkgs-fd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3.tar.zst
nixpkgs-fd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3.zip
linux/manual-config: Install the kernel with the name given in stdenv.platform.kernelTarget
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix27
1 files changed, 18 insertions, 9 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 3f2d5d0a39c..e2cee9c23e7 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -61,10 +61,10 @@ in
 }:
 
 let
-  installkernel = writeTextFile { name = "installkernel"; executable=true; text = ''
+  installkernel = name: writeTextFile { name = "installkernel"; executable=true; text = ''
     #!/bin/sh
     mkdir $4
-    mv -v $2 $4
+    mv -v $2 $4/${name}
     mv -v $3 $4
   '';};
 
@@ -72,6 +72,12 @@ let
 
   installsFirmware = (config.isEnabled "FW_LOADER") &&
     (isModular || (config.isDisabled "FIRMWARE_IN_KERNEL"));
+
+  commonMakeFlags = [
+    "O=../build"
+    "INSTALL_PATH=$(out)"
+  ] ++ (optional isModular "MODLIB=$(out)/lib/modules/${modDirVersion}")
+  ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
 in
 
 stdenv.mkDerivation {
@@ -86,7 +92,7 @@ stdenv.mkDerivation {
   inherit patches src;
 
   prePatch = ''
-    for mf in $(find -name Makefile -o -name Makefile.include); do
+    for mf in $(find -name Makefile -o -name Makefile.include -o -name install.sh); do
         echo "stripping FHS paths in \`$mf'..."
         sed -i "$mf" -e 's|/usr/bin/||g ; s|/bin/||g ; s|/sbin/||g'
     done
@@ -104,12 +110,15 @@ stdenv.mkDerivation {
 
   buildNativeInputs = [ perl nettools ] ++ optional isModular kmod;
 
-  makeFlags = [
-    "O=../build"
-    "INSTALL_PATH=$(out)"
-    "INSTALLKERNEL=${installkernel}"
-  ] ++ (optional isModular "MODLIB=$(out)/lib/modules/${modDirVersion}")
-  ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
+  makeFlags = commonMakeFlags ++ [
+   "INSTALLKERNEL=${installkernel stdenv.platform.kernelTarget}"
+  ];
+
+  crossAttrs = {
+    makeFlags = commonMakeFlags ++ [
+     "INSTALLKERNEL=${installkernel stdenv.cross.platform.kernelTarget}"
+    ];
+  };
 
   postInstall = stdenv.lib.optionalString installsFirmware ''
     mkdir -p $out/lib/firmware