diff --git a/99-grub-mkconfig.install b/99-grub-mkconfig.install index e370899..5c5024c 100755 --- a/99-grub-mkconfig.install +++ b/99-grub-mkconfig.install @@ -4,10 +4,22 @@ if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then exit 0 fi +# A "control_d" string in /proc/xen/capabilities indicates that is a Xen Dom0 host. +[[ -e /sys/hypervisor/type ]] && read HV_TYPE < /sys/hypervisor/type +[[ -e /proc/xen/capabilities ]] && grep -q "control_d" /proc/xen/capabilities && XEN_DOM0=true + +if [[ $HV_TYPE = "xen" && $XEN_DOM0 != "true" ]]; then + if grep -q '^GRUB_ENABLE_BLSCFG="*true"*\s*$' /etc/default/grub; then + sed -i 's/^GRUB_ENABLE_BLSCFG=.*/GRUB_ENABLE_BLSCFG=false/' /etc/default/grub + fi +fi + ARCH=$(uname -m) -# Is only needed for ppc64* since we can't assume a BLS capable bootloader there -if [[ $ARCH != "ppc64" && $ARCH != "ppc64le" ]]; then +# A traditional grub configuration file needs to be generated only for ppc64le and +# Xen DomU guests since we can't assume that bootloaders will be BLS capable there. +if [[ $ARCH != "ppc64" && $ARCH != "ppc64le" ]] || + [[ $HV_TYPE = "xen" && $XEN_DOM0 = "true" ]]; then exit 0 fi diff --git a/grub2.spec b/grub2.spec index bcb3637..2210c39 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 81%{?dist} +Release: 82%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -476,6 +476,10 @@ rm -r /boot/grub2.tmp/ || : %endif %changelog +* Wed Oct 09 2019 Javier Martinez Canillas - 2.02-82 +- 99-grub-mkconfig: Disable BLS usage for Xen DomU guests + Resolves: rhbz#1703700 + * Mon May 20 2019 Javier Martinez Canillas - 2.02-81 - Don't try to switch to a BLS config if GRUB_ENABLE_BLSCFG is already set