public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/2] optee-ftpm: Migrate to a bbclass
@ 2025-12-12 19:59 'Jan Kiszka' via isar-users
  2025-12-12 20:00 ` [PATCH 2/2] optee-ftpm-stm32mp15x: Switch to optee-ftpm class 'Jan Kiszka' via isar-users
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-12-12 19:59 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

"inherit optee-ftpm" 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-ftpm.bbclass}                       |  3 +-
 meta/recipes-bsp/optee-ftpm/optee-ftpm.inc    | 65 ++-----------------
 2 files changed, 9 insertions(+), 59 deletions(-)
 copy meta/{recipes-bsp/optee-ftpm/optee-ftpm.inc => classes-recipe/optee-ftpm.bbclass} (96%)

diff --git a/meta/recipes-bsp/optee-ftpm/optee-ftpm.inc b/meta/classes-recipe/optee-ftpm.bbclass
similarity index 96%
copy from meta/recipes-bsp/optee-ftpm/optee-ftpm.inc
copy to meta/classes-recipe/optee-ftpm.bbclass
index 2c854efc..ba017c5a 100644
--- a/meta/recipes-bsp/optee-ftpm/optee-ftpm.inc
+++ b/meta/classes-recipe/optee-ftpm.bbclass
@@ -6,13 +6,14 @@
 #
 # SPDX-License-Identifier: MIT
 #
+
 inherit dpkg
 
 SUMMARY = "OP-TEE fTPM TA"
 DESCRIPTION = "Firmware TPM as OP-TEE TCG TA, using Microsoft's TPM 2.0 reference implementation"
 HOMEPAGE = "https://github.com/OP-TEE/optee_ftpm"
 
-FILESPATH:append := ":${FILE_DIRNAME}/files"
+FILESPATH:append = ":${LAYERDIR_core}/recipes-bsp/optee-ftpm/files"
 
 SRC_URI += "file://debian"
 
diff --git a/meta/recipes-bsp/optee-ftpm/optee-ftpm.inc b/meta/recipes-bsp/optee-ftpm/optee-ftpm.inc
index 2c854efc..992c9122 100644
--- a/meta/recipes-bsp/optee-ftpm/optee-ftpm.inc
+++ b/meta/recipes-bsp/optee-ftpm/optee-ftpm.inc
@@ -1,64 +1,13 @@
-# Copyright (c) Siemens AG, 2023-2025
+# Transitional include for optee-ftpm.bbclass
 #
-# Authors:
-#  Su Bao Cheng <baocheng.su@siemens.com>
-#  Jan Kiszka <jan.kiszka@siemens.com>
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2025
 #
 # SPDX-License-Identifier: MIT
-#
-inherit dpkg
-
-SUMMARY = "OP-TEE fTPM TA"
-DESCRIPTION = "Firmware TPM as OP-TEE TCG TA, using Microsoft's TPM 2.0 reference implementation"
-HOMEPAGE = "https://github.com/OP-TEE/optee_ftpm"
-
-FILESPATH:append := ":${FILE_DIRNAME}/files"
-
-SRC_URI += "file://debian"
-
-OPTEE_NAME ?= "${MACHINE}"
-
-DEPENDS = "optee-os-tadevkit-${OPTEE_NAME}"
-DEBIAN_BUILD_DEPENDS ?= " \
-    python3-cryptography:native,                                        \
-    optee-os-tadevkit-${OPTEE_NAME}                                     \
-    "
-
-TA_CPU ?= "unknown"
-TA_DEV_KIT_DIR ?= "unknown"
-OPTEE_FTPM_BUILD_ARGS_EXTRA ?= " "
-
-# Set to the subdir in WORKDIR containing the unpacked ms-tpm-20-ref sources
-# Leave empty for if still using ms-tpm-20-ref for OP-TEE TA integration
-MS_TPM_20_REF_DIR ?= ""
-
-OPTEE_FTPM_SRCDIR = "${@'Samples/ARM32-FirmwareTPM/optee_ta' if d.getVar('MS_TPM_20_REF_DIR') == '' else '.'}"
-OPTEE_FTPM_BINDIR = "${@'Samples/ARM32-FirmwareTPM/optee_ta/fTPM' if d.getVar('MS_TPM_20_REF_DIR') == '' else '.'}"
-
-TEMPLATE_FILES = "debian/rules.tmpl debian/control.tmpl"
-TEMPLATE_VARS += "DEBIAN_BUILD_DEPENDS \
-    DEBIAN_COMPAT \
-    OPTEE_FTPM_BUILD_ARGS_EXTRA \
-    TA_CPU \
-    TA_DEV_KIT_DIR \
-    MS_TPM_20_REF_DIR \
-    OPTEE_FTPM_SRCDIR \
-    DEBIAN_STANDARDS_VERSION"
-
-do_prepare_build() {
-    rm -rf "${S}/debian"
-    cp -r "${WORKDIR}/debian" "${S}/"
-
-    deb_add_changelog
 
-    rm -f ${S}/debian/optee-ftpm-${OPTEE_NAME}.install
-    echo "${OPTEE_FTPM_BINDIR}/out/bc50d971-d4c9-42c4-82cb-343fb7f37896.ta /usr/lib/optee-os/${OPTEE_NAME}/ta" > \
-        ${S}/debian/optee-ftpm-${OPTEE_NAME}.install
-    echo "${OPTEE_FTPM_BINDIR}/out/bc50d971-d4c9-42c4-82cb-343fb7f37896.stripped.elf /usr/lib/optee-os/${OPTEE_NAME}/ta" >> \
-        ${S}/debian/optee-ftpm-${OPTEE_NAME}.install
+inherit optee-ftpm
 
-    if [ -n "${MS_TPM_20_REF_DIR}" ] && [ -e "${WORKDIR}/${MS_TPM_20_REF_DIR}" ]; then
-        rm -rf "${S}/${MS_TPM_20_REF_DIR}"
-        cp -a "${WORKDIR}/${MS_TPM_20_REF_DIR}" "${S}/"
-    fi
+do_warn_custom_inc() {
+    bbwarn "Please migrate from \"require recipes-bsp/optee-ftpm/optee-ftpm.inc\" to \"inherit optee-ftpm\""
 }
+addtask warn_custom_inc before do_unpack
-- 
2.51.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/168e42a3-0671-493d-a41f-b8975d519105%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] optee-ftpm-stm32mp15x: Switch to optee-ftpm class
  2025-12-12 19:59 [PATCH 1/2] optee-ftpm: Migrate to a bbclass 'Jan Kiszka' via isar-users
@ 2025-12-12 20:00 ` 'Jan Kiszka' via isar-users
  2025-12-12 20:03 ` [PATCH 3/2] RECIPE-API-CHANGELOG: Add optee-ftpm conversion 'Jan Kiszka' via isar-users
  2025-12-17  7:05 ` [PATCH 1/2] optee-ftpm: Migrate to a bbclass Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-12-12 20:00 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../optee-ftpm/optee-ftpm-stm32mp15x_0~230316+git.bb            | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-isar/recipes-bsp/optee-ftpm/optee-ftpm-stm32mp15x_0~230316+git.bb b/meta-isar/recipes-bsp/optee-ftpm/optee-ftpm-stm32mp15x_0~230316+git.bb
