@@ -679,6 +679,9 @@ EXPORT_FUNCTIONS do_compile do_transform_kernel do_transform_bundled_initramfs d
# kernel-base becomes kernel-${KERNEL_VERSION}
# kernel-image becomes kernel-image-${KERNEL_VERSION}
PACKAGES = "${KERNEL_PACKAGE_NAME} ${KERNEL_PACKAGE_NAME}-base ${KERNEL_PACKAGE_NAME}-vmlinux ${KERNEL_PACKAGE_NAME}-image ${KERNEL_PACKAGE_NAME}-dev ${KERNEL_PACKAGE_NAME}-modules ${KERNEL_PACKAGE_NAME}-dbg"
+# Keep the auto-generated -src package (see populate_packages() in oe/package.py) named,
+# and resolvable by tools like oe-pkgdata-util, consistently with the rest of the kernel-* family.
+PACKAGE_BASENAME = "${KERNEL_PACKAGE_NAME}"
FILES:${PN} = ""
FILES:${KERNEL_PACKAGE_NAME}-base = "${KERNEL_MODULE_INSTALL_PREFIX}/modules.order ${KERNEL_MODULE_INSTALL_PREFIX}/modules.builtin ${KERNEL_MODULE_INSTALL_PREFIX}/modules.builtin.modinfo"
FILES:${KERNEL_PACKAGE_NAME}-image = ""
@@ -334,6 +334,12 @@ SOLIBSDEV:mingw32 = ".dll"
PACKAGE_DEBUG_SPLIT_STYLE ?= "debug-with-srcpkg"
+# The base name recipe sub-packages (-dbg, -dev, -src etc.) are derived from.
+# Recipes/bbclasses that name their packages after something other than PN
+# (e.g. kernel.bbclass and KERNEL_PACKAGE_NAME) should override this so that
+# tooling (e.g. oe-pkgdata-util) can still map generic package globs to them.
+PACKAGE_BASENAME ??= "${PN}"
+
PACKAGE_BEFORE_PN ?= ""
PACKAGES = "${PN}-src ${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
PACKAGES_DYNAMIC = "^${PN}-locale-.*"
@@ -1391,7 +1391,9 @@ def populate_packages(d):
# If debug-with-srcpkg mode is enabled then add the source package if it
# doesn't exist and add the source file contents to the source package.
if split_source_package:
- src_package_name = ('%s-src' % d.getVar('PN'))
+ # PACKAGE_BASENAME lets bbclasses (e.g. kernel.bbclass via KERNEL_PACKAGE_NAME)
+ # that name their other sub-packages differently from PN keep -src consistent with them.
+ src_package_name = ('%s-src' % (d.getVar('PACKAGE_BASENAME') or pn))
if not src_package_name in packages:
packages.append(src_package_name)
d.setVar('FILES:%s' % src_package_name, '/usr/src/debug')