diff mbox series

[2/2] arm/trusted-firmware-m: Fix local source patches application

Message ID 20221121142346.1502347-2-peter.hoyes@arm.com
State New
Headers show
Series [1/2] arm/classes: Introduce apply_local_src_patches bbclass | expand

Commit Message

Peter Hoyes Nov. 21, 2022, 2:23 p.m. UTC
From: Diego Sueiro <diego.sueiro@arm.com>

As TF-M ships patches that it needs applied to mbedcrypto, we apply them as
part of do_patch by using a postfunc. There is an issue when do_patch is
executed after do_deploy_source_date_epoch_setscene and apply_local_patches
tries to apply the patches already applied.

To fix this, make usage of the apply_local_src_patches bbclass.

Change-Id: Ia115b540b37ad3a2cce30e1e0461abd1f5a6ccc1
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
 .../trusted-firmware-m/trusted-firmware-m_1.6.0.bb         | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.6.0.bb b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.6.0.bb
index c10efd5a..f0c8d579 100644
--- a/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.6.0.bb
+++ b/meta-arm/recipes-bsp/trusted-firmware-m/trusted-firmware-m_1.6.0.bb
@@ -108,10 +108,9 @@  export OPENSSL_MODULES="${STAGING_LIBDIR_NATIVE}/ossl-modules"
 
 # TF-M ships patches that it needs applied to mbedcrypto, so apply them
 # as part of do_patch.
-apply_local_patches() {
-    cat ${S}/lib/ext/mbedcrypto/*.patch | patch -p1 -d ${S}/../mbedtls
-}
-do_patch[postfuncs] += "apply_local_patches"
+LOCAL_SRC_PATCHES_INPUT_DIR = "${S}/lib/ext/mbedcrypto"
+LOCAL_SRC_PATCHES_DEST_DIR = "${S}/../mbedtls"
+inherit apply_local_src_patches
 
 do_configure[cleandirs] = "${B}"
 do_configure() {