Yocto Project Discussions
 help / color / mirror / Atom feed
From: Peter Hoyes <peter.hoyes@arm.com>
To: yocto@lists.yoctoproject.org
Cc: diego.sueiro@arm.com, Peter Hoyes <Peter.Hoyes@arm.com>
Subject: [meta-zephyr][PATCH 2/2] zephyr-core/zephyr-kernel: Implement do_install
Date: Fri, 30 Sep 2022 17:34:37 +0100	[thread overview]
Message-ID: <20220930163437.875793-2-peter.hoyes@arm.com> (raw)
In-Reply-To: <20220930163437.875793-1-peter.hoyes@arm.com>

From: Peter Hoyes <Peter.Hoyes@arm.com>

Install the Zephyr binaries to ${D}/firmware prior to copying them to
${DEPLOYDIR}.

Implementing do_install has three advantages:
 * In use-cases when the Zephyr application is not the final artifact
   (e.g. when signing or using additional firmware), other recipes can
   pick up the Zephyr binary from the sysroot instead of
   DEPLOY_DIR_IMAGE.
 * It may sometimes make sense to install the binaries in a Linux
   filesystem (e.g. to be run by a hypervisor).
 * OE-core's QA checks run on the packaged binaries.

There are currently two QA checks that fail, so add these to INSANE_SKIP
for now.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
 .../zephyr-kernel/zephyr-image.inc            | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 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 fc8c077..d6ee21f 100644
--- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-image.inc
+++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/zephyr-image.inc
@@ -4,19 +4,26 @@ inherit deploy
 
 OECMAKE_SOURCEPATH = "${ZEPHYR_SRC_DIR}"
 
-do_install[noexec] = "1"
+do_install() {
+    install -d ${D}/firmware
 
-do_deploy() {
-    install -D ${B}/zephyr/${ZEPHYR_MAKE_OUTPUT} ${DEPLOYDIR}/${PN}.elf
+    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} ${DEPLOYDIR}/${PN}.bin
+      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} ${DEPLOYDIR}/${PN}.efi
+      install -D ${B}/zephyr/${ZEPHYR_MAKE_EFI_OUTPUT} ${D}/firmware/${PN}.efi
     fi
 }
-addtask deploy after do_compile
+FILES:${PN} = "/firmware"
+INSANE_SKIP += "ldflags buildpaths"
+SYSROOT_DIRS += "/firmware"
+
+do_deploy() {
+    cp ${D}/firmware/${PN}.* ${DEPLOYDIR}/
+}
+addtask deploy after do_install
-- 
2.25.1



  reply	other threads:[~2022-09-30 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 16:34 [meta-zephyr][PATCH 1/2] zephyr-core/zephyr-kernel: Refactor zephyr-image and zephyr-sample Peter Hoyes
2022-09-30 16:34 ` Peter Hoyes [this message]
2022-09-30 18:57 ` Jon Mason

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=20220930163437.875793-2-peter.hoyes@arm.com \
    --to=peter.hoyes@arm.com \
    --cc=diego.sueiro@arm.com \
    --cc=yocto@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox