blob: 7b44eab8d11f8356d6e2f448a68d62a0c0b9a3ca [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001require grub2.inc
2
3DEPENDS_class-target = "grub-efi-native"
4RDEPENDS_${PN}_class-target = "diffutils freetype"
5PR = "r3"
6
7SRC_URI += " \
8 file://cfg \
9 "
10
11S = "${WORKDIR}/grub-${PV}"
12
13# Determine the target arch for the grub modules
14python __anonymous () {
15 import re
16 target = d.getVar('TARGET_ARCH', True)
17 if target == "x86_64":
18 grubtarget = 'x86_64'
19 grubimage = "bootx64.efi"
20 elif re.match('i.86', target):
21 grubtarget = 'i386'
22 grubimage = "bootia32.efi"
23 else:
24 raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
25 d.setVar("GRUB_TARGET", grubtarget)
26 d.setVar("GRUB_IMAGE", grubimage)
27}
28
29inherit deploy
30
31CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
32EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
33 --enable-efiemu=no --program-prefix='' \
34 --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
35
36do_install_class-native() {
37 install -d ${D}${bindir}
38 install -m 755 grub-mkimage ${D}${bindir}
39}
40
41GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
42
43do_deploy() {
44 # Search for the grub.cfg on the local boot media by using the
45 # built in cfg file provided via this recipe
46 grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
47 -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
48 ${GRUB_BUILDIN}
49 install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
50}
51
52do_deploy_class-native() {
53 :
54}
55
56addtask deploy after do_install before do_build
57
58FILES_${PN}-dbg += "${libdir}/grub/${GRUB_TARGET}-efi/.debug \
59 /boot/efi/EFI/BOOT/${GRUB_TARGET}-efi/.debug \
60 "
61FILES_${PN} += "${libdir}/grub/${GRUB_TARGET}-efi \
62 ${datadir}/grub \
63 "
64
65BBCLASSEXTEND = "native"
66