fip-stm32mp: move function to create symlinks from tf-a recipe

We had a SYSROOT_PREPROCESS_FUNCS on the tf-a-stm32mp recipe to
create symlinks to both TF-A and FIP binaries, but the FIP binaries
are now produced by fip-stm32mp recipe.
This had the effect that the files might not be ready.
Duplicate the function in the fip-stm32mp recipe and create the
symlinks for the FIP images there.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
This commit is contained in:
Hector Palacios 2025-02-12 18:45:58 +01:00
parent bb04e6be85
commit 7496beb1a4
2 changed files with 34 additions and 23 deletions

View File

@ -136,3 +136,35 @@ do_deploy() {
done done
} }
addtask deploy before do_build after do_compile addtask deploy before do_build after do_compile
FWDDR_SUFFIX ?= "bin"
# This runs after 'sysroot_populate()' which populates all
# FIP 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_fip() {
# Create symlinks in DEPLOY_DIR_IMAGE
# Remove trailing slash (/) from ST variables
FIP_BASEDIR="$(echo ${FIP_DIR_FIP} | cut -c2-)"
unset i
for config in ${FIP_CONFIG}; do
i="$(expr ${i} + 1)"
dt_config=$(echo ${FIP_DEVICETREE} | cut -d',' -f${i})
for dt in ${dt_config}; do
FIP_FILENAME="${FIP_BASENAME}-${dt}-${config}${FIP_SIGN_SUFFIX}.${FIP_SUFFIX}"
if [ -f "${DEPLOY_DIR_IMAGE}/${FIP_BASEDIR}/${FIP_FILENAME}" ]; then
cd "${DEPLOY_DIR_IMAGE}"
# symlink FIP
ln -sf "${FIP_BASEDIR}/${FIP_FILENAME}" "${DEPLOY_DIR_IMAGE}/"
fi
if [ -f "${DEPLOY_DIR_IMAGE}/${FIP_BASEDIR}/${FIP_BASENAME}-${dt}-ddr-${config}.${FWDDR_SUFFIX}" ]; then
cd "${DEPLOY_DIR_IMAGE}"
# symlink DDR firmware (needed for USB recovery)
ln -sf "${FIP_BASEDIR}/${FIP_BASENAME}-${dt}-ddr-${config}.${FWDDR_SUFFIX}" "${DEPLOY_DIR_IMAGE}/"
fi
done
done
}
SYSROOT_PREPROCESS_FUNCS += "deploy_symlinks_fip"

View File

@ -67,7 +67,7 @@ python set_fip_sign_key() {
# TF-A artifacts on the image deploy dir. # TF-A artifacts on the image deploy dir.
# The purpose of this function is to create symlinks to the files needed # The purpose of this function is to create symlinks to the files needed
# by the uuu installer that are located in subdirectories. # by the uuu installer that are located in subdirectories.
deploy_symlinks() { deploy_symlinks_atf() {
# Remove trailing slash (/) from ST variable # Remove trailing slash (/) from ST variable
TF_A_BASEDIR="$(echo ${FIP_DIR_TFA_BASE} | cut -c2-)" TF_A_BASEDIR="$(echo ${FIP_DIR_TFA_BASE} | cut -c2-)"
unset i unset i
@ -94,29 +94,8 @@ deploy_symlinks() {
ln -sf "${TF_A_BASEDIR}/${TF_A_METADATA_BINARY}" "${DEPLOY_DIR_IMAGE}/${TF_A_METADATA_NAME}-${dt}.${TF_A_METADATA_SUFFIX}" ln -sf "${TF_A_BASEDIR}/${TF_A_METADATA_BINARY}" "${DEPLOY_DIR_IMAGE}/${TF_A_METADATA_NAME}-${dt}.${TF_A_METADATA_SUFFIX}"
fi fi
fi fi
# Remove trailing slash (/) from ST variables
FIP_BASEDIR="$(echo ${FIP_DIR_FIP} | cut -c2-)"
unset i
for config in ${FIP_CONFIG}; do
i="$(expr ${i} + 1)"
dt_config="$(echo ${FIP_DEVICETREE} | cut -d',' -f${i})"
for dt in ${dt_config}; do
FIP_FILENAME="${FIP_BASENAME}-${dt}-${config}${FIP_SIGN_SUFFIX}.${FIP_SUFFIX}"
if [ -f "${DEPLOY_DIR_IMAGE}/${FIP_BASEDIR}/${FIP_FILENAME}" ]; then
cd "${DEPLOY_DIR_IMAGE}"
# symlink FIP
ln -sf "${FIP_BASEDIR}/${FIP_FILENAME}" "${DEPLOY_DIR_IMAGE}/"
fi
if [ -f "${DEPLOY_DIR_IMAGE}/${FIP_BASEDIR}/${FIP_BASENAME}-${dt}-ddr-${config}.${FWDDR_SUFFIX}" ]; then
cd "${DEPLOY_DIR_IMAGE}"
# symlink DDR firmware (needed for USB recovery)
ln -sf "${FIP_BASEDIR}/${FIP_BASENAME}-${dt}-ddr-${config}.${FWDDR_SUFFIX}" "${DEPLOY_DIR_IMAGE}/"
fi
done
done
} }
SYSROOT_PREPROCESS_FUNCS += "deploy_symlinks" SYSROOT_PREPROCESS_FUNCS += "deploy_symlinks_atf"
# Sign TF-A image # Sign TF-A image
do_deploy[postfuncs] += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'tfa_sign', '', d)}" do_deploy[postfuncs] += "${@oe.utils.conditional('TRUSTFENCE_SIGN', '1', 'tfa_sign', '', d)}"