python __anonymous () {
import re
target = d.getVar('TARGET_ARCH')
+ prefix = "" if d.getVar('EFI_PROVIDER') == "grub-efi" else "grub-efi-"
if target == "x86_64":
grubtarget = 'x86_64'
- grubimage = "grub-efi-bootx64.efi"
+ grubimage = prefix + "bootx64.efi"
elif re.match('i.86', target):
grubtarget = 'i386'
- grubimage = "grub-efi-bootia32.efi"
+ grubimage = prefix + "bootia32.efi"
else:
raise bb.parse.SkipRecipe("grub-efi is incompatible with target %s" % target)
d.setVar("GRUB_TARGET", grubtarget)
d.setVar("GRUB_IMAGE", grubimage)
+ prefix = "grub-efi-" if prefix == "" else ""
+ d.setVar("GRUB_IMAGE_PREFIX", prefix)
}
inherit deploy
# Search for the grub.cfg on the local boot media by using the
# built in cfg file provided via this recipe
grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
- -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
+ -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} \
${GRUB_BUILDIN}
}
install -d ${D}/boot
install -d ${D}/boot/EFI
install -d ${D}/boot/EFI/BOOT
- install -m 644 ${B}/${GRUB_IMAGE} ${D}/boot/EFI/BOOT/
+ install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${D}/boot/EFI/BOOT/${GRUB_IMAGE}
}
do_install_class-native() {
efi_gop iso9660 configfile search loadenv test"
do_deploy() {
- install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+ install -m 644 ${B}/${GRUB_IMAGE_PREFIX}${GRUB_IMAGE} ${DEPLOYDIR}
}
do_deploy_class-native() {