summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCalifornia Sullivan <california.l.sullivan@intel.com>2018-02-28 18:15:01 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-06 06:35:42 -0800
commit3afd4a5fa04ca97bdead6bb3794396f7492bc7dc (patch)
treef0c60a8d8ed487d5a28dad1c309a7ef8ef870cd7
parent531f7b444530bf3fa0a10b29d3f8c5ea5d427f14 (diff)
downloadpoky-3afd4a5fa04ca97bdead6bb3794396f7492bc7dc.tar.gz
grub-efi: if installed and EFI_PROVIDER, install as bootx64 or bootia32
This way we could theoretically support multiple bootloaders, and we keep the convention of boot(x64|ia32). (From OE-Core rev: 8d158bb4382fd4ef31d37ea5558e07d5eb33145e) Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-bsp/grub/grub-efi_2.02.bb13
1 files changed, 8 insertions, 5 deletions
diff --git a/meta/recipes-bsp/grub/grub-efi_2.02.bb b/meta/recipes-bsp/grub/grub-efi_2.02.bb
index c5a68f01ce..ed27b90fdb 100644
--- a/meta/recipes-bsp/grub/grub-efi_2.02.bb
+++ b/meta/recipes-bsp/grub/grub-efi_2.02.bb
@@ -15,16 +15,19 @@ S = "${WORKDIR}/grub-${PV}"
15python __anonymous () { 15python __anonymous () {
16 import re 16 import re
17 target = d.getVar('TARGET_ARCH') 17 target = d.getVar('TARGET_ARCH')
18 prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
18 if target == "x86_64": 19 if target == "x86_64":
19 grubtarget = 'x86_64' 20 grubtarget = 'x86_64'
20 grubimage = "grub-efi-bootx64.efi" 21 grubimage = prefix + "bootx64.efi"
21 elif re.match('i.86', target): 22 elif re.match('i.86', target):
22 grubtarget = 'i386' 23 grubtarget = 'i386'
23 grubimage = "grub-efi-bootia32.efi" 24 grubimage = prefix + "bootia32.efi"
24 else: 25 else:
25 raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target) 26 raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target)
26 d.setVar("GRUB_TARGET", grubtarget) 27 d.setVar("GRUB_TARGET", grubtarget)
27 d.setVar("GRUB_IMAGE", grubimage) 28 d.setVar("GRUB_IMAGE", grubimage)
29 prefix = "grub-efi-" if prefix == "" else ""
30 d.setVar("GRUB_IMAGE_PREFIX", prefix)
28} 31}
29 32
30inherit deploy 33inherit deploy
@@ -41,7 +44,7 @@ do_mkimage() {
41 # Search for the grub.cfg on the local boot media by using the 44 # Search for the grub.cfg on the local boot media by using the
42 # built in cfg file provided via this recipe 45 # built in cfg file provided via this recipe
43 grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \ 46 grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
44 -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \ 47 -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
45 ${GRUB_BUILDIN} 48 ${GRUB_BUILDIN}
46} 49}
47 50
@@ -55,7 +58,7 @@ do_install_append_class-target() {
55 install -d ${D}/boot 58 install -d ${D}/boot
56 install -d ${D}/boot/EFI 59 install -d ${D}/boot/EFI
57 install -d ${D}/boot/EFI/BOOT 60 install -d ${D}/boot/EFI/BOOT
58 install -m 644 ${B}/${GRUB_IMAGE} ${D}/boot/EFI/BOOT/ 61 install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}/boot/EFI/BOOT/${GRUB_IMAGE}
59} 62}
60 63
61do_install_class-native() { 64do_install_class-native() {
@@ -79,7 +82,7 @@ GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal \
79 efi_gop iso9660 configfile search loadenv test" 82 efi_gop iso9660 configfile search loadenv test"
80 83
81do_deploy() { 84do_deploy() {
82 install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR} 85 install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR}
83} 86}
84 87
85do_deploy_class-native() { 88do_deploy_class-native() {