From 2cbfe2ae0d95e042896251dd55ecb2f2cbac9bc2 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jun 2025 17:38:26 +0200 Subject: [PATCH] tf-a-stm32mp: move TF-A symlink creation to do_deploy Moved deploy_symlinks_atf from SYSROOT_PREPROCESS_FUNCS to do_deploy task to ensure symlinks are created correctly even when rebuilding from the shared state after a "bitbake -c clean tf-a-stm32mp". Override do_deploy[sstate-outputdirs] from the original recipe to allow installing both the deploy artifacts (binaries and symlinks) to the package deploy directory. Signed-off-by: Javier Viguera --- .../tf-a-stm32mp_2.10.bbappend | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_2.10.bbappend b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_2.10.bbappend index 5e1423811..f73e29b3e 100644 --- a/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_2.10.bbappend +++ b/meta-digi-arm/dynamic-layers/stm-st-stm32mp/recipes-bsp/trusted-firmware-a/tf-a-stm32mp_2.10.bbappend @@ -310,8 +310,6 @@ do_compile() { fi } -# This runs after 'tf_a_sysroot_populate()' which populates all -# TF-A artifacts on the image deploy dir. # The purpose of this function is to create symlinks to the files needed # by the uuu installer that are located in subdirectories. deploy_symlinks_atf() { @@ -325,21 +323,24 @@ deploy_symlinks_atf() { tfa_basename=$(echo ${TF_A_BINARIES} | cut -d',' -f${i}) for dt in ${dt_config}; do TF_A_FILENAME="${tfa_basename}-${dt}-${config}${TF_A_ENCRYPT_SUFFIX}${TF_A_SIGN_SUFFIX}.${TF_A_SUFFIX}" - if [ -f "${DEPLOY_DIR_IMAGE}/${TF_A_BASEDIR}/${TF_A_FILENAME}" ]; then - cd "${DEPLOY_DIR_IMAGE}" + if [ -f "${DEPLOYDIR}/${TF_A_BASEDIR}/${TF_A_FILENAME}" ]; then # symlink TF-A - ln -sf "${TF_A_BASEDIR}/${TF_A_FILENAME}" "${DEPLOY_DIR_IMAGE}" + ln -sf "${TF_A_BASEDIR}/${TF_A_FILENAME}" "${DEPLOYDIR}" fi done done # Last value of 'dt' is good for metadata binary, so use that. if [ "${TF_A_ENABLE_METADATA}" = "1" ]; then - if [ -f "${DEPLOY_DIR_IMAGE}/${TF_A_BASEDIR}/${TF_A_METADATA_BINARY}" ]; then - cd "${DEPLOY_DIR_IMAGE}" + if [ -f "${DEPLOYDIR}/${TF_A_BASEDIR}/${TF_A_METADATA_BINARY}" ]; then # symlink metadata - ln -sf "${TF_A_BASEDIR}/${TF_A_METADATA_BINARY}" "${DEPLOY_DIR_IMAGE}/${TF_A_METADATA_NAME}-${MACHINE}.${TF_A_METADATA_SUFFIX}" + ln -sf "${TF_A_BASEDIR}/${TF_A_METADATA_BINARY}" "${DEPLOYDIR}/${TF_A_METADATA_NAME}-${MACHINE}.${TF_A_METADATA_SUFFIX}" fi fi } -SYSROOT_PREPROCESS_FUNCS += "deploy_symlinks_atf" + +do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}" +do_deploy() { + export_binaries ${DEPLOYDIR}${FIP_DIR_TFA_BASE} + deploy_symlinks_atf +}