Skip to content

Commit

Permalink
zephyr-kernel: support to deploy users customize image
Browse files Browse the repository at this point in the history
In the previous design, it only deployed zephyr.elf,
zephyr.bin and zephyr.efi.
If users want to deploy their customize images, they should update do_install task.
Add to check "ZEPHYR_MAKE_OUTPUT" to deploy users customize images and zephyr images.

Signed-off-by: Jamin Lin <[email protected]>
Signed-off-by: Naveen Saini <[email protected]>
  • Loading branch information
jamin-aspeed authored and saininav committed Sep 12, 2024
1 parent aa00f54 commit 0f06f56
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
19 changes: 7 additions & 12 deletions meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-image.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,18 @@ OECMAKE_SOURCEPATH = "${ZEPHYR_SRC_DIR}"
do_install() {
install -d ${D}/firmware

install -D ${B}/zephyr/${ZEPHYR_MAKE_OUTPUT} ${D}/firmware/${PN}.elf

if [ -f ${B}/zephyr/${ZEPHYR_MAKE_BIN_OUTPUT} ]
then
install -D ${B}/zephyr/${ZEPHYR_MAKE_BIN_OUTPUT} ${D}/firmware/${PN}.bin
fi

if [ -f ${B}/zephyr/${ZEPHYR_MAKE_EFI_OUTPUT} ]
then
install -D ${B}/zephyr/${ZEPHYR_MAKE_EFI_OUTPUT} ${D}/firmware/${PN}.efi
fi
for output in ${ZEPHYR_MAKE_OUTPUT}; do
if [ -f ${B}/zephyr/${output} ];
then
install -D ${B}/zephyr/${output} ${D}/firmware/
fi
done
}
FILES:${PN} = "/firmware"
INSANE_SKIP += "ldflags buildpaths"
SYSROOT_DIRS += "/firmware"

do_deploy() {
cp ${D}/firmware/${PN}.* ${DEPLOYDIR}/
cp ${D}/firmware/* ${DEPLOYDIR}/
}
addtask deploy after do_install
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ IMAGE_NO_MANIFEST = "1"
ZEPHYR_TOOLCHAIN_VARIANT ?= "cross-compile"
require zephyr-toolchain-${ZEPHYR_TOOLCHAIN_VARIANT}.inc

ZEPHYR_MAKE_OUTPUT = "zephyr.elf"
ZEPHYR_MAKE_BIN_OUTPUT = "zephyr.bin"
ZEPHYR_MAKE_EFI_OUTPUT = "zephyr.efi"
ZEPHYR_MAKE_OUTPUT ?= "\
zephyr.elf \
zephyr.bin \
zephyr.efi \
"

EXTRA_OECMAKE = "\
-DZEPHYR_BASE=${ZEPHYR_BASE} \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
include zephyr-sample.inc


ZEPHYR_MAKE_OUTPUT = "zephyr_openamp_rsc_table.elf"
ZEPHYR_MAKE_BIN_OUTPUT = "zephyr_openamp_rsc_table.bin"
ZEPHYR_MAKE_EFI_OUTPUT = "zephyr_openamp_rsc_table.efi"
ZEPHYR_MAKE_OUTPUT ?= " \
zephyr_openamp_rsc_table.elf \
zephyr_openamp_rsc_table.bin \
zephyr_openamp_rsc_table.efi \
"

ZEPHYR_SRC_DIR = "${ZEPHYR_BASE}/samples/subsys/ipc/openamp_rsc_table"

Expand Down

0 comments on commit 0f06f56

Please sign in to comment.