coreos-kernel.eclass: Install host arch Makefiles into source dir

Gentoo's linux-info.eclass tries to check the kernel version by
including /lib/modules/.../source/Makefile and printing $(VERSION).  It
unsets ARCH= before doing this (no clue why) which works with a full
source tree but not with our minimized one. To fix this we need to
archive arch/x86/Makefile also for arm64.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2024-03-11 17:24:24 +00:00
parent 79294342a9
commit 42ed2d9b7e

View File

@ -187,6 +187,7 @@ shred_keys() {
# Populate /lib/modules/$(uname -r)/{build,source}
install_build_source() {
local kernel_arch=$(tc-arch-kernel)
local host_kernel_arch=$(tc-ninja_magic_to_arch kern "${CBUILD}")
# NOTE: We have to get ${archabspaths} before removing symlinks under
# /usr/lib/modules. However, do not exclude "dt-bindings" for now,
@ -232,6 +233,7 @@ install_build_source() {
# or arm64.
{
echo source/Makefile
find source/arch/${host_kernel_arch} -follow -maxdepth 1 -name 'Makefile*' -print
find source/arch/${kernel_arch} -follow -maxdepth 1 -name 'Makefile*' -print
find source/arch/${kernel_arch} -follow \( -name 'module.lds' -o -name 'Kbuild.platforms' -o -name 'Platform' \) -print
find $(find source/arch/${kernel_arch} -follow \( -name include -o -name scripts \) -follow -type d -print) -print