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 | |
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')
-rw-r--r-- | meta/recipes-bsp/grub/grub-efi_2.00.bb (renamed from meta/recipes-bsp/grub/grub-efi-native_2.00.bb) | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/meta/recipes-bsp/grub/grub-efi-native_2.00.bb b/meta/recipes-bsp/grub/grub-efi_2.00.bb index 04973b524f..2fe688cb35 100644 --- a/meta/recipes-bsp/grub/grub-efi-native_2.00.bb +++ b/meta/recipes-bsp/grub/grub-efi_2.00.bb | |||
@@ -14,14 +14,10 @@ LICENSE = "GPLv3" | |||
14 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
15 | 15 | ||
16 | # FIXME: We should be able to optionally drop freetype as a dependency | 16 | # FIXME: We should be able to optionally drop freetype as a dependency |
17 | DEPENDS = "autogen-native" | 17 | DEPENDS = "autogen-native flex-native bison-native" |
18 | RDEPENDS_${PN} = "diffutils freetype" | 18 | DEPENDS_class-target = "grub-efi-native" |
19 | PR = "r2" | 19 | PR = "r2" |
20 | 20 | ||
21 | # Native packages do not normally rebuild when the target changes. | ||
22 | # Ensure this is built once per HOST-TARGET pair. | ||
23 | PN := "grub-efi-${TRANSLATED_TARGET_ARCH}-native" | ||
24 | |||
25 | SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ | 21 | SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ |
26 | file://cfg \ | 22 | file://cfg \ |
27 | file://grub-2.00-fpmath-sse-387-fix.patch \ | 23 | file://grub-2.00-fpmath-sse-387-fix.patch \ |
@@ -39,12 +35,10 @@ COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)' | |||
39 | 35 | ||
40 | S = "${WORKDIR}/grub-${PV}" | 36 | S = "${WORKDIR}/grub-${PV}" |
41 | 37 | ||
42 | # Determine the target arch for the grub modules before the native class | 38 | # Determine the target arch for the grub modules |
43 | # clobbers TARGET_ARCH. | ||
44 | ORIG_TARGET_ARCH := "${TARGET_ARCH}" | ||
45 | python __anonymous () { | 39 | python __anonymous () { |
46 | import re | 40 | import re |
47 | target = d.getVar('ORIG_TARGET_ARCH', True) | 41 | target = d.getVar('TARGET_ARCH', True) |
48 | if target == "x86_64": | 42 | if target == "x86_64": |
49 | grubtarget = 'x86_64' | 43 | grubtarget = 'x86_64' |
50 | grubimage = "bootx64.efi" | 44 | grubimage = "bootx64.efi" |
@@ -59,26 +53,37 @@ python __anonymous () { | |||
59 | 53 | ||
60 | inherit autotools | 54 | inherit autotools |
61 | inherit gettext | 55 | inherit gettext |
62 | inherit native | ||
63 | inherit deploy | 56 | inherit deploy |
64 | 57 | ||
65 | EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \ | 58 | EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \ |
66 | --target=${GRUB_TARGET} --enable-efiemu=no --program-prefix='' \ | 59 | --enable-efiemu=no --program-prefix='' \ |
67 | --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no" | 60 | --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no" |
68 | 61 | ||
69 | do_mkimage() { | 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() { | ||
70 | # Search for the grub.cfg on the local boot media by using the | 72 | # Search for the grub.cfg on the local boot media by using the |
71 | # built in cfg file provided via this recipe | 73 | # built in cfg file provided via this recipe |
72 | ./grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \ | 74 | grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \ |
73 | -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \ | 75 | -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \ |
74 | boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search | 76 | boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search |
77 | install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR} | ||
75 | } | 78 | } |
76 | addtask mkimage after do_compile before do_install | ||
77 | 79 | ||
78 | do_deploy() { | 80 | do_deploy_class-native() { |
79 | install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR} | 81 | : |
80 | } | 82 | } |
83 | |||
81 | addtask deploy after do_install before do_build | 84 | addtask deploy after do_install before do_build |
82 | 85 | ||
83 | do_install[noexec] = "1" | 86 | FILES_${PN}-dbg += "${libdir}/${BPN}/${GRUB_TARGET}-efi/.debug" |
84 | do_populate_sysroot[noexec] = "1" | 87 | |
88 | BBCLASSEXTEND = "native" | ||
89 | ALLOW_EMPTY_${PN} = "1" | ||