From f87d354fe656b0e62e55daf8888318aaf9dc2986 Mon Sep 17 00:00:00 2001 From: Francesco Mancino Date: Mon, 7 Oct 2024 10:20:19 +0000 Subject: [PATCH] package/linux-headers: pass --no-print-directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit 5fc10e76fa2a9 in linux v6.5-rc1, the kernel does a recursive make call to add the --no-print-directory flag if it is not set. Buildroot sets MAKEOVERRIDES empty, which causes none of the command-line overrides to be propagated to sub-makes. This only goes one level deep, so it is not a problem. However, if the user sets MAKEOVERRIDES in their environment, the environment _does_ get propagated down to sub-makes. Therefore, the recursive call from within the kernel will not get any of the command-line overrides we give it. As a result, INSTALL_HDR_PATH will not get passed down to the kernel's sub-make, thereby breaking the installation to staging. Note that if Buildroot itself does a sub-make call (e.g. because O= is set, or umask is different), --no-print-directory is already added so the issue doesn't occur. Set --no-print-directory explicitly, which avoids the kernel's sub-make call, which preserves INSTALL_HDR_PATH. It is only really needed for the staging install, since the local install in _CONFIGURE_CMDS just sets it to the default value. For consistency though, set it there as well. Setting --no-print-directory when it is not needed doesn't hurt. Signed-off-by: Francesco Mancino Signed-off-by: Arnout Vandecappelle (cherry picked from commit 77faecb13afa7255bb04a6260201fd535e88887c) Signed-off-by: Raphaël Mélotte --- package/linux-headers/linux-headers.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/linux-headers/linux-headers.mk b/package/linux-headers/linux-headers.mk index 15724090ce..ed37410ea6 100644 --- a/package/linux-headers/linux-headers.mk +++ b/package/linux-headers/linux-headers.mk @@ -135,6 +135,7 @@ LINUX_HEADERS_DEPENDENCIES = $(BR2_MAKE_HOST_DEPENDENCY) define LINUX_HEADERS_CONFIGURE_CMDS (cd $(@D); \ $(TARGET_MAKE_ENV) $(BR2_MAKE) \ + --no-print-directory \ ARCH=$(KERNEL_ARCH) \ HOSTCC="$(HOSTCC)" \ HOSTCFLAGS="$(HOSTCFLAGS)" \ @@ -146,6 +147,7 @@ endef define LINUX_HEADERS_INSTALL_STAGING_CMDS (cd $(@D); \ $(TARGET_MAKE_ENV) $(BR2_MAKE) \ + --no-print-directory \ ARCH=$(KERNEL_ARCH) \ HOSTCC="$(HOSTCC)" \ HOSTCFLAGS="$(HOSTCFLAGS)" \