1
0
mirror of https://git.yoctoproject.org/meta-arm synced 2026-05-31 00:39:57 +00:00

trusted-firmware-a: Deliver binaries artefacts to sysroot/firmware

Make usage of the do_install task to deliver binaries artefacts to
the `sysroot/firmware` path, making it easier for other recipes that
depends on it to make usage of those binaries instead of copying them
from the DEPLOY_DIR_IMAGE.

This recipe still deploys its artefacts to DEPLOY_DIR_IMAGE.

Change-Id: I97b97f90b23746557e981f8de10159c5f475becd
Issue-Id: SCM-888
Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
Reviewed-By: Bertrand Marquis <bertrand.marquis@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
Diego Sueiro
2020-04-21 08:33:52 +01:00
committed by Jon Mason
parent 5368b21fea
commit bd65efd542
2 changed files with 21 additions and 17 deletions
@@ -12,9 +12,9 @@ TFA_MBEDTLS = "1"
TFA_UBOOT = "1" TFA_UBOOT = "1"
TFA_BUILD_TARGET = "bl1 bl2 bl31 dtbs fiptool" TFA_BUILD_TARGET = "bl1 bl2 bl31 dtbs fiptool"
do_deploy[depends] += "virtual/kernel:do_deploy" do_install[depends] += "virtual/kernel:do_deploy"
do_deploy_append() { do_install_append() {
./tools/fiptool/fiptool create \ ./tools/fiptool/fiptool create \
--tb-fw ${S}/${TFA_BUILD_DIR}/bl2.bin \ --tb-fw ${S}/${TFA_BUILD_DIR}/bl2.bin \
--soc-fw ${S}/${TFA_BUILD_DIR}/bl31.bin \ --soc-fw ${S}/${TFA_BUILD_DIR}/bl31.bin \
@@ -26,6 +26,5 @@ do_deploy_append() {
./tools/fiptool/fiptool info fip.bin ./tools/fiptool/fiptool info fip.bin
install -m 0644 ${S}/fip.bin ${DEPLOYDIR}/fip-fvp.bin install -m 0644 ${S}/fip.bin ${D}/firmware/fip-fvp.bin
} }
@@ -5,7 +5,7 @@ PROVIDES = "virtual/trusted-firmware-a"
PACKAGE_ARCH = "${MACHINE_ARCH}" PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit deploy inherit deploy nopackages
COMPATIBLE_MACHINE ?= "invalid" COMPATIBLE_MACHINE ?= "invalid"
@@ -42,12 +42,12 @@ SRCREV_FORMAT_append = "${@bb.utils.contains('TFA_MBEDTLS', '1', '_mbedtls', '',
TFA_UBOOT ?= "0" TFA_UBOOT ?= "0"
# What to build # What to build
# By default we only build bl1, do_deploy will install # By default we only build bl1, do_deploy will copy
# everything listed in this variable (by default bl1.bin) # everything listed in this variable (by default bl1.bin)
TFA_BUILD_TARGET ?= "bl1" TFA_BUILD_TARGET ?= "bl1"
# What to install # What to install
# do_deploy will install everything listed in this # do_install and do_deploy will install everything listed in this
# variable. It is set by default to TFA_BUILD_TARGET # variable. It is set by default to TFA_BUILD_TARGET
TFA_INSTALL_TARGET ?= "${TFA_BUILD_TARGET}" TFA_INSTALL_TARGET ?= "${TFA_BUILD_TARGET}"
@@ -60,9 +60,8 @@ LDFLAGS[unexport] = "1"
AS[unexport] = "1" AS[unexport] = "1"
LD[unexport] = "1" LD[unexport] = "1"
# No configure or install # No configure
do_configure[noexec] = "1" do_configure[noexec] = "1"
do_install[noexec] = "1"
# We need dtc for dtbs compilation # We need dtc for dtbs compilation
# We need openssl for fiptool # We need openssl for fiptool
@@ -87,27 +86,27 @@ do_compile() {
oe_runmake ${TFA_BUILD_TARGET} oe_runmake ${TFA_BUILD_TARGET}
} }
do_deploy() { do_install() {
install -d -m 755 ${DEPLOYDIR} install -d -m 755 ${D}/firmware
for atfbin in ${TFA_INSTALL_TARGET}; do for atfbin in ${TFA_INSTALL_TARGET}; do
if [ "$atfbin" = "all" ]; then if [ "$atfbin" = "all" ]; then
# Target all is not handled by default # Target all is not handled by default
bberror "all as TFA_INSTALL_TARGET is not handled by do_deploy" bberror "all as TFA_INSTALL_TARGET is not handled by do_install"
bberror "Please specify valid targets in TFA_INSTALL_TARGET or" bberror "Please specify valid targets in TFA_INSTALL_TARGET or"
bberror "rewrite or turn off do_deploy" bberror "rewrite or turn off do_install"
exit 1 exit 1
elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.bin ]; then
echo "Install $atfbin.bin" echo "Install $atfbin.bin"
install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \ install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.bin \
${DEPLOYDIR}/$atfbin-${TFA_PLATFORM}.bin ${D}/firmware/$atfbin-${TFA_PLATFORM}.bin
elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin.elf ]; then
echo "Install $atfbin.elf" echo "Install $atfbin.elf"
install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \ install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin.elf \
${DEPLOYDIR}/$atfbin-${TFA_PLATFORM}.elf ${D}/firmware/$atfbin-${TFA_PLATFORM}.elf
elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then elif [ -f ${S}/${TFA_BUILD_DIR}/$atfbin ]; then
echo "Install $atfbin" echo "Install $atfbin"
install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \ install -m 0644 ${S}/${TFA_BUILD_DIR}/$atfbin \
${DEPLOYDIR}/$atfbin-${TFA_PLATFORM} ${D}/firmware/$atfbin-${TFA_PLATFORM}
elif [ "$atfbin" = "dtbs" ]; then elif [ "$atfbin" = "dtbs" ]; then
echo "dtbs install, skipped" echo "dtbs install, skipped"
elif [ -f ${S}/tools/$atfbin/$atfbin ]; then elif [ -f ${S}/tools/$atfbin/$atfbin ]; then
@@ -118,4 +117,10 @@ do_deploy() {
fi fi
done done
} }
addtask deploy before do_build after do_compile
SYSROOT_DIRS += "/firmware"
do_deploy() {
cp -rf ${D}/firmware/* ${DEPLOYDIR}/
}
addtask deploy after do_install