From: "prasanth" <ragaprasanth@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: bruce.ashfield@gmail.com, Prasanth R <ragaprasanth@gmail.com>,
Prasanth R <prasanth.r@lineo.co.jp>
Subject: [PATCH] kernel.bbclass: fix -dev files when KERNEL_PACKAGE_NAME is PN
Date: Thu, 29 Oct 2026 11:40:10 +0900 [thread overview]
Message-ID: <20261029024010.2113092-1-ragaprasanth@gmail.com> (raw)
With KERNEL_PACKAGE_NAME = "${PN}", FILES:${KERNEL_PACKAGE_NAME}-dev and
FILES:${PN}-dev from bitbake.conf become the same variable and the
bitbake.conf value wins. The same happens for -dbg. The kernel files are
then not packaged and do_package fails:
ERROR: linux-yocto-7.2.8+git-r0 do_package: QA Issue: linux-yocto:
Files/directories were installed but not shipped in any package:
/boot/System.map-7.2.8-yocto-standard
/boot/config-7.2.8-yocto-standard
/boot/Module.symvers-7.2.8-yocto-standard
This matters when a second kernel recipe. So, Rename the kernel variables
to the ${PN} names before the keys are expanded, so the kernel values are kept.
Remove the old warning about bug 11905, which was closed as not a bug.
AI-Generated: Uses Claude
Signed-off-by: Prasanth R <prasanth.r@lineo.co.jp>
---
Notes:
Tested on master: without this patch do_package fails with the
QA error above; with it the build passes with no warnings and linux-yocto-dev
contains System.map, Module.symvers and the config.
meta/classes-recipe/kernel.bbclass | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 0a6d754108..b018c164fd 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -60,16 +60,23 @@ KERNEL_VERSION_NAME[vardepvalue] = "${LINUX_VERSION}"
KERNEL_VERSION_PKG_NAME = "${@legitimize_package_name(d.getVar('KERNEL_VERSION'))}"
KERNEL_VERSION_PKG_NAME[vardepvalue] = "${LINUX_VERSION}"
+# With KERNEL_PACKAGE_NAME = "${PN}", FILES:${PN}-dev/-dbg from bitbake.conf
+# would replace the kernel values during key expansion, so rename the kernel
+# variables to the ${PN} names first.
+python kernel_package_name_handler () {
+ d = e.data
+ if d.getVar("KERNEL_PACKAGE_NAME") != d.getVar("PN"):
+ return
+
+ for pkg in ("dev", "dbg"):
+ d.renameVar("FILES:${KERNEL_PACKAGE_NAME}-%s" % pkg, "FILES:${PN}-%s" % pkg)
+}
+addhandler kernel_package_name_handler
+kernel_package_name_handler[eventmask] = "bb.event.RecipePreFinalise"
+
python __anonymous () {
- pn = d.getVar("PN")
kpn = d.getVar("KERNEL_PACKAGE_NAME")
- # XXX Remove this after bug 11905 is resolved
- # FILES:${KERNEL_PACKAGE_NAME}-dev doesn't expand correctly
- if kpn == pn:
- bb.warn("Some packages (E.g. *-dev) might be missing due to "
- "bug 11905 (variable KERNEL_PACKAGE_NAME == PN)")
-
# The default kernel recipe builds in a shared location defined by
# bitbake/distro confs: STAGING_KERNEL_DIR and STAGING_KERNEL_BUILDDIR.
# Set these variables to directories under ${WORKDIR} in alternate
--
2.34.1
next reply other threads:[~2026-10-29 2:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 2:40 prasanth [this message]
2026-10-29 3:35 ` [PATCH] kernel.bbclass: fix -dev files when KERNEL_PACKAGE_NAME is PN Bruce Ashfield
2026-10-29 5:08 ` prasanth
2026-10-29 6:00 ` Prasanth Ramesh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261029024010.2113092-1-ragaprasanth@gmail.com \
--to=ragaprasanth@gmail.com \
--cc=bruce.ashfield@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=prasanth.r@lineo.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.