From a2cc17ad75c3854250c2e9fa54f4c6be8f83c889 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Fri, 14 Jan 2022 13:55:55 +1300 Subject: [PATCH] Fixes for centos-9-stream efi behaviour This change removes the uninstall grub2-efi which was required for prerelease rhel-9 images but now breaks current centos-9-stream images. A different approach may be required for rhel-9 if the base image remains different to centos-9-stream (such as populating the empty /boot/efi partition from the base image) This change also fixes the detection of whether this is an efi build to check the block device instead of checking for whether a grub efi package is installed. This fixes building a centos-9-stream whole-disk image when package grub2-efi-x64 is installed but a legacy fallback grub also needs to be installed. Change-Id: I24baf553e1acd15a66737fc0b2a79d5335e28aa5 Partial-Bug: #1957789 --- diskimage_builder/elements/bootloader/finalise.d/50-bootloader | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/diskimage_builder/elements/bootloader/finalise.d/50-bootloader b/diskimage_builder/elements/bootloader/finalise.d/50-bootloader index 1a7512e4..406f9250 100755 --- a/diskimage_builder/elements/bootloader/finalise.d/50-bootloader +++ b/diskimage_builder/elements/bootloader/finalise.d/50-bootloader @@ -34,7 +34,6 @@ elif [[ "${DIB_BLOCK_DEVICE}" == "mbr" || "${DIB_BLOCK_DEVICE}" == "gpt" ]]; then install-packages -m bootloader grub-pc elif [[ "${DIB_BLOCK_DEVICE}" == "efi" ]]; then - install-packages -e -m bootloader grub-efi-$ARCH install-packages -m bootloader grub-efi grub-efi-$ARCH else echo "Failure: I'm not sure what bootloader to install" @@ -96,7 +95,7 @@ if [[ ! $GRUB_OPTS == *--target* ]] && [[ $($GRUBNAME --version) =~ ' 2.' ]]; th # http://www.gnu.org/software/grub/manual/grub.html#Installation # if [ -d /sys/firmware/efi ]; then - if [ ! -d /usr/lib/grub/*-efi ]; then + if [[ ${DIB_BLOCK_DEVICE} == "mbr" || ${DIB_BLOCK_DEVICE} == "gpt" ]]; then case $ARCH in "x86_64"|"amd64") GRUB_OPTS="$GRUB_OPTS --target=i386-pc"