From d0ec958162e70a3b3de82721eb6e601c2a200c0e Mon Sep 17 00:00:00 2001 From: The-going <48602507+The-going@users.noreply.github.com> Date: Sun, 22 Dec 2024 20:53:52 +0300 Subject: [PATCH] kernel_package_callback_linux_headers: Fix the cleaning process for tools. In order for the cleanup to be correct for tools, we need to pass the VMLINUX_BTF variable, which contains the real path to the vmlinux file we just compiled. The vmlinux file itself is not involved in cleaning, but the Makefile checks for its presence and cleaning is aborted if it is not found. --- lib/functions/compilation/kernel-debs.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/functions/compilation/kernel-debs.sh b/lib/functions/compilation/kernel-debs.sh index 13e8f177f8..c29a4abfd5 100644 --- a/lib/functions/compilation/kernel-debs.sh +++ b/lib/functions/compilation/kernel-debs.sh @@ -444,10 +444,13 @@ function kernel_package_callback_linux_headers() { # Understand: I'm sending the logs of this to the bitbucket ON PURPOSE: "clean" tries to use clang, ALSA, etc, which are not available. # The logs produced during this step throw off developers casually looking at the logs. # Important: if the steps _fail_ here, you'll have to enable DEBUG=yes to see what's going on. + # + # In order for the cleanup to be correct for tools, we need to pass the VMLINUX_BTF variable, + # which contains the real path to the newly compiled vmlinux file. declare make_bitbucket="&> /dev/null" [[ "${DEBUG}" == "yes" ]] && 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}" + run_host_command_logged cd "${headers_target_dir}/tools" "&&" make "ARCH=${SRC_ARCH}" "VMLINUX_BTF=${kernel_work_dir}/vmlinux" 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"