stm-st-stm32mp: fip-stm32mp: fix symlinks in DEPLOYDIR

This commit addresses two issues in the symlink deployment function:

- do_deploy() should not write directly to DEPLOY_DIR_IMAGE. Instead,
  it now uses DEPLOYDIR.
- Expands do_deploy() instead of using SYSROOT_PREPROCESS_FUNCS to ensure that
  the original FIP artifacts are created and properly regenerated on each build.

https://onedigi.atlassian.net/browse/DEL-9442

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2025-03-21 13:32:24 +01:00
parent f8c0274076
commit f0c4cdc5bb
1 changed files with 9 additions and 10 deletions

View File

@ -160,12 +160,12 @@ addtask deploy before do_build after do_compile
FWDDR_SUFFIX ?= "bin" FWDDR_SUFFIX ?= "bin"
# This runs after 'sysroot_populate()' which populates all # This runs after 'do_compile()' which populates all
# FIP artifacts on the image deploy dir. # FIP 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_fip() { do_deploy:append() {
# Create symlinks in DEPLOY_DIR_IMAGE # Create symlinks in DEPLOYDIR
# Remove trailing slash (/) from ST variables # Remove trailing slash (/) from ST variables
FIP_BASEDIR="$(echo ${FIP_DIR_FIP} | cut -c2-)" FIP_BASEDIR="$(echo ${FIP_DIR_FIP} | cut -c2-)"
@ -175,19 +175,18 @@ deploy_symlinks_fip() {
dt_config=$(echo ${FIP_DEVICETREE} | cut -d',' -f${i}) dt_config=$(echo ${FIP_DEVICETREE} | cut -d',' -f${i})
for dt in ${dt_config}; do for dt in ${dt_config}; do
FIP_FILENAME="${FIP_BASENAME}-${dt}-${config}${FIP_ENCRYPT_SUFFIX}${FIP_SIGN_SUFFIX}.${FIP_SUFFIX}" FIP_FILENAME="${FIP_BASENAME}-${dt}-${config}${FIP_ENCRYPT_SUFFIX}${FIP_SIGN_SUFFIX}.${FIP_SUFFIX}"
if [ -f "${DEPLOY_DIR_IMAGE}/${FIP_BASEDIR}/${FIP_FILENAME}" ]; then if [ -f "${DEPLOYDIR}/${FIP_BASEDIR}/${FIP_FILENAME}" ]; then
cd "${DEPLOY_DIR_IMAGE}" cd "${DEPLOYDIR}"
# symlink FIP # symlink FIP
ln -sf "${FIP_BASEDIR}/${FIP_FILENAME}" "${DEPLOY_DIR_IMAGE}/" ln -sf "${FIP_BASEDIR}/${FIP_FILENAME}" "${DEPLOYDIR}/"
fi fi
FIP_DDR_FILENAME="${FIP_BASENAME}-${dt}-ddr-${config}${FIP_ENCRYPT_SUFFIX}${FIP_SIGN_SUFFIX}.${FWDDR_SUFFIX}" FIP_DDR_FILENAME="${FIP_BASENAME}-${dt}-ddr-${config}${FIP_ENCRYPT_SUFFIX}${FIP_SIGN_SUFFIX}.${FWDDR_SUFFIX}"
if [ -f "${DEPLOY_DIR_IMAGE}/${FIP_BASEDIR}/${FIP_DDR_FILENAME}" ]; then if [ -f "${DEPLOYDIR}/${FIP_BASEDIR}/${FIP_DDR_FILENAME}" ]; then
cd "${DEPLOY_DIR_IMAGE}" cd "${DEPLOYDIR}"
# symlink DDR firmware (needed for USB recovery) # symlink DDR firmware (needed for USB recovery)
ln -sf "${FIP_BASEDIR}/${FIP_DDR_FILENAME}" "${DEPLOY_DIR_IMAGE}/" ln -sf "${FIP_BASEDIR}/${FIP_DDR_FILENAME}" "${DEPLOYDIR}/"
fi fi
done done
done done
} }
SYSROOT_PREPROCESS_FUNCS += "deploy_symlinks_fip"