From 6cd3cbbf6bc93dec650916516253b60542e926d0 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Mon, 10 Jul 2023 14:48:40 +0200 Subject: [PATCH] kernel-debs: headers: hack/fix for 6.5-rc1's "tools/counter: Makefile: Remove lingering 'include' directories on make clean" - introduced at https://github.com/torvalds/linux/commit/228354ed692faa08f40f2630658c0771f77da457 - simply creating the dir solves it - reported to author, let's hope for an -rc2 fix. - better logging when DEBUG=yes (don't pass "-s"(ilent) to make clean) --- lib/functions/compilation/kernel-debs.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/functions/compilation/kernel-debs.sh b/lib/functions/compilation/kernel-debs.sh index c7fac51a0b..fc51e50d8d 100644 --- a/lib/functions/compilation/kernel-debs.sh +++ b/lib/functions/compilation/kernel-debs.sh @@ -418,10 +418,14 @@ function kernel_package_callback_linux_headers() { # and "make clean" in the "/tools" dir fails. Drop in a fake Makefile there to work around this. if [[ ! -f "${headers_target_dir}/tools/vm/Makefile" ]]; then display_alert "Creating fake tools/vm/Makefile" "6.3+ hackfix" "debug" - mkdir -p "${headers_target_dir}/tools/vm" + run_host_command_logged mkdir -p "${headers_target_dir}/tools/vm" echo -e "clean:\n\techo fake clean for tools/vm" > "${headers_target_dir}/tools/vm/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" + # Now, make the script dirs clean. # This is run in our _target_ dir, NOT the source tree, so we're free to make clean as we wish without invalidating the next build's cache. # Understand: I'm sending the logs of this to the bitbucket ON PURPOSE: "clean" tries to use clang, ALSA, etc, which are not available. @@ -429,8 +433,8 @@ function kernel_package_callback_linux_headers() { # Important: if the steps _fail_ here, you'll have to enable DEBUG=yes to see what's going on. declare make_bitbucket="&> /dev/null" [[ "${DEBUG}" == "yes" ]] && make_bitbucket="" - run_host_command_logged cd "${headers_target_dir}" "&&" make -s "ARCH=${SRC_ARCH}" "M=scripts" clean "${make_bitbucket}" - run_host_command_logged cd "${headers_target_dir}/tools" "&&" make -s "ARCH=${SRC_ARCH}" clean "${make_bitbucket}" + run_host_command_logged cd "${headers_target_dir}" "&&" make "ARCH=${SRC_ARCH}" "M=scripts" clean "${make_bitbucket}" + run_host_command_logged cd "${headers_target_dir}/tools" "&&" make "ARCH=${SRC_ARCH}" clean "${make_bitbucket}" # Trim down on the tools dir a bit after cleaning. rm -rf "${headers_target_dir}/tools/perf" "${headers_target_dir}/tools/testing"