[17/27] trusted-firmware-a: Migrate to a bbclass

Message ID 7c9907ef0a922ee23bfaf0231bd77e8151debc66.1762170735.git.jan.kiszka@siemens.com
State Under Review
Headers show
Series [01/27] linux-custom: Drop redundant template inheritance | expand

Commit Message

Jan Kiszka Nov. 3, 2025, 11:52 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

"inherit trusted-firmware-a" is shorter and a more common pattern
compared to OE/yocto. Keep the original .inc file as transitional
helper, issuing a warning when it's used with a migration suggestion.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../trusted-firmware-a.bbclass}               |  3 +-
 .../trusted-firmware-a-custom.inc             | 38 +++----------------
 2 files changed, 7 insertions(+), 34 deletions(-)
 copy meta/{recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc => classes-recipe/trusted-firmware-a.bbclass} (92%)

Patch

diff --git a/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc b/meta/classes-recipe/trusted-firmware-a.bbclass
similarity index 92%
copy from meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc
copy to meta/classes-recipe/trusted-firmware-a.bbclass
index 9f143b13..5364b921 100644
--- a/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc
+++ b/meta/classes-recipe/trusted-firmware-a.bbclass
@@ -7,8 +7,7 @@ 
 
 inherit dpkg
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-
+FILESPATH:append = ":${LAYERDIR_core}/recipes-bsp/trusted-firmware-a/files"
 SRC_URI += "file://debian/"
 
 DESCRIPTION ?= "Custom Trusted Firmware A"
diff --git a/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc b/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc
index 9f143b13..f65e322f 100644
--- a/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc
+++ b/meta/recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc
@@ -1,39 +1,13 @@ 
-# Custom Trusted Firmware A build
+# Transitional include for trusted-firmware-a.bbclass
 #
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2020-2025
+# Copyright (c) Siemens AG, 2025
 #
 # SPDX-License-Identifier: MIT
 
-inherit dpkg
+inherit trusted-firmware-a
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-
-SRC_URI += "file://debian/"
-
-DESCRIPTION ?= "Custom Trusted Firmware A"
-
-TF_A_NAME ?= "${MACHINE}"
-TF_A_PLATFORM ?= "unknown"
-TF_A_EXTRA_BUILDARGS ?= ""
-TF_A_BINARIES ?= "release/bl31.bin"
-
-DEBIAN_BUILD_DEPENDS ?= ""
-
-PROVIDES += "trusted-firmware-a-${TF_A_NAME}"
-
-TEMPLATE_FILES = "debian/control.tmpl debian/rules.tmpl"
-TEMPLATE_VARS += "DEBIAN_COMPAT \
-    TF_A_NAME DEBIAN_BUILD_DEPENDS TF_A_PLATFORM TF_A_EXTRA_BUILDARGS"
-
-do_prepare_build() {
-    cp -r ${WORKDIR}/debian ${S}/
-
-    deb_add_changelog
-
-    rm -f ${S}/debian/trusted-firmware-a-${TF_A_NAME}.install
-    for binary in ${TF_A_BINARIES}; do
-        echo "build/${TF_A_PLATFORM}/$binary /usr/lib/trusted-firmware-a/${TF_A_NAME}/" >> \
-            ${S}/debian/trusted-firmware-a-${TF_A_NAME}.install
-    done
+do_warn_custom_inc() {
+    bbwarn "Please migrate from \"require recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc\" to \"inherit trusted-firmware-a\""
 }
+addtask warn_custom_inc before do_unpack