All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamin Lin <jamin_lin@aspeedtech.com>
To: <yocto-patches@lists.yoctoproject.org>
Cc: <troy_lee@aspeedtech.com>, <jamin_lin@aspeedtech.com>,
	<jaminlin1207@gmail.com>, <vince_chang@aspeedtech.com>
Subject: [meta-zephyr][PATCH v2 2/2] zephyr-kernel: support to deploy users customize image
Date: Mon, 2 Sep 2024 14:47:33 +0800	[thread overview]
Message-ID: <20240902064733.651635-2-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20240902064733.651635-1-jamin_lin@aspeedtech.com>

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 <jamin_lin@aspeedtech.com>
---
 .../zephyr-kernel/zephyr-image.inc            | 21 +++++++------------
 .../zephyr-kernel/zephyr-kernel-common.inc    |  8 ++++---
 .../zephyr-kernel/zephyr-openamp-rsc-table.bb |  8 ++++---
 3 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-image.inc b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-image.inc
index d6ee21f..c747095 100644
--- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-image.inc
+++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-image.inc
@@ -6,24 +6,19 @@ 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
diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
index ba70a29..8a1638d 100644
--- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
+++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-kernel-common.inc
@@ -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} \
diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openamp-rsc-table.bb b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openamp-rsc-table.bb
index 5e51c23..8a95b14 100644
--- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openamp-rsc-table.bb
+++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-openamp-rsc-table.bb
@@ -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"
 
-- 
2.25.1



  reply	other threads:[~2024-09-02  6:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-02  6:47 [meta-zephyr][PATCH v2 1/2] zephyr-kernel: Add source version to support v3.7.0 Jamin Lin
2024-09-02  6:47 ` Jamin Lin [this message]
2024-09-12 14:59   ` [yocto-patches] [meta-zephyr][PATCH v2 2/2] zephyr-kernel: support to deploy users customize image Saini, Naveen Kumar
2024-09-13  2:06     ` Jamin Lin
2024-09-12 14:56 ` [yocto-patches] [meta-zephyr][PATCH v2 1/2] zephyr-kernel: Add source version to support v3.7.0 Saini, Naveen Kumar
2024-09-13  2:05   ` Jamin Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240902064733.651635-2-jamin_lin@aspeedtech.com \
    --to=jamin_lin@aspeedtech.com \
    --cc=jaminlin1207@gmail.com \
    --cc=troy_lee@aspeedtech.com \
    --cc=vince_chang@aspeedtech.com \
    --cc=yocto-patches@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.