summary refs log tree commit diff
diff options
context:
space:
mode:
authorVolth <volth@webmaster.ms>2017-03-20 23:12:12 +0000
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2017-04-01 16:05:17 +0300
commitb78f16b33772722d19c9cbe4145953f9c4b76fc8 (patch)
tree62c652a61e392a1dc792f3c9ed12dac5a447720d
parented41d50e9fe3d942cfde37e84de781c096309e5b (diff)
downloadnixlib-b78f16b33772722d19c9cbe4145953f9c4b76fc8.tar
nixlib-b78f16b33772722d19c9cbe4145953f9c4b76fc8.tar.gz
nixlib-b78f16b33772722d19c9cbe4145953f9c4b76fc8.tar.bz2
nixlib-b78f16b33772722d19c9cbe4145953f9c4b76fc8.tar.lz
nixlib-b78f16b33772722d19c9cbe4145953f9c4b76fc8.tar.xz
nixlib-b78f16b33772722d19c9cbe4145953f9c4b76fc8.tar.zst
nixlib-b78f16b33772722d19c9cbe4145953f9c4b76fc8.zip
kernel: do not remove .o files on installPhase
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix23
1 files changed, 9 insertions, 14 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index e07a89fc1e64..55162e54f4dc 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -146,17 +146,12 @@ let
         unlink $out/lib/modules/${modDirVersion}/build
         unlink $out/lib/modules/${modDirVersion}/source
 
-        mkdir -p $dev/lib/modules/${modDirVersion}
-        cd ..
-        mv $sourceRoot $dev/lib/modules/${modDirVersion}/source
+        mkdir -p $dev/lib/modules/${modDirVersion}/build
+        cp -dpR ../$sourceRoot $dev/lib/modules/${modDirVersion}/source
         cd $dev/lib/modules/${modDirVersion}/source
 
-        mv $buildRoot/.config $buildRoot/Module.symvers $TMPDIR
-        rm -fR $buildRoot
-        mkdir $buildRoot
-        mv $TMPDIR/.config $TMPDIR/Module.symvers $buildRoot
-        make modules_prepare $makeFlags "''${makeFlagsArray[@]}"
-        mv $buildRoot $dev/lib/modules/${modDirVersion}/build
+        cp $buildRoot/{.config,Module.symvers} $dev/lib/modules/${modDirVersion}/build
+        make modules_prepare $makeFlags "''${makeFlagsArray[@]}" O=$dev/lib/modules/${modDirVersion}/build
 
         # !!! No documentation on how much of the source tree must be kept
         # If/when kernel builds fail due to missing files, you can add
@@ -164,7 +159,7 @@ let
         # from drivers/ in the future; it adds 50M to keep all of its
         # headers on 3.10 though.
 
-        chmod +w -R ../source
+        chmod u+w -R ../source
         arch=`cd $dev/lib/modules/${modDirVersion}/build/arch; ls`
 
         # Remove unusued arches
@@ -177,14 +172,14 @@ let
         rm -fR drivers
 
         # Keep all headers
-        find .  -type f -name '*.h' -print0 | xargs -0 chmod -w
+        find .  -type f -name '*.h' -print0 | xargs -0 chmod u-w
 
         # Keep root and arch-specific Makefiles
-        chmod -w Makefile
-        chmod -w arch/$arch/Makefile*
+        chmod u-w Makefile
+        chmod u-w arch/$arch/Makefile*
 
         # Keep whole scripts dir
-        chmod -w -R scripts
+        chmod u-w -R scripts
 
         # Delete everything not kept
         find . -type f -perm -u=w -print0 | xargs -0 rm