Openembedded Core Discussions
 help / color / mirror / Atom feed
From: dbaryshkov@gmail.com
To: openembedded-core@lists.openembedded.org
Cc: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
Subject: [PATCH 7/9] uefi.bbclass: provide efi population functions for live images
Date: Wed, 11 Sep 2019 12:29:59 +0300	[thread overview]
Message-ID: <20190911093001.7849-7-dbaryshkov@gmail.com> (raw)
In-Reply-To: <20190911093001.7849-1-dbaryshkov@gmail.com>

From: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>

Define common functions for populating EFI directories in live image.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry_eremin-solenikov@mentor.com>
---
 meta/classes/uefi.bbclass | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/meta/classes/uefi.bbclass b/meta/classes/uefi.bbclass
index d3fc4b686676..062f0c3859b2 100644
--- a/meta/classes/uefi.bbclass
+++ b/meta/classes/uefi.bbclass
@@ -24,3 +24,31 @@ python __anonymous () {
         image = "bootUNKNOWN.efi"
     d.setVar("EFI_BOOT_IMAGE", image)
 }
+
+efi_populate_common() {
+        # DEST must be the root of the image so that EFIDIR is not
+        # nested under a top level directory.
+        DEST=$1
+
+        install -d ${DEST}${EFIDIR}
+
+        install -m 0644 ${DEPLOY_DIR_IMAGE}/$2-${EFI_BOOT_IMAGE} ${DEST}${EFIDIR}/${EFI_BOOT_IMAGE}
+        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+        printf 'fs0:%s\%s\n' "$EFIPATH" "${EFI_BOOT_IMAGE}" >${DEST}/startup.nsh
+}
+
+efi_iso_populate_common() {
+        iso_dir=$1
+        efi_populate $iso_dir
+        # Build a EFI directory to create efi.img
+        mkdir -p ${EFIIMGDIR}/${EFIDIR}
+        cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+        cp $iso_dir/${KERNEL_IMAGETYPE} ${EFIIMGDIR}
+
+        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
+        printf 'fs0:%s\%s\n' "$EFIPATH" "${EFI_BOOT_IMAGE}" >${EFIIMGDIR}/startup.nsh
+
+        if [ -f "$iso_dir/initrd" ] ; then
+                cp $iso_dir/initrd ${EFIIMGDIR}
+        fi
+}
-- 
2.23.0



  parent reply	other threads:[~2019-09-11  9:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11  9:29 [PATCH 1/9] uefi.bbclass: add bbclass holding configuration for UEFI applications dbaryshkov
2019-09-11  9:29 ` [PATCH 2/9] grub-bootconf: switch to uefi.bbclass dbaryshkov
2019-09-11  9:29 ` [PATCH 3/9] grub-efi: " dbaryshkov
2019-09-11  9:29 ` [PATCH 4/9] grub-efi.bbclass: " dbaryshkov
2019-09-11  9:29 ` [PATCH 5/9] systemd-boot: " dbaryshkov
2019-09-11  9:29 ` [PATCH 6/9] systemd-boot.bbclass: " dbaryshkov
2019-09-11  9:29 ` dbaryshkov [this message]
2019-09-11  9:30 ` [PATCH 8/9] grub-efi.bbclass: use efi_*_populate_common dbaryshkov
2019-09-11  9:30 ` [PATCH 9/9] systemd-boot.bbclass: " dbaryshkov
2019-09-12 23:12 ` [PATCH 1/9] uefi.bbclass: add bbclass holding configuration for UEFI applications Mittal, Anuj
2019-09-13 11:59   ` Dmitry Eremin-Solenikov
2019-09-13  2:14 ` Ang, Chin Huat
2019-09-13 12:06   ` Dmitry Eremin-Solenikov

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=20190911093001.7849-7-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=dmitry_eremin-solenikov@mentor.com \
    --cc=openembedded-core@lists.openembedded.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