mbox series

[PATCHv2,0/4] Add support for per-kernel recipe variants

Message ID 20250411200852.51967-1-chris.larson@siemens.com
Headers show
Series Add support for per-kernel recipe variants | expand

Message

chris.larson April 11, 2025, 8:08 p.m. UTC
From: Christopher Larson <chris.larson@siemens.com>

Add support for generation of per-kernel recipe variants. This aids in the
ability for a MACHINE to support multiple kernels, by allowing us to generate
per-kernel packages in recipes like external kernel modules. Enable this
support by default for external kernel modules.

A new variable KERNEL_NAMES will list the kernels for which variants will be
generated. For any kernels listed other than KERNEL_NAME, a variant of the
recipe will be produced, to generate a package or packages for that kernel.
In each variant, the KERNEL_NAME variable will be set to the kernel name for
which the variant is being built, and the `kernel-<kernel_name>` override
will be added, allowing for further metadata customization on a per-kernel
basis.

In a recipe that already uses KERNEL_NAME and appends it to its PN, all you
need to do to use this is to inherit per-kernel, and add any additional kernels
you want to support to KERNEL_NAMES. The second patch in this series
does so for external kernel modules by default, but this will have no effect
on existing recipes unless KERNEL_NAMES is set to something other than
KERNEL_NAME.

A new test is added to verify that the per-kernel support works as expected.

No documentation for the per-kernel class is added, as it's already being enabled
for external kernel modules, which is the main use case, and no other optional
bbclasses are being documented in the user manual today.

Christopher Larson (4):
  per-kernel.bbclass: add class
  linux-module: inherit per-kernel
  testsuite: add 'extra_lines' argument to configure
  testsuite: add a test for per_kernel support

 meta/classes/per-kernel.bbclass             | 35 +++++++++++++++++++++
 meta/recipes-kernel/linux-module/module.inc |  1 +
 testsuite/cibuilder.py                      |  5 +++
 testsuite/citest.py                         | 22 +++++++++++++
 4 files changed, 63 insertions(+)
 create mode 100644 meta/classes/per-kernel.bbclass