index 53e2827c..215273c5 100644
--- a/meta-isar/recipes-bsp/optee-ftpm/optee-ftpm-stm32mp15x_0~230316+git.bb
+++ b/meta-isar/recipes-bsp/optee-ftpm/optee-ftpm-stm32mp15x_0~230316+git.bb
@@ -6,7 +6,7 @@
 # SPDX-License-Identifier: MIT
 #
 
-require recipes-bsp/optee-ftpm/optee-ftpm.inc
+inherit optee-ftpm
 
 SRC_URI += " \
     https://github.com/Microsoft/ms-tpm-20-ref/archive/${SRCREV}.tar.gz \
-- 
2.51.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/a9214f0b-94d7-4a3c-ae1a-7357fce00e4a%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/2] RECIPE-API-CHANGELOG: Add optee-ftpm conversion
  2025-12-12 19:59 [PATCH 1/2] optee-ftpm: Migrate to a bbclass 'Jan Kiszka' via isar-users
  2025-12-12 20:00 ` [PATCH 2/2] optee-ftpm-stm32mp15x: Switch to optee-ftpm class 'Jan Kiszka' via isar-users
@ 2025-12-12 20:03 ` 'Jan Kiszka' via isar-users
  2025-12-17  7:05 ` [PATCH 1/2] optee-ftpm: Migrate to a bbclass Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2025-12-12 20:03 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Could also go into https://patchwork.isar-build.org/project/isar/patch/168e42a3-0671-493d-a41f-b8975d519105@siemens.com/

 RECIPE-API-CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index caeeb6e3..16fc0fe9 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -905,6 +905,7 @@ been migrated to classes. The following transitions were applied:
  - `recipes-bsp/optee-os/optee-os-custom.inc` -> `optee-os.bbclass`
  - `recipes-bsp/optee-os/optee-os-tadevkit-custom.inc` -> `optee-os-tadevkit.bbclass`
  - `recipes-bsp/optee-client/optee-client-custom.inc` -> `optee-client.bbclass`
+ - `recipes-bsp/optee-ftpm/optee-ftpm.inc` -> `optee-ftpm.bbclass`
  - `recipes-bsp/trusted-firmware-a/trusted-firmware-a-custom.inc` -> `trusted-firmware-a.bbclass`
  - `recipes-bsp/barebox/barebox.inc` -> `barebox.bbclass`
  - `recipes-initramfs/initramfs-hook/hook.inc` -> `initramfs-hook.bbclass`
-- 
2.51.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/540bf759-0f5a-497a-9430-6bc51d8cbaae%40siemens.com.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] optee-ftpm: Migrate to a bbclass
  2025-12-12 19:59 [PATCH 1/2] optee-ftpm: Migrate to a bbclass 'Jan Kiszka' via isar-users
  2025-12-12 20:00 ` [PATCH 2/2] optee-ftpm-stm32mp15x: Switch to optee-ftpm class 'Jan Kiszka' via isar-users
  2025-12-12 20:03 ` [PATCH 3/2] RECIPE-API-CHANGELOG: Add optee-ftpm conversion 'Jan Kiszka' via isar-users
@ 2025-12-17  7:05 ` Anton Mikanovich
  2 siblings, 0 replies; 4+ messages in thread
From: Anton Mikanovich @ 2025-12-17  7:05 UTC (permalink / raw)
  To: isar-users, Kiszka, Jan

12/12/2025 21:59, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> "inherit optee-ftpm" 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>
Applied all 3 patches to next, thanks.

P.S. This [PATCH 3/2] naming was little bit confusing.

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/06fb897a-5d80-4a11-acba-ddd254d9bbf7%40ilbers.de.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-17  7:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-12 19:59 [PATCH 1/2] optee-ftpm: Migrate to a bbclass 'Jan Kiszka' via isar-users
2025-12-12 20:00 ` [PATCH 2/2] optee-ftpm-stm32mp15x: Switch to optee-ftpm class 'Jan Kiszka' via isar-users
2025-12-12 20:03 ` [PATCH 3/2] RECIPE-API-CHANGELOG: Add optee-ftpm conversion 'Jan Kiszka' via isar-users
2025-12-17  7:05 ` [PATCH 1/2] optee-ftpm: Migrate to a bbclass Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox