[v2,15/27] optee-client: Migrate to a bbclass

Message ID c33c99901a822b9d9cfa608ba744c2ddadd3665c.1762759360.git.jan.kiszka@siemens.com
State Under Review
Headers show
Series Use more classes! | expand

Commit Message

Jan Kiszka Nov. 10, 2025, 7:22 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

"inherit optee-client" 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>
---
 .../optee-client.bbclass}                     |  9 +++--
 .../optee-client/optee-client-custom.inc      | 40 ++++---------------
 2 files changed, 13 insertions(+), 36 deletions(-)
 copy meta/{recipes-bsp/optee-client/optee-client-custom.inc => classes-recipe/optee-client.bbclass} (84%)

Patch

diff --git a/meta/recipes-bsp/optee-client/optee-client-custom.inc b/meta/classes-recipe/optee-client.bbclass
similarity index 84%
copy from meta/recipes-bsp/optee-client/optee-client-custom.inc
copy to meta/classes-recipe/optee-client.bbclass
index e54c8763..40bf68c2 100644
--- a/meta/recipes-bsp/optee-client/optee-client-custom.inc
+++ b/meta/classes-recipe/optee-client.bbclass
@@ -9,13 +9,12 @@ 
 
 inherit dpkg
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-
 DESCRIPTION = "OPTee Client"
 
 PROVIDES = "libteec1 libckteec0 libseteec0 libteeacl0.1.0"
 PROVIDES += "optee-client-dev tee-supplicant"
 
+FILESPATH:append = ":${LAYERDIR_core}/recipes-bsp/optee-client/files"
 SRC_URI += "file://debian"
 
 TEE_FS_PARENT_PATH ?= "/var/lib/optee-client/data/tee"
@@ -23,7 +22,11 @@  TEE_FS_PARENT_PATH ?= "/var/lib/optee-client/data/tee"
 RPMB_EMU ?= "0"
 
 TEMPLATE_FILES = "debian/rules.tmpl debian/control.tmpl"
-TEMPLATE_VARS += "DEBIAN_COMPAT TEE_FS_PARENT_PATH RPMB_EMU DEBIAN_STANDARDS_VERSION"
+TEMPLATE_VARS += " \
+    DEBIAN_COMPAT \
+    DEBIAN_STANDARDS_VERSION \
+    TEE_FS_PARENT_PATH \
+    RPMB_EMU"
 
 do_prepare_build[cleandirs] += "${S}/debian"
 do_prepare_build() {
diff --git a/meta/recipes-bsp/optee-client/optee-client-custom.inc b/meta/recipes-bsp/optee-client/optee-client-custom.inc
index e54c8763..dcc17637 100644
--- a/meta/recipes-bsp/optee-client/optee-client-custom.inc
+++ b/meta/recipes-bsp/optee-client/optee-client-custom.inc
@@ -1,42 +1,16 @@ 
+# Transitional include for optee-client.bbclass
 #
-# Copyright (c) Siemens AG, 2023-2025
+# Copyright (c) Siemens AG, 2025
 #
 # Authors:
-#  Su Bao Cheng <baocheng.su@siemens.com>
+#  Jan Kiszka <jan.kiszka@siemens.com>
 #
 # SPDX-License-Identifier: MIT
 #
 
-inherit dpkg
+inherit optee-client
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-
-DESCRIPTION = "OPTee Client"
-
-PROVIDES = "libteec1 libckteec0 libseteec0 libteeacl0.1.0"
-PROVIDES += "optee-client-dev tee-supplicant"
-
-SRC_URI += "file://debian"
-
-TEE_FS_PARENT_PATH ?= "/var/lib/optee-client/data/tee"
-# To use the builtin RPMB emulation, change to 1
-RPMB_EMU ?= "0"
-
-TEMPLATE_FILES = "debian/rules.tmpl debian/control.tmpl"
-TEMPLATE_VARS += "DEBIAN_COMPAT TEE_FS_PARENT_PATH RPMB_EMU DEBIAN_STANDARDS_VERSION"
-
-do_prepare_build[cleandirs] += "${S}/debian"
-do_prepare_build() {
-    cp -r ${WORKDIR}/debian ${S}/
-
-    deb_add_changelog
-
-    echo "/usr/sbin/*" > ${S}/debian/tee-supplicant.install
-    echo "lib/optee_armtz/" > ${S}/debian/tee-supplicant.dirs
-    echo "usr/lib/tee-supplicant/plugins/" >> ${S}/debian/tee-supplicant.dirs
-
-    echo "usr/lib/*/libteec*.so.*" > ${S}/debian/libteec1.install
-
-    echo "usr/include/*" > ${S}/debian/optee-client-dev.install
-    echo "usr/lib/*/lib*.so" >> ${S}/debian/optee-client-dev.install
+do_warn_custom_inc() {
+    bbwarn "Please migrate from \"require recipes-bsp/optee-client/optee-client-custom.inc\" to \"inherit optee-client\""
 }
+addtask warn_custom_inc before do_unpack