Force EFI grub installation on amd64 with uefi merge
authorSteve McIntyre <steve@einval.com>
Tue, 24 Jan 2017 15:49:59 +0000 (15:49 +0000)
committerSteve McIntyre <steve@einval.com>
Tue, 24 Jan 2017 15:49:59 +0000 (15:49 +0000)
build-openstack-debian-image

index 0295e1a..b75ef3a 100755 (executable)
@@ -239,8 +239,14 @@ fi
 if [ "${BOOTMANAGER}" = "grub" ] ; then
        if [ "${BOOTTYPE}" = "uefi" ] ; then
                BOOT_MGR_PKG="grub-efi-${ARCH}"
+               if [ "${ARCH}" = "arm64" ] ; then
+                       GRUB_TARGET="arm64-efi"
+               else
+                       GRUB_TARGET="x86_64-efi"
+               fi
        else
                BOOT_MGR_PKG="grub-pc"
+               GRUB_TARGET="i386-pc"
        fi
 else
        BOOT_MGR_PKG="extlinux"
@@ -602,7 +608,7 @@ GRUB_DISABLE_OS_PROBER=true" >>${MOUNT_DIR}/etc/default/grub
        echo "grub-efi-${ARCH} grub2/force_efi_extra_removable boolean true" | chroot ${MOUNT_DIR} debconf-set-selections
        chroot ${MOUNT_DIR} grub-mkconfig -o /boot/grub/grub.cfg
        # Run grub from the chroot, pointing to the bind mounted /dev device.
-       chroot ${MOUNT_DIR} grub-install --force-extra-removable --no-floppy --modules="part_msdos part_gpt" --grub-mkdevicemap=/boot/grub/device.map /dev/${LOOPRAW_DEVICE}
+       chroot ${MOUNT_DIR} grub-install --target=${GRUB_TARGET} --force-extra-removable --no-floppy --modules="part_msdos part_gpt" --grub-mkdevicemap=/boot/grub/device.map /dev/${LOOPRAW_DEVICE}
        # Run grub from the host, pointing to the guest installation
        #grub-install --no-floppy --modules=part_msdos --grub-mkdevicemap=${MOUNT_DIR}/boot/grub/device.map --root-directory=${MOUNT_DIR} /dev/${LOOPRAW_DEVICE}
        umount ${MOUNT_DIR}/sys