stm-st-stm32mp: fip-stm32mp: Integrate do_deploy:append into main do_deploy() function

This commit simplifies the recipe by integrating the symlink generation
directly into the main do_deploy() function, removing the need to maintain
both a do_deploy() and a do_deploy:append().

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-24 09:54:10 +01:00
parent f0c4cdc5bb
commit 250acb9041
1 changed files with 28 additions and 33 deletions

View File

@ -21,10 +21,13 @@ python set_fip_sign_key() {
if (p):
d.setVar('SIGN_KEY_PASS', p)
}
# Addons parameters for FIP_WRAPPER
FIP_SOC_SEARCH ?= " ${STM32MP_SOC_NAME} "
FIP_SOC_MATCH ?= " ${DIGI_SOM} "
FWDDR_SUFFIX ?= "bin"
# Deploy the fip binary for current target
do_deploy() {
install -d ${DEPLOYDIR}/${FIP_DIR_FIP}
@ -155,38 +158,30 @@ do_deploy() {
--output ${DEPLOYDIR}/${FIP_DIR_FIP}
done
done
# Create symlinks in DEPLOYDIR
# 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_ENCRYPT_SUFFIX}${FIP_SIGN_SUFFIX}.${FIP_SUFFIX}"
if [ -f "${DEPLOYDIR}/${FIP_BASEDIR}/${FIP_FILENAME}" ]; then
cd "${DEPLOYDIR}"
# symlink FIP
ln -sf "${FIP_BASEDIR}/${FIP_FILENAME}" "${DEPLOYDIR}/"
fi
FIP_DDR_FILENAME="${FIP_BASENAME}-${dt}-ddr-${config}${FIP_ENCRYPT_SUFFIX}${FIP_SIGN_SUFFIX}.${FWDDR_SUFFIX}"
if [ -f "${DEPLOYDIR}/${FIP_BASEDIR}/${FIP_DDR_FILENAME}" ]; then
cd "${DEPLOYDIR}"
# symlink DDR firmware (needed for USB recovery)
ln -sf "${FIP_BASEDIR}/${FIP_DDR_FILENAME}" "${DEPLOYDIR}/"
fi
done
done
}
addtask deploy before do_build after do_compile
FWDDR_SUFFIX ?= "bin"
# This runs after 'do_compile()' 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.
do_deploy:append() {
# Create symlinks in DEPLOYDIR
# 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_ENCRYPT_SUFFIX}${FIP_SIGN_SUFFIX}.${FIP_SUFFIX}"
if [ -f "${DEPLOYDIR}/${FIP_BASEDIR}/${FIP_FILENAME}" ]; then
cd "${DEPLOYDIR}"
# symlink FIP
ln -sf "${FIP_BASEDIR}/${FIP_FILENAME}" "${DEPLOYDIR}/"
fi
FIP_DDR_FILENAME="${FIP_BASENAME}-${dt}-ddr-${config}${FIP_ENCRYPT_SUFFIX}${FIP_SIGN_SUFFIX}.${FWDDR_SUFFIX}"
if [ -f "${DEPLOYDIR}/${FIP_BASEDIR}/${FIP_DDR_FILENAME}" ]; then
cd "${DEPLOYDIR}"
# symlink DDR firmware (needed for USB recovery)
ln -sf "${FIP_BASEDIR}/${FIP_DDR_FILENAME}" "${DEPLOYDIR}/"
fi
done
done
}