From: "Belal, Awais" <Awais_Belal@mentor.com>
To: "openembedded-core@lists.openembedded.org"
<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v2 1/2] grub_git: extend recipe for proper target deployment
Date: Tue, 3 Jan 2017 12:34:35 +0000 [thread overview]
Message-ID: <1483446874461.46009@mentor.com> (raw)
In-Reply-To: <1482840926804.77705@mentor.com>
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
next prev parent reply other threads:[~2017-01-03 12:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=1483446874461.46009@mentor.com \
--to=awais_belal@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