Skip to content

Commit

Permalink
lib/systems: strip kernel to avoid reference cycles
Browse files Browse the repository at this point in the history
Since #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
  • Loading branch information
Adam Joseph committed Jul 6, 2023
1 parent 4d92ffb commit 2458c94
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkgs/os-specific/linux/kernel/manual-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2458c94

Please sign in to comment.