From fd330e9315c84f2ea9598d4fa2e6cc79a39cb1e3 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 1 Aug 2012 14:15:26 -0400 Subject: linux/manual-config: Install the kernel with the name given in stdenv.platform.kernelTarget --- pkgs/os-specific/linux/kernel/manual-config.nix | 27 ++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix') 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 -- cgit 1.4.1