summary refs log tree commit diff
path: root/pkgs/os-specific
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-11-17 18:06:22 +0000
committerOrivej Desh <orivej@gmx.fr>2017-11-17 18:06:22 +0000
commit1161741351cbc60581eaecb4df2e1036b1fafd55 (patch)
tree6c39e36cc3ebeb91d502900c95d33cc26aec7b22 /pkgs/os-specific
parenteb3653482008bf791da71613714294ed4dbfef52 (diff)
parent73598e3787b34385d04e46830e9a7fdf89cc8ede (diff)
downloadnixlib-1161741351cbc60581eaecb4df2e1036b1fafd55.tar
nixlib-1161741351cbc60581eaecb4df2e1036b1fafd55.tar.gz
nixlib-1161741351cbc60581eaecb4df2e1036b1fafd55.tar.bz2
nixlib-1161741351cbc60581eaecb4df2e1036b1fafd55.tar.lz
nixlib-1161741351cbc60581eaecb4df2e1036b1fafd55.tar.xz
nixlib-1161741351cbc60581eaecb4df2e1036b1fafd55.tar.zst
nixlib-1161741351cbc60581eaecb4df2e1036b1fafd55.zip
Merge branch 'master' into staging
* master: (28 commits)
  go_1_9: skip flaky TestWaitGroupMisuse2
  erlangR18: fix patch hashes with fetchpatch
  xml2: replace dead links
  nixos/pam: fix docs about path to u2f_keys file
  cinelerra: add a note about parallel building
  msmtp: install docs and examples (#31769)
  kernel: Fix out-of-tree modules on aarch64
  nixos/tests/acme: update terms of service to fix test
  gixy: init at 0.1.8
  pythonPackages.ConfigArgParse: 0.9.3 -> 0.12.0, refactor, move to python-modules
  mono: init at 4.8
  wal-g: fix license so not to break evaluation
  wal-g: init at 0.1.2
  maintainers: add backuitist
  nixos/prometheus: Correct documentation for external_labels
  spidermonkey: replace broken links
  vagrant: removed custom rake gem
  vagrant: 2.0.0 -> 2.0.1
  nixos/prometheus: add external_labels option
  nixos/prometheus: add scrape_configs.honor_labels
  ...
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix23
1 files changed, 17 insertions, 6 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 28ad5aeca35f..f922116ed36b 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -158,6 +158,13 @@ let
         cp $buildRoot/{.config,Module.symvers} $dev/lib/modules/${modDirVersion}/build
         make modules_prepare $makeFlags "''${makeFlagsArray[@]}" O=$dev/lib/modules/${modDirVersion}/build
 
+        # Keep some extra files on some arches (powerpc, aarch64)
+        for f in arch/powerpc/lib/crtsavres.o arch/arm64/kernel/ftrace-mod.o; do
+          if [ -f "$buildRoot/$f" ]; then
+            cp $buildRoot/$f $dev/lib/modules/${modDirVersion}/build/$f
+          fi
+        done
+
         # !!! No documentation on how much of the source tree must be kept
         # If/when kernel builds fail due to missing files, you can add
         # them here. Note that we may see packages requiring headers
@@ -165,13 +172,14 @@ let
         # headers on 3.10 though.
 
         chmod u+w -R ../source
-        arch=`cd $dev/lib/modules/${modDirVersion}/build/arch; ls`
+        arch=$(cd $dev/lib/modules/${modDirVersion}/build/arch; ls)
 
-        # Remove unusued arches
-        mv arch/$arch .
-        rm -fR arch
-        mkdir arch
-        mv $arch arch
+        # Remove unused arches
+        for d in $(cd arch/; ls); do
+          if [ "$d" = "$arch" ]; then continue; fi
+          if [ "$arch" = arm64 ] && [ "$d" = arm ]; then continue; fi
+          rm -rf arch/$d
+        done
 
         # Remove all driver-specific code (50M of which is headers)
         rm -fR drivers
@@ -179,6 +187,9 @@ let
         # Keep all headers
         find .  -type f -name '*.h' -print0 | xargs -0 chmod u-w
 
+        # Keep linker scripts (they are required for out-of-tree modules on aarch64)
+        find .  -type f -name '*.lds' -print0 | xargs -0 chmod u-w
+
         # Keep root and arch-specific Makefiles
         chmod u-w Makefile
         chmod u-w arch/$arch/Makefile*