diff options
| author | Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com> | 2024-02-08 12:53:00 -0700 |
|---|---|---|
| committer | Mark Hatle <mark.hatle@amd.com> | 2024-02-09 09:42:34 -0600 |
| commit | f619c044698448e225aaab503d6fc11d67a3b7b2 (patch) | |
| tree | 0aeed9fa5ae7c3bee89a1b733fcc8fac14ded0d8 | |
| parent | 9c546fff6df66a5fe6d682ddefe19e8944aa543d (diff) | |
| download | meta-xilinx-f619c044698448e225aaab503d6fc11d67a3b7b2.tar.gz | |
esw_apps_common.bbclass: Create new class for apps common code
Create new bbclass for apps common code. This bbclass is inherited by
esw application recipes. This class provides common code for elf name,
bitbake install and deploy task functionality for multiconfig target
images.
Also add target processor suffix so that it doesn't conflict with app
name under /lib/firmware direcory when you build same app
(ex: hello-world) targeting different processor.
Example:
hello-world-xlnx-zynqmp-zcu102-rev1-0-cortexr5-0-zynqmp-baremetal.elf
hello-world-xlnx-zynqmp-zcu102-rev1-0-cortexr5-1-zynqmp-baremetal.elf
hello-world-xlnx-zynqmp-zcu102-rev1-0-cortexa53-0-zynqmp-baremetal.elf
hello-world-xlnx-zynqmp-zcu102-rev1-0-cortexa53-1-zynqmp-baremetal.elf
hello-world-xlnx-zynqmp-zcu102-rev1-0-cortexa53-2-zynqmp-baremetal.elf
hello-world-xlnx-zynqmp-zcu102-rev1-0-cortexa53-3-zynqmp-baremetal.elf
Signed-off-by: Sandeep Gundlupet Raju <sandeep.gundlupet-raju@amd.com>
Signed-off-by: Mark Hatle <mark.hatle@amd.com>
| -rw-r--r-- | meta-xilinx-standalone-experimental/classes-recipe/esw_apps_common.bbclass | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/meta-xilinx-standalone-experimental/classes-recipe/esw_apps_common.bbclass b/meta-xilinx-standalone-experimental/classes-recipe/esw_apps_common.bbclass new file mode 100644 index 00000000..85b753a5 --- /dev/null +++ b/meta-xilinx-standalone-experimental/classes-recipe/esw_apps_common.bbclass | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | # | ||
| 2 | # Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved. | ||
| 3 | # | ||
| 4 | # SPDX-License-Identifier: MIT | ||
| 5 | # | ||
| 6 | # This bbclass is inherited by esw application recipes. This class provides | ||
| 7 | # common code for elf name, bitbake install and deploy task functionality for | ||
| 8 | # multiconfig target images. | ||
| 9 | |||
| 10 | inherit deploy image-artifact-names | ||
| 11 | |||
| 12 | APP_IMAGE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${BB_CURRENT_MC}${IMAGE_VERSION_SUFFIX}" | ||
| 13 | |||
| 14 | ESW_EXECUTABLE_NAME ?= "" | ||
| 15 | |||
| 16 | do_install() { | ||
| 17 | install -d ${D}/${base_libdir}/firmware | ||
| 18 | # Note that we have to make the ELF executable for it to be stripped | ||
| 19 | install -m 0755 ${B}/${ESW_EXECUTABLE_NAME}* ${D}/${base_libdir}/firmware | ||
| 20 | } | ||
| 21 | |||
| 22 | do_deploy() { | ||
| 23 | # We need to deploy the stripped elf, hence why not doing it from ${D} | ||
| 24 | install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/${ESW_EXECUTABLE_NAME}.elf ${DEPLOYDIR}/${APP_IMAGE_NAME}.elf | ||
| 25 | ln -sf ${APP_IMAGE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}-${BB_CURRENT_MC}.elf | ||
| 26 | ${OBJCOPY} -O binary ${WORKDIR}/package/${base_libdir}/firmware/${ESW_EXECUTABLE_NAME}.elf ${WORKDIR}/package/${base_libdir}/firmware/${ESW_EXECUTABLE_NAME}.bin | ||
| 27 | install -m 0644 ${WORKDIR}/package/${base_libdir}/firmware/${ESW_EXECUTABLE_NAME}.bin ${DEPLOYDIR}/${APP_IMAGE_NAME}.bin | ||
| 28 | ln -sf ${APP_IMAGE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}-${BB_CURRENT_MC}.bin | ||
| 29 | } | ||
| 30 | |||
| 31 | addtask deploy before do_build after do_package | ||
