coreos-modules: Cross-compile module build tools

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2025-02-24 20:42:16 +01:00
parent f8b8b8ce40
commit b048140f97
2 changed files with 9 additions and 1 deletions

View File

@ -42,7 +42,7 @@ DEPEND="=sys-kernel/coreos-sources-${COREOS_SOURCE_VERSION}"
RESTRICT="binchecks strip"
# The build tools are OK and shouldn't trip up multilib-strict.
QA_MULTILIB_PATHS="usr/lib/modules/.*/build/scripts/.*"
QA_MULTILIB_PATHS="usr/lib/modules/.*/build/scripts/kconfig/.*"
# Use source installed by coreos-sources
# KERNEL_DIR must find the kernel source tree under /usr/src/linux-*-coreos,

View File

@ -54,6 +54,14 @@ src_install() {
# Clean up the build tree
shred_keys
kmake clean
# TODO: ensure that fixdep and kbuild tools shipped inside the image
# are native (we previously shipped amd64 binaries on arm64).
# Upstream has a new script from v6.12 that we might be able to use:
# scripts/package/install-extmod-build
kmake HOSTLD=$(tc-getLD) HOSTCC=$(tc-getCC) cmd_and_fixdep='$(cmd)' modules_prepare
kmake clean
find "build/" -type d -empty -delete || die
rm "build/.config.old" || die