mbox series

[00/25] Class file improvements

Message ID 20260802102854.3952760-1-richard.purdie@linuxfoundation.org
Headers show
Series Class file improvements | expand

Message

Richard Purdie Aug. 2, 2026, 10:28 a.m. UTC
This series starts to clean up a few class file issues. The general theme is
to move python functions into lib/oe and out of the class files.

It does separate out "kernel" from barebox and u-boot which removes certain
headaches.

The series does break some things, notably:

* the get_kernel*() functions are now oe.kernel.get*()
* kernel-arch no longer exports or sets ARCH and UBOOT_ARCH, there are
  functions you can use to get the values instead
* ARCH and UBOOT_ARCH are not exported into the environment in most cases
* the default kernel build make commands now sets ARCH
* various utils.bbclass python functions are now oe.utils.XXX()
* most sanity.bbclass functions are now oe.sanity.XXX()
* the 'valid_arches' variable is no longer available to change ARCH
* the linux-kernel-base class was removed
* lsb_distro_identifier is now always oe.lsb.distro_identifier()

The changes to adapt should hopefully not be too onerous and should
give us a cleaner code base which is easier to follow with a better data 
store memory usage profile.

There is more work to be done along these lines but this is a start...

Richard Purdie (25):
  sstatesig: Use kernel.bbclass instead of linux-kernel-base.bbclass
  linux-kernel-base: Delete unused function
  lib/oe/kernel: Move python functions from linux-kernel-base to library
    code
  kernel-yocto: Simplify code for cleanliness and slight performance
  kernel-arch: Move kernel and uboot arch functions to lib/oe/kernel.py
  kernel-arch: Simplify KERNEL_ARCH variable usage
  kernel-arch: Don't export UBOOT_ARCH
  u-boot: Separate out from kernel-arch.bbclass
  barebox: Separate out from kernel-arch.bbclass
  lib/oe/kernel: Simplify map_uboot_arch
  image_types/kernel-uimage: Swap UBOOT_ARCH for
    oe.kernel.map_uboot_arch call
  kernel-fit-image: Swap UBOOT_ARCH for oe.kernel.map_uboot_arch call
  linux-yocto-fitimage: Set UBOOT_ARCH
  kernel-arch: Drop UBOOT_ARCH
  linux-libc-headers: Drop kernel-arch and set ARCH directly
  toolchain-scripts: Drop usage of kernel-arch
  kernel-arch: Move ARCH usage into target classes
  linux-yocto-fitimage: Drop obsolete dependency on linux-kernel-base
  linux-kernel-base: Fold remainder into kernel-arch and drop
  kernel-devicetree: Add missing function prefixes
  utils: Drop explode_deps function
  utils: Move functions from utils.bbclass to utils.py
  lib/oe/lsb: Merge distro_identifier functions
  sanity: Move code to lib/oe
  sanity: Drop unreachable code

 meta/classes-global/base.bbclass              |   14 +-
 meta/classes-global/package.bbclass           |    2 +-
 meta/classes-global/sanity.bbclass            | 1050 +----------------
 meta/classes-global/utils.bbclass             |   93 --
 meta/classes-recipe/barebox.bbclass           |    4 +-
 meta/classes-recipe/cross-canadian.bbclass    |    2 +-
 meta/classes-recipe/devicetree.bbclass        |    4 +-
 meta/classes-recipe/image.bbclass             |    4 +-
 meta/classes-recipe/image_types.bbclass       |    4 +-
 meta/classes-recipe/kernel-arch.bbclass       |   80 +-
 meta/classes-recipe/kernel-devicetree.bbclass |    8 +-
 meta/classes-recipe/kernel-fit-image.bbclass  |    4 +-
 meta/classes-recipe/kernel-uimage.bbclass     |    2 +-
 meta/classes-recipe/kernel-yocto.bbclass      |   10 +-
 meta/classes-recipe/kernel.bbclass            |   19 +-
 meta/classes-recipe/kernelsrc.bbclass         |    6 +-
 meta/classes-recipe/linux-kernel-base.bbclass |   62 -
 meta/classes-recipe/module-base.bbclass       |    1 +
 meta/classes-recipe/populate_sdk_base.bbclass |   10 +-
 meta/classes-recipe/populate_sdk_ext.bbclass  |    2 +-
 meta/classes-recipe/testimage.bbclass         |    2 +-
 meta/classes-recipe/toolchain-scripts.bbclass |    4 +-
 meta/classes/multilib.bbclass                 |    2 +-
 meta/classes/report-error.bbclass             |    2 +-
 meta/classes/sign_ipk.bbclass                 |    4 +-
 meta/classes/sign_package_feed.bbclass        |    4 +-
 meta/classes/sign_rpm.bbclass                 |    6 +-
 meta/conf/multilib.conf                       |    2 +-
 meta/lib/oe/__init__.py                       |    2 +-
 meta/lib/oe/kernel.py                         |   88 ++
 meta/lib/oe/lsb.py                            |   10 +-
 meta/lib/oe/sanity.py                         | 1032 ++++++++++++++++
 meta/lib/oe/sstatesig.py                      |    2 +-
 meta/lib/oe/utils.py                          |   85 ++
 meta/lib/oeqa/sdk/testsdk.py                  |    2 +-
 meta/recipes-bsp/u-boot/u-boot.inc            |    7 +-
 meta/recipes-core/glibc/glibc-ld.inc          |    2 +-
 meta/recipes-core/meta/dummy-sdk-package.inc  |    2 +-
 meta/recipes-core/meta/meta-environment.bb    |    2 +-
 meta/recipes-core/meta/meta-go-toolchain.bb   |    2 +-
 .../packagegroups/packagegroup-core-sdk.bb    |    4 +-
 .../packagegroup-cross-canadian.bb            |    6 +-
 .../packagegroup-go-cross-canadian.bb         |    2 +-
 .../packagegroup-rust-cross-canadian.bb       |    2 +-
 .../linux-libc-headers/linux-libc-headers.inc |    4 +-
 .../linux/linux-yocto-fitimage.bb             |    6 +-
 .../make-mod-scripts/make-mod-scripts_1.0.bb  |    8 +-
 meta/recipes-kernel/perf/perf.bb              |    4 +-
 48 files changed, 1323 insertions(+), 1356 deletions(-)
 delete mode 100644 meta/classes-recipe/linux-kernel-base.bbclass
 create mode 100644 meta/lib/oe/kernel.py
 create mode 100644 meta/lib/oe/sanity.py