[v2] linux-custom: Sync provides value with build profiles

Message ID 20251110145315.333626-1-amikan@ilbers.de
State Under Review
Headers show
Series [v2] linux-custom: Sync provides value with build profiles | expand

Commit Message

Anton Mikanovich Nov. 10, 2025, 2:53 p.m. UTC
Packages linux-libc-dev and linux-libc-dev-${DISTRO_ARCH}-cross were
added to PROVIDES variable unconditionally, while those packages are
not really built until KERNEL_LIBC_DEV_DEPLOY enabled (which is set to
"0" by default).

Add libc-dev packages to PROVIDES only if there are no 'nolibcdev'
Debian build profile used so PROVIDES will be always in sync with real
set of packages being built.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
Changes in v2:
- Rebase on collision fixes in next.
- Migrate implementation to overrides.

 meta/recipes-kernel/linux/linux-custom.inc | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 9dd9abb5..5071367d 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -156,12 +156,19 @@  ISAR_CROSS_COMPILE:class-kbuildtarget = "0"
 RECIPE_PROVIDES = " \
     linux-image-${KERNEL_NAME_PROVIDED} \
     linux-headers-${KERNEL_NAME_PROVIDED} \
-    linux-libc-dev \
-    linux-libc-dev-${DISTRO_ARCH}-cross \
     linux-image-${KERNEL_NAME_PROVIDED}-dbg \
     linux-kbuild-${KERNEL_NAME_PROVIDED} \
     ${BPN}-pseudo-native \
 "
+
+# Provide linux-libc-dev packages unless nolibcdev profile used
+OVERRIDES:append = ":${@ bb.utils.contains('DEB_BUILD_PROFILES', 'pkg.{}.nolibcdev'.format(d.getVar('BPN')), 'nolibcdev', 'libcdev', d)}"
+
+RECIPE_PROVIDES:append:libcdev = " \
+    linux-libc-dev \
+    linux-libc-dev-${DISTRO_ARCH}-cross \
+"
+
 # When cross-profile is active:
 # kbuild package is provided by -native or -kbuildtarget variant. Also headers
 # provisioning moves over to ensure those variants are pulled, although the