summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-11-21 14:01:26 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-30 22:18:07 +0000
commitfcde2d65a76667a2d925fe5752dcc750b137f99a (patch)
treeccc3ef34a14df6cf5da96e20311d6aceeae2c5f1 /meta/recipes-bsp/grub/grub-efi-native_1.99.bb
parent1098d8d35c8d4432ffd2d580ce9a657c5dd7eeea (diff)
downloadpoky-fcde2d65a76667a2d925fe5752dcc750b137f99a.tar.gz
grub-efi-native: New recipe to build GRUB EFI images
Add a recipe to build the GRUB efi images. This recipe is written as a native recipe as the resulting GRUB utils are required to assemble the final image. Rather than build a native and a target recipe (and increase build times), this recipe builds the utils for the host and passes an appropriate --target argument to the GRUB configure script to build the modules for the target arch. The only output of this recipe is an EFI image in the deploy directory. Care is taken to ensure changing targets will force a rebuild of this native recipe by including the target arch in the PN. (From OE-Core rev: f9518a368f041ceccb4a36061d91ae64cd4dabd4) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/grub/grub-efi-native_1.99.bb')
-rw-r--r--meta/recipes-bsp/grub/grub-efi-native_1.99.bb74
1 files changed, 74 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/grub-efi-native_1.99.bb b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
new file mode 100644
index 0000000000..3c52ec9235
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-efi-native_1.99.bb
@@ -0,0 +1,74 @@
1SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
2
3DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
4intended to unify bootloading across x86 operating systems. In \
5addition to loading the Linux kernel, it implements the Multiboot \
6standard, which allows for flexible loading of multiple boot images. \
7This recipe builds an EFI binary for the target. It does not install \
8or package anything, it only deploys a target-arch GRUB EFI image."
9
10HOMEPAGE = "http://www.gnu.org/software/grub/"
11SECTION = "bootloaders"
12PRIORITY = "optional"
13
14LICENSE = "GPLv3"
15LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
16
17# FIXME: We should be able to optionally drop freetype as a dependency
18DEPENDS = "help2man-native"
19RDEPENDS_${PN} = "diffutils freetype"
20PR = "r1"
21
22# Native packages do not normally rebuild when the target changes.
23# Ensure this is built once per HOST-TARGET pair.
24PN := "grub-efi-${TRANSLATED_TARGET_ARCH}-native"
25
26SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz"
27
28SRC_URI[md5sum] = "ca9f2a2d571b57fc5c53212d1d22e2b5"
29SRC_URI[sha256sum] = "b91f420f2c51f6155e088e34ff99bea09cc1fb89585cf7c0179644e57abd28ff"
30
31COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
32
33S = "${WORKDIR}/grub-${PV}"
34
35# Determine the target arch for the grub modules before the native class
36# clobbers TARGET_ARCH.
37ORIG_TARGET_ARCH := ${TARGET_ARCH}
38python __anonymous () {
39 import re
40 target = d.getVar('ORIG_TARGET_ARCH', True)
41 if target == "x86_64":
42 grubtarget = 'x86_64'
43 grubimage = "bootx64.efi"
44 elif re.match('i.86', target):
45 grubtarget = 'i386'
46 grubimage = "bootia32.efi"
47 else:
48 raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
49 d.setVar("GRUB_TARGET", grubtarget)
50 d.setVar("GRUB_IMAGE", grubimage)
51}
52
53inherit autotools
54inherit gettext
55inherit native
56inherit deploy
57
58EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
59 --target=${GRUB_TARGET} --enable-efiemu=no --program-prefix=''"
60
61do_mkimage() {
62 ./grub-mkimage -p / -d ./grub-core/ \
63 -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
64 boot linux fat serial part_msdos normal
65}
66addtask mkimage after do_compile before do_install
67
68do_deploy() {
69 install -m 644 ${S}/${GRUB_IMAGE} ${DEPLOYDIR}
70}
71addtask deploy after do_install before do_build
72
73do_install[noexec] = "1"
74do_populate_sysroot[noexec] = "1"