diff mbox series

[RFC,1/5] baremetal, linux-dummy: bypass kernel dependencies for baremetal

Message ID 20251002000810.226673-1-denis@denix.org
State New
Headers show
Series [RFC,1/5] baremetal, linux-dummy: bypass kernel dependencies for baremetal | expand

Commit Message

Denys Dmytriyenko Oct. 2, 2025, 12:08 a.m. UTC
From: Denys Dmytriyenko <denys@konsulko.com>

When building something for baremetal configs (such as firmware
images for heterogeneous cores), you don't normally include Linux
kernel. But yocto-check-layer (and possibly other tools) tend to
dump "world" signatures and trip over a large number of Linux
kernel depdencies from other recipes and packagegroups. Those
aren't limited to directly depending on virtual/kernel, but also
everything else kernel-related, such as tools, device trees and
especially a large number of specific kernel module RRECOMMENDS.

As linux-dummy was originally created to specifically cut down all
such kernel dependencies when it's not built or packaged normally,
we can re-use it for baremetal configs as well.

Since linux-dummy can now be used outside of Linux host, update
COMPATIBLE_HOST accordingly.

Also, cut out kernel-devsrc (kernel sources) from the world build
completely - it is quite weird and very custom on its own.

[YOCTO #15982]

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
---
 meta/conf/distro/include/tclibc-baremetal.inc | 1 +
 meta/recipes-kernel/linux/kernel-devsrc.bb    | 2 ++
 meta/recipes-kernel/linux/linux-dummy.bb      | 2 --
 3 files changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/conf/distro/include/tclibc-baremetal.inc b/meta/conf/distro/include/tclibc-baremetal.inc
index abea5a7162..adac212dc0 100644
--- a/meta/conf/distro/include/tclibc-baremetal.inc
+++ b/meta/conf/distro/include/tclibc-baremetal.inc
@@ -8,6 +8,7 @@  LIBCOVERRIDE = ":libc-baremetal"
 
 ASSUME_PROVIDED += "virtual/libc virtual/libiconv virtual/crypt"
 
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-dummy"
 PREFERRED_PROVIDER_virtual/libc ?= "musl"
 PREFERRED_PROVIDER_virtual/libiconv ?= "musl"
 PREFERRED_PROVIDER_virtual/libintl ?= "gettext"
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index 04dd683dde..dbad6f113a 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -423,3 +423,5 @@  RDEPENDS:${PN} += "${@bb.utils.contains('ARCH', 'powerpc', 'elfutils-dev', '', d
 RDEPENDS:${PN} += "gcc-plugins libmpc-dev"
 # 5.13+ needs grep for powerpc
 RDEPENDS:${PN}:append:powerpc = " grep"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-kernel/linux/linux-dummy.bb b/meta/recipes-kernel/linux/linux-dummy.bb
index d7f39a452d..6199787a71 100644
--- a/meta/recipes-kernel/linux/linux-dummy.bb
+++ b/meta/recipes-kernel/linux/linux-dummy.bb
@@ -25,8 +25,6 @@  DESCRIPTION:kernel-vmlinux = "Kernel vmlinux meta package"
 
 INHIBIT_DEFAULT_DEPS = "1"
 
-COMPATIBLE_HOST = ".*-linux"
-
 SRC_URI = "file://COPYING.GPL"
 
 S = "${UNPACKDIR}"