diff mbox series

[RFC,06/08] kernel-devsrc: skip the recipe if no PACKAGECONFIG level is set

Message ID 20261106173235.4155305-7-bruce.ashfield@gmail.com
State New
Headers show
Series enhance kernel -devsrc output options | expand

Commit Message

Bruce Ashfield Nov. 6, 2026, 5:32 p.m. UTC
From: Bruce Ashfield <bruce.ashfield@gmail.com>

With none of build, source, full or tarball in PACKAGECONFIG,
kernel-devsrc still builds and installs, but the package is only the
/usr/src/kernel link to an empty tree. Nothing fails until someone
tries to use it on target, and then it is not obvious why.

Skip the recipe with a message instead, so an image that installs
kernel-devsrc fails at parse time and says which PACKAGECONFIG
is missing.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
index c2021002d4..621afb04de 100644
--- a/meta/recipes-kernel/linux/kernel-devsrc.bb
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -50,6 +50,13 @@  PACKAGECONFIG[tarball] = ",,,bzip2"
 # python3, make, ...).
 SKIP_FILEDEPS:${PN} = "${@'1' if bb.utils.contains('PACKAGECONFIG', 'full', True, False, d) and not bb.utils.contains_any('PACKAGECONFIG', 'build tarball', True, False, d) else '0'}"
 
+# Without a level, kernel-devsrc would only be a /usr/src/kernel link to an
+# empty tree.
+python () {
+    if not bb.utils.contains_any('PACKAGECONFIG', 'build source full tarball', True, False, d):
+        raise bb.parse.SkipRecipe("PACKAGECONFIG needs at least one of build, source, full or tarball")
+}
+
 # The curated part of the 'source' level, copied in full along with
 # arch/${ARCH}. The rest (drivers, sound, samples, ...) is not curated: the
 # files the kernel build read are discovered from the manifest the kernel