1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-01-11 15:00:39 +00:00

arm/classes-recipe: Introduce firmware.bbclass

There are now a handful of firmware component recipes in meta-arm, each
of which does its own (slightly different) deployment handling.

Introduce a bbclass to standardize this, with the aim of cleaning up the
DEPLOY_DIR_IMAGE. Crucially, each firmware component deploys into a
${PN} subdirectory of DEPLOY_DIR_IMAGE. This has a few advantages:

 * Many Arm components have the same or similar binary names (BL1, BL2
   etc). This ensures unique naming and avoids confusion.
 * Recipes can afford to be less picky about which binaries are deployed.
   This simplifies component recipes.
 * It is easier to deploy debug symbols in a common way to an expected
   location.
 * It keeps the DEPLOY_DIR_IMAGE clean in the face of ever-increasing
   firmware complexity.

The bbclass also provides a FIRMWARE_DEBUG_BUILD variable to control the
build type of the firmware in one place, defaulting to the global
DEBUG_BUILD. This should allow BSPs in meta-arm-bsp to more easily
provide a release build by default (by providing an easy switch for
development purposes when needed).

Signed-off-by: Peter Hoyes <peter.hoyes@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Peter Hoyes
2025-12-16 16:23:07 +00:00
committed by Jon Mason
parent 55d3afbd12
commit fff0756d6e

View File

@@ -0,0 +1,27 @@
# Common configuration for Arm firmware components
# Firmware packages are always machine-specific
PACKAGE_ARCH = "${MACHINE_ARCH}"
# Allow all firmware to be debugged together
FIRMWARE_DEBUG_BUILD ?= "${@oe.utils.vartrue('DEBUG_BUILD', '1', '0', d)}"
# Use ${MACHINE} as the default platform name for firmware
FIRMWARE_PLATFORM ?= "${MACHINE}"
# Provide a standard folder layout for firmware packages
FIRMWARE_BASE_DIR ?= "/firmware"
FIRMWARE_DIR ?= "${FIRMWARE_BASE_DIR}/${PN}"
FILES:${PN} = "${FIRMWARE_DIR}/*.bin"
FILES:${PN}-dbg = "${FIRMWARE_DIR}/*.elf"
SYSROOT_DIRS += "${FIRMWARE_DIR}"
# Provide a default deploy implementation, which deploys to a subdirectory
# of ${DEPLOY_DIR_IMAGE}
inherit deploy
do_deploy() {
install -d ${DEPLOYDIR}/${PN}
cp -rf ${D}${FIRMWARE_DIR}/* ${DEPLOYDIR}/${PN}
}
addtask deploy after do_install