diff options
Diffstat (limited to 'meta/recipes-bsp/grub/grub-efi-native_2.00.bb')
-rw-r--r-- | meta/recipes-bsp/grub/grub-efi-native_2.00.bb | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/grub-efi-native_2.00.bb b/meta/recipes-bsp/grub/grub-efi-native_2.00.bb new file mode 100644 index 0000000000..04973b524f --- /dev/null +++ b/meta/recipes-bsp/grub/grub-efi-native_2.00.bb | |||
@@ -0,0 +1,84 @@ | |||
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" | ||
18 | RDEPENDS_${PN} = "diffutils freetype" | ||
19 | PR = "r2" | ||
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 \ | ||
26 | file://cfg \ | ||
27 | file://grub-2.00-fpmath-sse-387-fix.patch \ | ||
28 | file://grub-2.00-fix-enable_execute_stack-check.patch \ | ||
29 | file://grub-2.00-disable-help2man.patch \ | ||
30 | file://check-if-liblzma-is-disabled.patch \ | ||
31 | file://grub-no-unused-result.patch \ | ||
32 | file://grub-2.00-ignore-gnulib-gets-stupidity.patch \ | ||
33 | file://fix-issue-with-flex-2.5.37.patch \ | ||
34 | " | ||
35 | SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c" | ||
36 | SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3" | ||
37 | |||
38 | COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)' | ||
39 | |||
40 | S = "${WORKDIR}/grub-${PV}" | ||
41 | |||
42 | # Determine the target arch for the grub modules before the native class | ||
43 | # clobbers TARGET_ARCH. | ||
44 | ORIG_TARGET_ARCH := "${TARGET_ARCH}" | ||
45 | python __anonymous () { | ||
46 | import re | ||
47 | target = d.getVar('ORIG_TARGET_ARCH', True) | ||
48 | if target == "x86_64": | ||
49 | grubtarget = 'x86_64' | ||
50 | grubimage = "bootx64.efi" | ||
51 | elif re.match('i.86', target): | ||
52 | grubtarget = 'i386' | ||
53 | grubimage = "bootia32.efi" | ||
54 | else: | ||
55 | raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target) | ||
56 | d.setVar("GRUB_TARGET", grubtarget) | ||
57 | d.setVar("GRUB_IMAGE", grubimage) | ||
58 | } | ||
59 | |||
60 | inherit autotools | ||
61 | inherit gettext | ||
62 | inherit native | ||
63 | inherit deploy | ||
64 | |||
65 | EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \ | ||
66 | --target=${GRUB_TARGET} --enable-efiemu=no --program-prefix='' \ | ||
67 | --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no" | ||
68 | |||
69 | do_mkimage() { | ||
70 | # Search for the grub.cfg on the local boot media by using the | ||
71 | # built in cfg file provided via this recipe | ||
72 | ./grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \ | ||
73 | -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \ | ||
74 | boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search | ||
75 | } | ||
76 | addtask mkimage after do_compile before do_install | ||
77 | |||
78 | do_deploy() { | ||
79 | install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR} | ||
80 | } | ||
81 | addtask deploy after do_install before do_build | ||
82 | |||
83 | do_install[noexec] = "1" | ||
84 | do_populate_sysroot[noexec] = "1" | ||