diff options
author | Lluís Batlle i Rossell <viric@viric.name> | 2018-07-28 19:25:14 +0200 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@viric.name> | 2018-07-28 19:25:14 +0200 |
commit | f54b387b63299245092d9bbf09cb562bac125461 (patch) | |
tree | 0c09809c0964d7bd931c6c8d1a7d19dcac342abd /pkgs/os-specific/linux/kernel/manual-config.nix | |
parent | 66d7126255b96a3d9c1cc0cdd7c2cd79d1789758 (diff) | |
parent | 0fa2cbf59f7f68a8b9213a9cf9d2cd6dd2e518cc (diff) | |
download | nixpkgs-f54b387b63299245092d9bbf09cb562bac125461.tar nixpkgs-f54b387b63299245092d9bbf09cb562bac125461.tar.gz nixpkgs-f54b387b63299245092d9bbf09cb562bac125461.tar.bz2 nixpkgs-f54b387b63299245092d9bbf09cb562bac125461.tar.lz nixpkgs-f54b387b63299245092d9bbf09cb562bac125461.tar.xz nixpkgs-f54b387b63299245092d9bbf09cb562bac125461.tar.zst nixpkgs-f54b387b63299245092d9bbf09cb562bac125461.zip |
Merge remote-tracking branch 'central/master' into viric_clean
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r-- | pkgs/os-specific/linux/kernel/manual-config.nix | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index b2171067307..80721c4b401 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -1,4 +1,4 @@ -{ buildPackages, runCommand, nettools, bc, bison, flex, perl, gmp, libmpc, mpfr, openssl +{ buildPackages, runCommand, nettools, bc, bison, flex, perl, rsync, gmp, libmpc, mpfr, openssl , libelf , utillinux , writeTextFile @@ -90,9 +90,6 @@ let inherit src; - preUnpack = '' - ''; - patches = map (p: p.patch) kernelPatches; prePatch = '' @@ -111,11 +108,6 @@ let echo "manual-config configurePhase buildRoot=$buildRoot pwd=$PWD" - if [[ -z "$buildRoot" || ! -d "$buildRoot" ]]; then - echo "set $buildRoot to the build folder please" - exit 1 - fi - if [ -f "$buildRoot/.config" ]; then echo "Could not link $buildRoot/.config : file exists" exit 1 @@ -127,7 +119,7 @@ let make $makeFlags "''${makeFlagsArray[@]}" oldconfig runHook postConfigure - make $makeFlags prepare + make $makeFlags "''${makeFlagsArray[@]}" prepare actualModDirVersion="$(cat $buildRoot/include/config/kernel.release)" if [ "$actualModDirVersion" != "${modDirVersion}" ]; then echo "Error: modDirVersion ${modDirVersion} specified in the Nix expression is wrong, it should be: $actualModDirVersion" @@ -172,8 +164,14 @@ let unlink $out/lib/modules/${modDirVersion}/build unlink $out/lib/modules/${modDirVersion}/source - mkdir -p $dev/lib/modules/${modDirVersion}/build - cp -dpR .. $dev/lib/modules/${modDirVersion}/source + mkdir -p $dev/lib/modules/${modDirVersion}/{build,source} + + # To save space, exclude a bunch of unneeded stuff when copying. + (cd .. && rsync --archive --prune-empty-dirs \ + --exclude='/build/' \ + --exclude='/Documentation/' \ + * $dev/lib/modules/${modDirVersion}/source/) + cd $dev/lib/modules/${modDirVersion}/source cp $buildRoot/{.config,Module.symvers} $dev/lib/modules/${modDirVersion}/build @@ -259,7 +257,7 @@ stdenv.mkDerivation ((drvAttrs config hostPlatform.platform kernelPatches config enableParallelBuilding = true; depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ perl bc nettools openssl gmp libmpc mpfr ] + nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr ] ++ optional (stdenv.hostPlatform.platform.kernelTarget == "uImage") buildPackages.ubootTools ++ optional (stdenv.lib.versionAtLeast version "4.14") libelf ++ optional (stdenv.lib.versionAtLeast version "4.15") utillinux |