diff options
author | Shea Levy <shea@shealevy.com> | 2012-08-11 21:21:06 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2012-08-11 21:21:06 -0400 |
commit | 839c58f5b1296f694b4b4dffa3810914438df560 (patch) | |
tree | 91be3f313cd1e6f4f52e830617210ea58017517c /pkgs/os-specific/linux/kernel/manual-config.nix | |
parent | 9ac776ab221317fdac18cbcb14c61e46cd2fa1a2 (diff) |
linux/manual-config: Cleanup
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r-- | pkgs/os-specific/linux/kernel/manual-config.nix | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 78b468176f28c..52e284827d028 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -80,51 +80,48 @@ let ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware"; in -let self = stdenv.mkDerivation { +stdenv.mkDerivation { name = "linux-${version}"; enableParallelBuilding = true; passthru = { inherit version modDirVersion config kernelPatches src; + }; - source = stdenv.mkDerivation { - name = "linux-${version}-source"; + sourceRoot = stdenv.mkDerivation { + name = "linux-${version}-source"; - inherit src; + inherit src; - patches = map (p: p.patch) kernelPatches; + patches = map (p: p.patch) kernelPatches; - phases = [ "unpackPhase" "patchPhase" "installPhase" ]; + phases = [ "unpackPhase" "patchPhase" "installPhase" ]; - prePatch = '' - 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 - sed -i Makefile -e 's|= depmod|= ${kmod}/sbin/depmod|' - ''; - - installPhase = '' - cd .. - mv $sourceRoot $out - ''; - }; + prePatch = '' + 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 + sed -i Makefile -e 's|= depmod|= ${kmod}/sbin/depmod|' + ''; + + installPhase = '' + cd .. + mv $sourceRoot $out + ''; }; unpackPhase = '' - export sourceRoot="${self.source}" mkdir build export buildRoot="$(pwd)/build" + ln -sv ${configfile} $buildRoot/.config cd $sourceRoot ''; configurePhase = '' runHook preConfigure - make $makeFlags "''${makeFlagsArray[@]}" mrproper - ln -sv ${configfile} $buildRoot/.config make $makeFlags "''${makeFlagsArray[@]}" oldconfig - rm $buildRoot/.config.old runHook postConfigure ''; @@ -146,7 +143,6 @@ let self = stdenv.mkDerivation { make modules_install $makeFlags "''${makeFlagsArray[@]}" \ $installFlags "''${installFlagsArray[@]}" rm -f $out/lib/modules/${modDirVersion}/build - cd $buildRoot/.. mv $buildRoot $out/lib/modules/${modDirVersion}/build '' else optionalString installsFirmware '' make firmware_install $makeFlags "''${makeFlagsArray[@]}" \ @@ -168,4 +164,4 @@ let self = stdenv.mkDerivation { ]; platforms = lib.platforms.linux; }; -}; in self +} |