summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-standalone-sdt/classes-recipe/esw_apps_common.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-standalone-sdt/classes-recipe/esw_apps_common.bbclass')
-rw-r--r--meta-xilinx-standalone-sdt/classes-recipe/esw_apps_common.bbclass31
1 files changed, 31 insertions, 0 deletions
diff --git a/meta-xilinx-standalone-sdt/classes-recipe/esw_apps_common.bbclass b/meta-xilinx-standalone-sdt/classes-recipe/esw_apps_common.bbclass
new file mode 100644
index 00000000..85b753a5
--- /dev/null
+++ b/meta-xilinx-standalone-sdt/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
10inherit deploy image-artifact-names
11
12APP_IMAGE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${BB_CURRENT_MC}${IMAGE_VERSION_SUFFIX}"
13
14ESW_EXECUTABLE_NAME ?= ""
15
16do_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
22do_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
31addtask deploy before do_build after do_package