diff options
| author | Jackie Huang <jackie.huang@windriver.com> | 2013-11-18 20:29:07 +0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-14 09:11:11 +0000 |
| commit | 40b73e46605a3b4914983301195605162927dcb7 (patch) | |
| tree | 9cba6530357d4c3d3af6fc47ab2e526965c98ef5 /meta/recipes-bsp/grub/grub-efi_2.00.bb | |
| parent | 8275e0f7252888a25f5aaf22e8851d2ffa18ea85 (diff) | |
| download | poky-40b73e46605a3b4914983301195605162927dcb7.tar.gz | |
grub-efi: change to generate EFI image in target package
To generate the target EFI image in a native package, it requires
the host gcc have the ability to do -m32/-m64 compiling, but gcc
doesn't have that support on the 32bit version of some distributions
(e.g. rehl, suse), it would fail when build a 64bit target on these
32bit hosts.
In fact, all we need from grub-efi-native is the grub-mkimage binary,
so change the solution to:
* grub-efi-native only install grub-mkimage
* grub-efi compiles target modules, generates EFI image
with grub-mkimage and deploy, but install nothing.
(From OE-Core rev: 53d3f1273983dfce2a907b39768978afe99aab1a)
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/grub/grub-efi_2.00.bb')
| -rw-r--r-- | meta/recipes-bsp/grub/grub-efi_2.00.bb | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/grub-efi_2.00.bb b/meta/recipes-bsp/grub/grub-efi_2.00.bb new file mode 100644 index 0000000000..2fe688cb35 --- /dev/null +++ b/meta/recipes-bsp/grub/grub-efi_2.00.bb | |||
| @@ -0,0 +1,89 @@ | |||
| 1 | SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader" | ||
| 2 | |||
| 3 | DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \ | ||
| 4 | intended to unify bootloading across x86 operating systems. In \ | ||
| 5 | addition to loading the Linux kernel, it implements the Multiboot \ | ||
| 6 | standard, which allows for flexible loading of multiple boot images. \ | ||
| 7 | This recipe builds an EFI binary for the target. It does not install \ | ||
| 8 | or package anything, it only deploys a target-arch GRUB EFI image." | ||
| 9 | |||
| 10 | HOMEPAGE = "http://www.gnu.org/software/grub/" | ||
| 11 | SECTION = "bootloaders" | ||
| 12 | |||
| 13 | LICENSE = "GPLv3" | ||
| 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | ||
| 15 | |||
| 16 | # FIXME: We should be able to optionally drop freetype as a dependency | ||
| 17 | DEPENDS = "autogen-native flex-native bison-native" | ||
| 18 | DEPENDS_class-target = "grub-efi-native" | ||
| 19 | PR = "r2" | ||
| 20 | |||
| 21 | SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ | ||
| 22 | file://cfg \ | ||
| 23 | file://grub-2.00-fpmath-sse-387-fix.patch \ | ||
| 24 | file://grub-2.00-fix-enable_execute_stack-check.patch \ | ||
| 25 | file://grub-2.00-disable-help2man.patch \ | ||
| 26 | file://check-if-liblzma-is-disabled.patch \ | ||
| 27 | file://grub-no-unused-result.patch \ | ||
| 28 | file://grub-2.00-ignore-gnulib-gets-stupidity.patch \ | ||
| 29 | file://fix-issue-with-flex-2.5.37.patch \ | ||
| 30 | " | ||
| 31 | SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c" | ||
| 32 | SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3" | ||
| 33 | |||
| 34 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)' | ||
| 35 | |||
| 36 | S = "${WORKDIR}/grub-${PV}" | ||
| 37 | |||
| 38 | # Determine the target arch for the grub modules | ||
| 39 | python __anonymous () { | ||
| 40 | import re | ||
| 41 | target = d.getVar('TARGET_ARCH', True) | ||
| 42 | if target == "x86_64": | ||
| 43 | grubtarget = 'x86_64' | ||
| 44 | grubimage = "bootx64.efi" | ||
| 45 | elif re.match('i.86', target): | ||
| 46 | grubtarget = 'i386' | ||
| 47 | grubimage = "bootia32.efi" | ||
| 48 | else: | ||
| 49 | raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target) | ||
| 50 | d.setVar("GRUB_TARGET", grubtarget) | ||
| 51 | d.setVar("GRUB_IMAGE", grubimage) | ||
| 52 | } | ||
| 53 | |||
| 54 | inherit autotools | ||
| 55 | inherit gettext | ||
| 56 | inherit deploy | ||
| 57 | |||
| 58 | EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \ | ||
| 59 | --enable-efiemu=no --program-prefix='' \ | ||
| 60 | --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no" | ||
| 61 | |||
| 62 | do_install_class-target() { | ||
| 63 | : | ||
| 64 | } | ||
| 65 | |||
| 66 | do_install_class-native() { | ||
| 67 | install -d ${D}${bindir} | ||
| 68 | install -m 755 grub-mkimage ${D}${bindir} | ||
| 69 | } | ||
| 70 | |||
| 71 | do_deploy() { | ||
| 72 | # Search for the grub.cfg on the local boot media by using the | ||
| 73 | # built in cfg file provided via this recipe | ||
| 74 | grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \ | ||
| 75 | -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \ | ||
| 76 | boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search | ||
| 77 | install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR} | ||
| 78 | } | ||
| 79 | |||
| 80 | do_deploy_class-native() { | ||
| 81 | : | ||
| 82 | } | ||
| 83 | |||
| 84 | addtask deploy after do_install before do_build | ||
| 85 | |||
| 86 | FILES_${PN}-dbg += "${libdir}/${BPN}/${GRUB_TARGET}-efi/.debug" | ||
| 87 | |||
| 88 | BBCLASSEXTEND = "native" | ||
| 89 | ALLOW_EMPTY_${PN} = "1" | ||
