about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/manual-config.nix
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-04-24 13:33:04 -0700
committerAdam Joseph <adam@westernsemico.com>2023-07-06 10:46:24 -0700
commit2458c94c9e177ad92aedc8b128a1e92e4dc3bd56 (patch)
treed1aad608adb7026828b0cc67a00e81293b76f474 /pkgs/os-specific/linux/kernel/manual-config.nix
parent4d92ffb39b30748dbfc6b335d701087317a126b1 (diff)
lib/systems: strip kernel to avoid reference cycles
Since https://github.com/NixOS/nixpkgs/pull/221707 we must ensure
that the image resulting from a kernel build is stripped.  If we do
not do this, there will be circular dependencies among its outpaths.

This commit fixes the breakage on mips.

Closes #224694
Diffstat (limited to 'pkgs/os-specific/linux/kernel/manual-config.nix')
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 1c244664975bc..677cc9363da43 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -373,11 +373,20 @@ stdenv.mkDerivation ({
 
     # Remove reference to kmod
     sed -i Makefile -e 's|= ${buildPackages.kmod}/bin/depmod|= depmod|'
+  ''
+  # unfortunately linux/arch/mips/Makefile does not understand installkernel
+  # and simply copies to $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE)
+  + lib.optionalString stdenv.hostPlatform.isMips ''
+    mv $out/vmlinux-* $out/vmlinux || true
+    mv $out/vmlinuz-* $out/vmlinuz || true
+    mv $out/System.map-* $out/System.map
   '';
 
   preFixup = ''
     # Don't strip $dev/lib/modules/*/vmlinux
     stripDebugList="$(cd $dev && echo lib/modules/*/build/*/)"
+  '' + lib.optionalString (stdenv.hostPlatform.isMips) ''
+    $STRIP -s $out/vmlinux || true
   '';
 
   enableParallelBuilding = true;