All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] grub_git: extend recipe for proper target deployment
@ 2016-12-16 12:19 Awais Belal
  2016-12-16 12:19 ` [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER Awais Belal
  2016-12-27 12:15 ` [PATCH v2 1/2] grub_git: extend recipe for proper target deployment Belal, Awais
  0 siblings, 2 replies; 13+ messages in thread
From: Awais Belal @ 2016-12-16 12:19 UTC (permalink / raw)
  To: openembedded-core

This extends the grub_git recipe so it can deploy grub
on the target boot disk just like grub-efi. Mainly
this copies stuff from the grub-efi recipe and then
adjusts some bits accordingly. This would allow
using the latest and greatest versions of grub
on the target.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 meta/recipes-bsp/grub/grub_git.bb | 60 +++++++++++++++++++++++++++++++++++----
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
index eb824cc..13c48c7 100644
--- a/meta/recipes-bsp/grub/grub_git.bb
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -3,11 +3,15 @@ require grub2.inc
 DEFAULT_PREFERENCE = "-1"
 DEFAULT_PREFERENCE_arm = "1"
 
+DEPENDS += "grub-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
+
 FILESEXTRAPATHS =. "${FILE_DIRNAME}/grub-git:"
 
 PV = "2.00+${SRCPV}"
 SRCREV = "7a5b301e3adb8e054288518a325135a1883c1c6c"
 SRC_URI = "git://git.savannah.gnu.org/grub.git \
+           file://cfg \
            file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
            file://autogen.sh-exclude-pc.patch \
            file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
@@ -19,29 +23,73 @@ COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
 COMPATIBLE_HOST_armv7a = 'null'
 COMPATIBLE_HOST_armv7ve = 'null'
 
-inherit autotools gettext texinfo
+inherit autotools gettext texinfo deploy
 
 # configure.ac has code to set this automagically from the target tuple
 # but the OE freeform one (core2-foo-bar-linux) don't work with that.
-
 GRUBPLATFORM_arm = "uboot"
 GRUBPLATFORM_aarch64 = "efi"
 GRUBPLATFORM ??= "pc"
 
+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
                 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
+EXTRA_OECONF += "${@bb.utils.contains('GRUBPLATFORM', 'efi', '--enable-efiemu=no', '', d)}"
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"
 
