[OE-core] [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER

Belal, Awais Awais_Belal at mentor.com
Mon Jan 30 13:25:41 UTC 2017


ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces at lists.openembedded.org <openembedded-core-bounces at lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 10, 2017 5:19 PM
To: openembedded-core at lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 2/2] grub-efi/live-vm-common:  allow   grub    as      EFI_PROVIDER

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces at lists.openembedded.org <openembedded-core-bounces at lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 3, 2017 5:34 PM
To: openembedded-core at lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 2/2] grub-efi/live-vm-common: allow    grub    as      EFI_PROVIDER

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces at lists.openembedded.org <openembedded-core-bounces at lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core at lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 2/2] grub-efi/live-vm-common: allow grub       as      EFI_PROVIDER

Ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces at lists.openembedded.org <openembedded-core-bounces at lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core at lists.openembedded.org
Subject: [OE-core] [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as        EFI_PROVIDER

This allows grub to be used as EFI_PROVIDER and
extends the grub-efi class so it can be used as is
when EFI_PROVIDER is grub.
Currently this can only be leveraged if you are
using the grub_git recipe and GRUBPLATFORM plus
EFI_PROVIDER are set correctly.

Signed-off-by: Awais Belal <awais_belal at mentor.com>
---
 meta/classes/grub-efi.bbclass       | 23 +++++++++++++++++------
 meta/classes/live-vm-common.bbclass |  2 +-
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
index 17417ba..c847645 100644
--- a/meta/classes/grub-efi.bbclass
+++ b/meta/classes/grub-efi.bbclass
@@ -16,8 +16,8 @@
 # ${GRUB_TIMEOUT} - timeout before executing the deault label (optional)
 # ${GRUB_ROOT} - grub's root device.

-do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy"
-do_bootdirectdisk[depends] += "${MLPREFIX}grub-efi:do_deploy"
+do_bootimg[depends] += "${MLPREFIX}${EFI_PROVIDER}:do_deploy"
+do_bootdirectdisk[depends] += "${MLPREFIX}${EFI_PROVIDER}:do_deploy"

 GRUB_SERIAL ?= "console=ttyS0,115200"
 GRUB_CFG_VM = "${S}/grub_vm.cfg"
@@ -40,10 +40,21 @@ efi_populate() {

        install -d ${DEST}${EFIDIR}

-       GRUB_IMAGE="bootia32.efi"
-       if [ "${TARGET_ARCH}" = "x86_64" ]; then
-               GRUB_IMAGE="bootx64.efi"
-       fi
+    if [ "${EFI_PROVIDER}" = "grub" ]; then
+           GRUB_IMAGE="bootia32.${GRUBPLATFORM}"
+           if [ "${TARGET_ARCH}" = "x86_64" ]; then
+                   GRUB_IMAGE="bootx64.${GRUBPLATFORM}"
+           elif [ "${TARGET_ARCH}" = "arm" ]; then
+            grubimage = "bootarm.${GRUBPLATFORM}"
+           elif [ "${TARGET_ARCH}" = "aarch64" ]; then
+            grubimage = "bootaa64.${GRUBPLATFORM}"
+        fi
+    else
+        GRUB_IMAGE="bootia32.efi"
+           if [ "${TARGET_ARCH}" = "x86_64" ]; then
+                   GRUB_IMAGE="bootx64.efi"
+        fi
+    fi
        install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}
        EFIPATH=$(echo "${EFIDIR}" | sed 's/\//\\/g')
        printf 'fs0:%s\%s\n' "$EFIPATH" "$GRUB_IMAGE" >${DEST}/startup.nsh
diff --git a/meta/classes/live-vm-common.bbclass b/meta/classes/live-vm-common.bbclass
index 734697f..0af228b 100644
--- a/meta/classes/live-vm-common.bbclass
+++ b/meta/classes/live-vm-common.bbclass
@@ -13,7 +13,7 @@ def set_live_vm_vars(d, suffix):

 EFI = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
 EFI_PROVIDER ?= "grub-efi"
-EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
+EFI_CLASS = "${@bb.utils.contains("EFI_PROVIDER", "grub", "grub-efi", "${EFI_PROVIDER}", d)}"

 # Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not
 # contain "efi". This way legacy is supported by default if neither is
--
1.9.1

--
_______________________________________________
Openembedded-core mailing list
Openembedded-core at lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core at lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core at lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core at lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core



More information about the Openembedded-core mailing list