From 94949aec8a38ac00e1daa5f5a02c37c4e3745c8f Mon Sep 17 00:00:00 2001 From: amazingfate Date: Thu, 20 Feb 2025 18:06:56 +0800 Subject: [PATCH] kernel: fix for 6.14 make clean fail at tools dir due to upstream dir change --- lib/functions/compilation/kernel-debs.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/functions/compilation/kernel-debs.sh b/lib/functions/compilation/kernel-debs.sh index 11b8e21ab..631c6d526 100644 --- a/lib/functions/compilation/kernel-debs.sh +++ b/lib/functions/compilation/kernel-debs.sh @@ -435,6 +435,16 @@ function kernel_package_callback_linux_headers() { echo -e "clean:\n\techo fake clean for tools/vm" > "${headers_target_dir}/tools/vm/Makefile" fi + # Small detour: in v6.14-rc1, in commit https://github.com/torvalds/linux/commit/e19bde2269ca, + # the tools/pci dir was renamed to tools/testing/selftests/pci_endpoint. + # Unfortunately tools/Makefile still expects it to exist, + # and "make clean" in the "/tools" dir fails. Drop in a fake Makefile there to work around this. + if [[ ! -f "${headers_target_dir}/tools/pci/Makefile" ]] && [[ "${KERNEL_MAJOR_MINOR}" == "6.14" ]]; then + display_alert "Creating fake tools/pci/Makefile" "6.14 hackfix" "debug" + run_host_command_logged mkdir -p "${headers_target_dir}/tools/pci" + echo -e "clean:\n\techo fake clean for tools/pci" > "${headers_target_dir}/tools/pci/Makefile" + fi + # Hack for 6.5-rc1: create include/linux dir so the 'clean' step below doesn't fail. I've reported upstream... display_alert "Creating fake counter/include/linux" "6.5-rc1 hackfix" "debug" run_host_command_logged mkdir -p "${headers_target_dir}/tools/counter/include/linux"