-do_install_append () {
+# Determine the target arch for the grub modules
+python __anonymous () {
+    import re
+    target = d.getVar('TARGET_ARCH', True)
+    platform = d.getVar('GRUBPLATFORM', True)
+    if target == "x86_64":
+        grubtarget = 'x86_64'
+        grubimage = "bootx64." + platform
+    elif re.match('i.86', target):
+        grubtarget = 'i386'
+        grubimage = "bootia32." + platform
+    elif re.match('arm', target):
+        grubtarget = 'arm'
+        grubimage = "bootarm." + platform
+    elif re.match('aarch64', target):
+        grubtarget = 'arm64'
+        grubimage = "bootaa64." + platform
+    else:
+        raise bb.parse.SkipPackage("grub is incompatible with target %s" % target)
+    d.setVar("GRUB_TARGET", grubtarget)
+    d.setVar("GRUB_IMAGE", grubimage)
+}
+
+do_install_class-native() {
+    install -d ${D}${bindir}
+    install -m 755 grub-mkimage ${D}${bindir}
+}
+
+do_install_append() {
     install -d ${D}${sysconfdir}/grub.d
     rm -rf ${D}${libdir}/charset.alias
 }
 
+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
+do_deploy() {
+    # Search for the grub.cfg on the local boot media by using the
+    # built in cfg file provided via this recipe
+    grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+                   -O ${GRUB_TARGET}-${GRUBPLATFORM} -o ./${GRUB_IMAGE} \
+                   ${GRUB_BUILDIN}
+    install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+    :
+}
+
+addtask deploy after do_install before do_build
+
 # debugedit chokes on bare metal binaries
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 
-RDEPENDS_${PN} = "diffutils freetype"
-
 INSANE_SKIP_${PN} = "arch"
 INSANE_SKIP_${PN}-dbg = "arch"
+
+BBCLASSEXTEND = "native"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER
  2016-12-16 12:19 [PATCH v2 1/2] grub_git: extend recipe for proper target deployment Awais Belal
@ 2016-12-16 12:19 ` Awais Belal
  2016-12-27 12:15   ` Belal, Awais
  2016-12-27 12:15 ` [PATCH v2 1/2] grub_git: extend recipe for proper target deployment Belal, Awais
  1 sibling, 1 reply; 13+ messages in thread
From: Awais Belal @ 2016-12-16 12:19 UTC (permalink / raw)
  To: openembedded-core

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@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



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/2] grub_git: extend recipe for proper target deployment
  2016-12-16 12:19 [PATCH v2 1/2] grub_git: extend recipe for proper target deployment Awais Belal
  2016-12-16 12:19 ` [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER Awais Belal
@ 2016-12-27 12:15 ` Belal, Awais
  2017-01-03 12:34   ` Belal, Awais
  1 sibling, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2016-12-27 12:15 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target     deployment

This extends the grub_git recipe so it can deploy grub
on the target boot disk just like grub-efi. Mainly
this copies stuff from the grub-efi recipe and then
adjusts some bits accordingly. This would allow
using the latest and greatest versions of grub
on the target.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 meta/recipes-bsp/grub/grub_git.bb | 60 +++++++++++++++++++++++++++++++++++----
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
index eb824cc..13c48c7 100644
--- a/meta/recipes-bsp/grub/grub_git.bb
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -3,11 +3,15 @@ require grub2.inc
 DEFAULT_PREFERENCE = "-1"
 DEFAULT_PREFERENCE_arm = "1"

+DEPENDS += "grub-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
+
 FILESEXTRAPATHS =. "${FILE_DIRNAME}/grub-git:"

 PV = "2.00+${SRCPV}"
 SRCREV = "7a5b301e3adb8e054288518a325135a1883c1c6c"
 SRC_URI = "git://git.savannah.gnu.org/grub.git \
+           file://cfg \
            file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
            file://autogen.sh-exclude-pc.patch \
            file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
@@ -19,29 +23,73 @@ COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
 COMPATIBLE_HOST_armv7a = 'null'
 COMPATIBLE_HOST_armv7ve = 'null'

-inherit autotools gettext texinfo
+inherit autotools gettext texinfo deploy

 # configure.ac has code to set this automagically from the target tuple
 # but the OE freeform one (core2-foo-bar-linux) don't work with that.
-
 GRUBPLATFORM_arm = "uboot"
 GRUBPLATFORM_aarch64 = "efi"
 GRUBPLATFORM ??= "pc"

+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
                 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
+EXTRA_OECONF += "${@bb.utils.contains('GRUBPLATFORM', 'efi', '--enable-efiemu=no', '', d)}"
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"

-do_install_append () {
+# Determine the target arch for the grub modules
+python __anonymous () {
+    import re
+    target = d.getVar('TARGET_ARCH', True)
+    platform = d.getVar('GRUBPLATFORM', True)
+    if target == "x86_64":
+        grubtarget = 'x86_64'
+        grubimage = "bootx64." + platform
+    elif re.match('i.86', target):
+        grubtarget = 'i386'
+        grubimage = "bootia32." + platform
+    elif re.match('arm', target):
+        grubtarget = 'arm'
+        grubimage = "bootarm." + platform
+    elif re.match('aarch64', target):
+        grubtarget = 'arm64'
+        grubimage = "bootaa64." + platform
+    else:
+        raise bb.parse.SkipPackage("grub is incompatible with target %s" % target)
+    d.setVar("GRUB_TARGET", grubtarget)
+    d.setVar("GRUB_IMAGE", grubimage)
+}
+
+do_install_class-native() {
+    install -d ${D}${bindir}
+    install -m 755 grub-mkimage ${D}${bindir}
+}
+
+do_install_append() {
     install -d ${D}${sysconfdir}/grub.d
     rm -rf ${D}${libdir}/charset.alias
 }

+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
+do_deploy() {
+    # Search for the grub.cfg on the local boot media by using the
+    # built in cfg file provided via this recipe
+    grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+                   -O ${GRUB_TARGET}-${GRUBPLATFORM} -o ./${GRUB_IMAGE} \
+                   ${GRUB_BUILDIN}
+    install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+    :
+}
+
+addtask deploy after do_install before do_build
+
 # debugedit chokes on bare metal binaries
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

-RDEPENDS_${PN} = "diffutils freetype"
-
 INSANE_SKIP_${PN} = "arch"
 INSANE_SKIP_${PN}-dbg = "arch"
+
+BBCLASSEXTEND = "native"
--
1.9.1

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER
  2016-12-16 12:19 ` [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER Awais Belal
@ 2016-12-27 12:15   ` Belal, Awais
  2017-01-03 12:34     ` Belal, Awais
  0 siblings, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2016-12-27 12:15 UTC (permalink / raw)
  To: openembedded-core

Ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@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@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@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/2] grub_git: extend recipe for proper target deployment
  2016-12-27 12:15 ` [PATCH v2 1/2] grub_git: extend recipe for proper target deployment Belal, Awais
@ 2017-01-03 12:34   ` Belal, Awais
  2017-01-10 10:14     ` Belal, Awais
  0 siblings, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2017-01-03 12:34 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target     deployment

This extends the grub_git recipe so it can deploy grub
on the target boot disk just like grub-efi. Mainly
this copies stuff from the grub-efi recipe and then
adjusts some bits accordingly. This would allow
using the latest and greatest versions of grub
on the target.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 meta/recipes-bsp/grub/grub_git.bb | 60 +++++++++++++++++++++++++++++++++++----
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
index eb824cc..13c48c7 100644
--- a/meta/recipes-bsp/grub/grub_git.bb
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -3,11 +3,15 @@ require grub2.inc
 DEFAULT_PREFERENCE = "-1"
 DEFAULT_PREFERENCE_arm = "1"

+DEPENDS += "grub-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
+
 FILESEXTRAPATHS =. "${FILE_DIRNAME}/grub-git:"

 PV = "2.00+${SRCPV}"
 SRCREV = "7a5b301e3adb8e054288518a325135a1883c1c6c"
 SRC_URI = "git://git.savannah.gnu.org/grub.git \
+           file://cfg \
            file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
            file://autogen.sh-exclude-pc.patch \
            file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
@@ -19,29 +23,73 @@ COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
 COMPATIBLE_HOST_armv7a = 'null'
 COMPATIBLE_HOST_armv7ve = 'null'

-inherit autotools gettext texinfo
+inherit autotools gettext texinfo deploy

 # configure.ac has code to set this automagically from the target tuple
 # but the OE freeform one (core2-foo-bar-linux) don't work with that.
-
 GRUBPLATFORM_arm = "uboot"
 GRUBPLATFORM_aarch64 = "efi"
 GRUBPLATFORM ??= "pc"

+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
                 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
+EXTRA_OECONF += "${@bb.utils.contains('GRUBPLATFORM', 'efi', '--enable-efiemu=no', '', d)}"
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"

-do_install_append () {
+# Determine the target arch for the grub modules
+python __anonymous () {
+    import re
+    target = d.getVar('TARGET_ARCH', True)
+    platform = d.getVar('GRUBPLATFORM', True)
+    if target == "x86_64":
+        grubtarget = 'x86_64'
+        grubimage = "bootx64." + platform
+    elif re.match('i.86', target):
+        grubtarget = 'i386'
+        grubimage = "bootia32." + platform
+    elif re.match('arm', target):
+        grubtarget = 'arm'
+        grubimage = "bootarm." + platform
+    elif re.match('aarch64', target):
+        grubtarget = 'arm64'
+        grubimage = "bootaa64." + platform
+    else:
+        raise bb.parse.SkipPackage("grub is incompatible with target %s" % target)
+    d.setVar("GRUB_TARGET", grubtarget)
+    d.setVar("GRUB_IMAGE", grubimage)
+}
+
+do_install_class-native() {
+    install -d ${D}${bindir}
+    install -m 755 grub-mkimage ${D}${bindir}
+}
+
+do_install_append() {
     install -d ${D}${sysconfdir}/grub.d
     rm -rf ${D}${libdir}/charset.alias
 }

+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
+do_deploy() {
+    # Search for the grub.cfg on the local boot media by using the
+    # built in cfg file provided via this recipe
+    grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+                   -O ${GRUB_TARGET}-${GRUBPLATFORM} -o ./${GRUB_IMAGE} \
+                   ${GRUB_BUILDIN}
+    install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+    :
+}
+
+addtask deploy after do_install before do_build
+
 # debugedit chokes on bare metal binaries
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

-RDEPENDS_${PN} = "diffutils freetype"
-
 INSANE_SKIP_${PN} = "arch"
 INSANE_SKIP_${PN}-dbg = "arch"
+
+BBCLASSEXTEND = "native"
--
1.9.1

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER
  2016-12-27 12:15   ` Belal, Awais
@ 2017-01-03 12:34     ` Belal, Awais
  2017-01-10 12:19       ` Belal, Awais
  0 siblings, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2017-01-03 12:34 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@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@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@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/2] grub_git: extend recipe for proper target deployment
  2017-01-03 12:34   ` Belal, Awais
@ 2017-01-10 10:14     ` Belal, Awais
  2017-01-30 13:25       ` Belal, Awais
  0 siblings, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2017-01-10 10:14 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 3, 2017 5:34 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target     deployment

This extends the grub_git recipe so it can deploy grub
on the target boot disk just like grub-efi. Mainly
this copies stuff from the grub-efi recipe and then
adjusts some bits accordingly. This would allow
using the latest and greatest versions of grub
on the target.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 meta/recipes-bsp/grub/grub_git.bb | 60 +++++++++++++++++++++++++++++++++++----
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
index eb824cc..13c48c7 100644
--- a/meta/recipes-bsp/grub/grub_git.bb
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -3,11 +3,15 @@ require grub2.inc
 DEFAULT_PREFERENCE = "-1"
 DEFAULT_PREFERENCE_arm = "1"

+DEPENDS += "grub-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
+
 FILESEXTRAPATHS =. "${FILE_DIRNAME}/grub-git:"

 PV = "2.00+${SRCPV}"
 SRCREV = "7a5b301e3adb8e054288518a325135a1883c1c6c"
 SRC_URI = "git://git.savannah.gnu.org/grub.git \
+           file://cfg \
            file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
            file://autogen.sh-exclude-pc.patch \
            file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
@@ -19,29 +23,73 @@ COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
 COMPATIBLE_HOST_armv7a = 'null'
 COMPATIBLE_HOST_armv7ve = 'null'

-inherit autotools gettext texinfo
+inherit autotools gettext texinfo deploy

 # configure.ac has code to set this automagically from the target tuple
 # but the OE freeform one (core2-foo-bar-linux) don't work with that.
-
 GRUBPLATFORM_arm = "uboot"
 GRUBPLATFORM_aarch64 = "efi"
 GRUBPLATFORM ??= "pc"

+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
                 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
+EXTRA_OECONF += "${@bb.utils.contains('GRUBPLATFORM', 'efi', '--enable-efiemu=no', '', d)}"
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"

-do_install_append () {
+# Determine the target arch for the grub modules
+python __anonymous () {
+    import re
+    target = d.getVar('TARGET_ARCH', True)
+    platform = d.getVar('GRUBPLATFORM', True)
+    if target == "x86_64":
+        grubtarget = 'x86_64'
+        grubimage = "bootx64." + platform
+    elif re.match('i.86', target):
+        grubtarget = 'i386'
+        grubimage = "bootia32." + platform
+    elif re.match('arm', target):
+        grubtarget = 'arm'
+        grubimage = "bootarm." + platform
+    elif re.match('aarch64', target):
+        grubtarget = 'arm64'
+        grubimage = "bootaa64." + platform
+    else:
+        raise bb.parse.SkipPackage("grub is incompatible with target %s" % target)
+    d.setVar("GRUB_TARGET", grubtarget)
+    d.setVar("GRUB_IMAGE", grubimage)
+}
+
+do_install_class-native() {
+    install -d ${D}${bindir}
+    install -m 755 grub-mkimage ${D}${bindir}
+}
+
+do_install_append() {
     install -d ${D}${sysconfdir}/grub.d
     rm -rf ${D}${libdir}/charset.alias
 }

+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
+do_deploy() {
+    # Search for the grub.cfg on the local boot media by using the
+    # built in cfg file provided via this recipe
+    grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+                   -O ${GRUB_TARGET}-${GRUBPLATFORM} -o ./${GRUB_IMAGE} \
+                   ${GRUB_BUILDIN}
+    install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+    :
+}
+
+addtask deploy after do_install before do_build
+
 # debugedit chokes on bare metal binaries
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

-RDEPENDS_${PN} = "diffutils freetype"
-
 INSANE_SKIP_${PN} = "arch"
 INSANE_SKIP_${PN}-dbg = "arch"
+
+BBCLASSEXTEND = "native"
--
1.9.1

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER
  2017-01-03 12:34     ` Belal, Awais
@ 2017-01-10 12:19       ` Belal, Awais
  2017-01-30 13:25         ` Belal, Awais
  0 siblings, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2017-01-10 12:19 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 3, 2017 5:34 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@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@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@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/2] grub_git: extend recipe for proper target deployment
  2017-01-10 10:14     ` Belal, Awais
@ 2017-01-30 13:25       ` Belal, Awais
  2017-03-30 13:02         ` Belal, Awais
  0 siblings, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2017-01-30 13:25 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 10, 2017 3:14 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 3, 2017 5:34 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target     deployment

This extends the grub_git recipe so it can deploy grub
on the target boot disk just like grub-efi. Mainly
this copies stuff from the grub-efi recipe and then
adjusts some bits accordingly. This would allow
using the latest and greatest versions of grub
on the target.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 meta/recipes-bsp/grub/grub_git.bb | 60 +++++++++++++++++++++++++++++++++++----
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
index eb824cc..13c48c7 100644
--- a/meta/recipes-bsp/grub/grub_git.bb
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -3,11 +3,15 @@ require grub2.inc
 DEFAULT_PREFERENCE = "-1"
 DEFAULT_PREFERENCE_arm = "1"

+DEPENDS += "grub-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
+
 FILESEXTRAPATHS =. "${FILE_DIRNAME}/grub-git:"

 PV = "2.00+${SRCPV}"
 SRCREV = "7a5b301e3adb8e054288518a325135a1883c1c6c"
 SRC_URI = "git://git.savannah.gnu.org/grub.git \
+           file://cfg \
            file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
            file://autogen.sh-exclude-pc.patch \
            file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
@@ -19,29 +23,73 @@ COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
 COMPATIBLE_HOST_armv7a = 'null'
 COMPATIBLE_HOST_armv7ve = 'null'

-inherit autotools gettext texinfo
+inherit autotools gettext texinfo deploy

 # configure.ac has code to set this automagically from the target tuple
 # but the OE freeform one (core2-foo-bar-linux) don't work with that.
-
 GRUBPLATFORM_arm = "uboot"
 GRUBPLATFORM_aarch64 = "efi"
 GRUBPLATFORM ??= "pc"

+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
                 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
+EXTRA_OECONF += "${@bb.utils.contains('GRUBPLATFORM', 'efi', '--enable-efiemu=no', '', d)}"
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"

-do_install_append () {
+# Determine the target arch for the grub modules
+python __anonymous () {
+    import re
+    target = d.getVar('TARGET_ARCH', True)
+    platform = d.getVar('GRUBPLATFORM', True)
+    if target == "x86_64":
+        grubtarget = 'x86_64'
+        grubimage = "bootx64." + platform
+    elif re.match('i.86', target):
+        grubtarget = 'i386'
+        grubimage = "bootia32." + platform
+    elif re.match('arm', target):
+        grubtarget = 'arm'
+        grubimage = "bootarm." + platform
+    elif re.match('aarch64', target):
+        grubtarget = 'arm64'
+        grubimage = "bootaa64." + platform
+    else:
+        raise bb.parse.SkipPackage("grub is incompatible with target %s" % target)
+    d.setVar("GRUB_TARGET", grubtarget)
+    d.setVar("GRUB_IMAGE", grubimage)
+}
+
+do_install_class-native() {
+    install -d ${D}${bindir}
+    install -m 755 grub-mkimage ${D}${bindir}
+}
+
+do_install_append() {
     install -d ${D}${sysconfdir}/grub.d
     rm -rf ${D}${libdir}/charset.alias
 }

+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
+do_deploy() {
+    # Search for the grub.cfg on the local boot media by using the
+    # built in cfg file provided via this recipe
+    grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+                   -O ${GRUB_TARGET}-${GRUBPLATFORM} -o ./${GRUB_IMAGE} \
+                   ${GRUB_BUILDIN}
+    install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+    :
+}
+
+addtask deploy after do_install before do_build
+
 # debugedit chokes on bare metal binaries
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

-RDEPENDS_${PN} = "diffutils freetype"
-
 INSANE_SKIP_${PN} = "arch"
 INSANE_SKIP_${PN}-dbg = "arch"
+
+BBCLASSEXTEND = "native"
--
1.9.1

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER
  2017-01-10 12:19       ` Belal, Awais
@ 2017-01-30 13:25         ` Belal, Awais
  2017-03-30 13:02           ` Belal, Awais
  0 siblings, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2017-01-30 13:25 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 10, 2017 5:19 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 3, 2017 5:34 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@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@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@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/2] grub_git: extend recipe for proper target deployment
  2017-01-30 13:25       ` Belal, Awais
@ 2017-03-30 13:02         ` Belal, Awais
  2017-03-30 16:02           ` Richard Purdie
  0 siblings, 1 reply; 13+ messages in thread
From: Belal, Awais @ 2017-03-30 13:02 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Monday, January 30, 2017 6:25 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 10, 2017 3:14 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 3, 2017 5:34 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target deployment

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@lists.openembedded.org
Subject: [OE-core] [PATCH v2 1/2] grub_git: extend recipe for proper target     deployment

This extends the grub_git recipe so it can deploy grub
on the target boot disk just like grub-efi. Mainly
this copies stuff from the grub-efi recipe and then
adjusts some bits accordingly. This would allow
using the latest and greatest versions of grub
on the target.

Signed-off-by: Awais Belal <awais_belal@mentor.com>
---
 meta/recipes-bsp/grub/grub_git.bb | 60 +++++++++++++++++++++++++++++++++++----
 1 file changed, 54 insertions(+), 6 deletions(-)

diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
index eb824cc..13c48c7 100644
--- a/meta/recipes-bsp/grub/grub_git.bb
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -3,11 +3,15 @@ require grub2.inc
 DEFAULT_PREFERENCE = "-1"
 DEFAULT_PREFERENCE_arm = "1"

+DEPENDS += "grub-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
+
 FILESEXTRAPATHS =. "${FILE_DIRNAME}/grub-git:"

 PV = "2.00+${SRCPV}"
 SRCREV = "7a5b301e3adb8e054288518a325135a1883c1c6c"
 SRC_URI = "git://git.savannah.gnu.org/grub.git \
+           file://cfg \
            file://0001-Disable-mfpmath-sse-as-well-when-SSE-is-disabled.patch \
            file://autogen.sh-exclude-pc.patch \
            file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \
@@ -19,29 +23,73 @@ COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
 COMPATIBLE_HOST_armv7a = 'null'
 COMPATIBLE_HOST_armv7ve = 'null'

-inherit autotools gettext texinfo
+inherit autotools gettext texinfo deploy

 # configure.ac has code to set this automagically from the target tuple
 # but the OE freeform one (core2-foo-bar-linux) don't work with that.
-
 GRUBPLATFORM_arm = "uboot"
 GRUBPLATFORM_aarch64 = "efi"
 GRUBPLATFORM ??= "pc"

+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
 EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
                 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
-
+EXTRA_OECONF += "${@bb.utils.contains('GRUBPLATFORM', 'efi', '--enable-efiemu=no', '', d)}"
 EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '--enable-largefile', '--disable-largefile', d)}"

-do_install_append () {
+# Determine the target arch for the grub modules
+python __anonymous () {
+    import re
+    target = d.getVar('TARGET_ARCH', True)
+    platform = d.getVar('GRUBPLATFORM', True)
+    if target == "x86_64":
+        grubtarget = 'x86_64'
+        grubimage = "bootx64." + platform
+    elif re.match('i.86', target):
+        grubtarget = 'i386'
+        grubimage = "bootia32." + platform
+    elif re.match('arm', target):
+        grubtarget = 'arm'
+        grubimage = "bootarm." + platform
+    elif re.match('aarch64', target):
+        grubtarget = 'arm64'
+        grubimage = "bootaa64." + platform
+    else:
+        raise bb.parse.SkipPackage("grub is incompatible with target %s" % target)
+    d.setVar("GRUB_TARGET", grubtarget)
+    d.setVar("GRUB_IMAGE", grubimage)
+}
+
+do_install_class-native() {
+    install -d ${D}${bindir}
+    install -m 755 grub-mkimage ${D}${bindir}
+}
+
+do_install_append() {
     install -d ${D}${sysconfdir}/grub.d
     rm -rf ${D}${libdir}/charset.alias
 }

+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
+do_deploy() {
+    # Search for the grub.cfg on the local boot media by using the
+    # built in cfg file provided via this recipe
+    grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+                   -O ${GRUB_TARGET}-${GRUBPLATFORM} -o ./${GRUB_IMAGE} \
+                   ${GRUB_BUILDIN}
+    install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+    :
+}
+
+addtask deploy after do_install before do_build
+
 # debugedit chokes on bare metal binaries
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

-RDEPENDS_${PN} = "diffutils freetype"
-
 INSANE_SKIP_${PN} = "arch"
 INSANE_SKIP_${PN}-dbg = "arch"
+
+BBCLASSEXTEND = "native"
--
1.9.1

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


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER
  2017-01-30 13:25         ` Belal, Awais
@ 2017-03-30 13:02           ` Belal, Awais
  0 siblings, 0 replies; 13+ messages in thread
From: Belal, Awais @ 2017-03-30 13:02 UTC (permalink / raw)
  To: openembedded-core

ping!

BR,
Awais

________________________________________
From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Monday, January 30, 2017 6:25 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 10, 2017 5:19 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, January 3, 2017 5:34 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Tuesday, December 27, 2016 5:15 PM
To: openembedded-core@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@lists.openembedded.org <openembedded-core-bounces@lists.openembedded.org> on behalf of Belal, Awais
Sent: Friday, December 16, 2016 5:19 PM
To: openembedded-core@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@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@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v2 1/2] grub_git: extend recipe for proper target deployment
  2017-03-30 13:02         ` Belal, Awais
@ 2017-03-30 16:02           ` Richard Purdie
  0 siblings, 0 replies; 13+ messages in thread
From: Richard Purdie @ 2017-03-30 16:02 UTC (permalink / raw)
  To: Belal, Awais, openembedded-core

On Thu, 2017-03-30 at 13:02 +0000, Belal, Awais wrote:
> ping!

Sorry, these appear to have gotten lost in the system. The patches
don't apply any more, could you rebase and resend please?

Cheers,

Richard


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-03-30 16:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-16 12:19 [PATCH v2 1/2] grub_git: extend recipe for proper target deployment Awais Belal
2016-12-16 12:19 ` [PATCH v2 2/2] grub-efi/live-vm-common: allow grub as EFI_PROVIDER Awais Belal
2016-12-27 12:15   ` Belal, Awais
2017-01-03 12:34     ` Belal, Awais
2017-01-10 12:19       ` Belal, Awais
2017-01-30 13:25         ` Belal, Awais
2017-03-30 13:02           ` Belal, Awais
2016-12-27 12:15 ` [PATCH v2 1/2] grub_git: extend recipe for proper target deployment Belal, Awais
2017-01-03 12:34   ` Belal, Awais
2017-01-10 10:14     ` Belal, Awais
2017-01-30 13:25       ` Belal, Awais
2017-03-30 13:02         ` Belal, Awais
2017-03-30 16:02           ` Richard Purdie

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.