diff mbox series

[1/3] arm/images: ensured consistent firmware deployment

Message ID 20260114092452.286544-2-frazer.carsley@arm.com
State New
Headers show
Series Firmware binary path fixes | expand

Commit Message

Frazer Carsley Jan. 14, 2026, 9:24 a.m. UTC
From: Frazer Carsley <frazer.carsley@arm.com>

For builds using multiconfig, all of the firmware binaries listed were
being placed in the ${DEPLOYDIR} directly without preserving their
directory hierarchy. This meant that paths to firmware binaries relative
to the ${DEPLOYDIR} differed between builds depending on whether
multiconfig was enabled or not.

Signed-off-by: Frazer Carsley <frazer.carsley@arm.com>
---
 meta-arm/recipes-bsp/images/firmware-deploy-image.bb | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta-arm/recipes-bsp/images/firmware-deploy-image.bb b/meta-arm/recipes-bsp/images/firmware-deploy-image.bb
index 2f347f0b..85bdc952 100644
--- a/meta-arm/recipes-bsp/images/firmware-deploy-image.bb
+++ b/meta-arm/recipes-bsp/images/firmware-deploy-image.bb
@@ -18,11 +18,14 @@  do_deploy() {
     firmware_loc=$(echo "${TMPDIR}" | sed "s/${TCLIBC}/musl/")
     firmware_loc="${firmware_loc}_${MACHINE}/deploy/images/${MACHINE}"
     for firmware in ${FIRMWARE_BINARIES}; do
-        echo "cp -av ${firmware_loc}/${firmware} ${DEPLOYDIR}/"
-        cp -av "${firmware_loc}/${firmware}" ${DEPLOYDIR}/
+        # Preserve the directory structure when copying
+        subdir="$(dirname -- "${firmware}")"
+        mkdir -p "${DEPLOYDIR}"/"${subdir}"
+        echo "cp -av ${firmware_loc}/${firmware} ${DEPLOYDIR}/${subdir}"
+        cp -av "${firmware_loc}/${firmware}" ${DEPLOYDIR}/"${subdir}"
         if [ -L "${firmware_loc}/${firmware}" ]; then
-            echo "cp -av ${firmware_loc}/$(readlink ${firmware_loc}/${firmware}) ${DEPLOYDIR}/"
-            cp -av "${firmware_loc}/$(readlink ${firmware_loc}/${firmware})" ${DEPLOYDIR}/
+            echo "cp -av ${firmware_loc}/$(readlink ${firmware_loc}/${firmware}) ${DEPLOYDIR}/${subdir}"
+            cp -av "${firmware_loc}/$(readlink ${firmware_loc}/${firmware})" ${DEPLOYDIR}/${subdir}
         fi
     done
 }