mbox series

[0/2] Fix kernel complementary package installation

Message ID 20260921215300.582692-1-adrian.freihofer@siemens.com
Headers show
Series Fix kernel complementary package installation | expand

Message

AdrianF Sept. 21, 2026, 9:50 p.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

Recipes usually name the standard packages based on PN. However, the kernel
uses ${KERNEL_PACKAGE_NAME} as the base name for its packages. This causes
inconsistent -src package naming and prevents complementary package
installation from finding the expected kernel packages. For example, a kernel
can produce kernel-dbg and linux-yocto-src, causing rootfs-dbg to include the
linux-yocto-src package but not kernel-dbg.

Introduce PACKAGE_BASENAME so recipes whose package names are based on
something other than PN can generate consistent -src package names and expose
the base name in pkgdata. Update oe-pkgdata-util to use PACKAGE_BASENAME when
resolving complementary package globs, with a fallback to PN for existing
pkgdata.

This is one possible way to handle the kernel-specific package naming. Other
approaches may be possible too. Some ideas:

- Do we really need this KERNEL_PACKAGE_NAME special feature for kernel
  packages? Or would it be possible to stick to ${PN} as any other recipe
  does?
- Is installing the kernel's complementary packages via standard
  complementary package installation the right mechanism for kernel
  packages? Or should there be a different mechanism which is more in line
  with how the kernel usually gets installed where installing it into the
  rootfs as a package is only one way out of many.

Adrian Freihofer (2):
  package: introduce PACKAGE_BASENAME for consistent kernel -src naming
  oe-pkgdata-util: use PACKAGE_BASENAME for glob PN-substitution
    fallback

 meta/classes-global/package.bbclass | 2 +-
 meta/classes-recipe/kernel.bbclass  | 3 +++
 meta/conf/bitbake.conf              | 6 ++++++
 meta/lib/oe/package.py              | 4 +++-
 scripts/oe-pkgdata-util             | 7 ++++++-
 5 files changed, 19 insertions(+), 3 deletions(-)