From 2458c94c9e177ad92aedc8b128a1e92e4dc3bd56 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 24 Apr 2023 13:33:04 -0700 Subject: [PATCH] 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 --- pkgs/os-specific/linux/kernel/manual-config.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index 1c244664975b..677cc9363da4 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;