diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-03-07 19:33:52 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-03-07 19:33:52 +0100 |
commit | 674c51af3c0f3f1c65e1975893fdf6438bc57f28 (patch) | |
tree | 3020861cf515bc567e191361357d42e11ac817ee /pkgs/os-specific/linux/kernel/manual-config.nix | |
parent | da437144fa4f446e91b5f7f78b55faa4d12de58a (diff) | |
parent | d742d26b0d8c7125fb29417fcb40e2665e10100d (diff) |
Merge remote-tracking branch 'origin/master' into stdenv-updates
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r-- | pkgs/os-specific/linux/kernel/manual-config.nix | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index b76b0a1039f7d..34e8f10dceee1 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -75,16 +75,6 @@ let "INSTALL_PATH=$(out)" ] ++ (optional isModular "INSTALL_MOD_PATH=$(out)") ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware"; -in - -stdenv.mkDerivation { - name = "linux-${version}"; - - enableParallelBuilding = true; - - passthru = { - inherit version modDirVersion config kernelPatches src; - }; sourceRoot = stdenv.mkDerivation { name = "linux-${version}-source"; @@ -108,16 +98,30 @@ stdenv.mkDerivation { mv $sourceRoot $out ''; }; +in + +stdenv.mkDerivation { + name = "linux-${version}"; + + enableParallelBuilding = true; + + outputs = if isModular then [ "out" "dev" ] else null; + + passthru = { + inherit version modDirVersion config kernelPatches src; + }; + + inherit sourceRoot; unpackPhase = '' mkdir build export buildRoot="$(pwd)/build" - ln -sv ${configfile} $buildRoot/.config - cd $sourceRoot + cd ${sourceRoot} ''; configurePhase = '' runHook preConfigure + ln -sv ${configfile} $buildRoot/.config make $makeFlags "''${makeFlagsArray[@]}" oldconfig runHook postConfigure ''; @@ -140,17 +144,25 @@ stdenv.mkDerivation { make modules_install $makeFlags "''${makeFlagsArray[@]}" \ $installFlags "''${installFlagsArray[@]}" rm -f $out/lib/modules/${modDirVersion}/build - mv $buildRoot $out/lib/modules/${modDirVersion}/build + mkdir -p $dev/lib/modules/${modDirVersion} + mv $out/lib/modules/${modDirVersion}/source $dev/lib/modules/${modDirVersion}/source + mv $buildRoot $dev/lib/modules/${modDirVersion}/build '' else optionalString installsFirmware '' make firmware_install $makeFlags "''${makeFlagsArray[@]}" \ $installFlags "''${installFlagsArray[@]}" ''); - postFixup = optionalString isModular '' + postFixup = if isModular then '' if [ -z "$dontStrip" ]; then find $out -name "*.ko" -print0 | xargs -0 -r strip -S + # Remove all references to the source directory to avoid unneeded + # runtime dependencies + find $out -name "*.ko" -print0 | xargs -0 -r sed -i \ + "s|${sourceRoot}|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${sourceRoot.name}|g" fi - ''; + '' else null; + + __ignoreNulls = true; meta = { description = "The Linux kernel"; |