mirror of
https://src.fedoraproject.org/rpms/grub2.git
synced 2024-11-28 07:44:52 +00:00
99-grub-mkconfig: Disable BLS usage for Xen machines
PV and PVH Xen DomU guests boot with pygrub that doesn't have BLS support. Also Xen Dom0 use the menuentries from 20_linux_xen and not the ones from 10_linux. So BLS support needs to be disabled for both Xen Dom0 and DomU and use a traditional grub.cfg file generated by the grub2-mkconfig tool. Resolves: rhbz#1703700 Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Tested-by: Steven Haigh <netwiz@crc.id.au>
This commit is contained in:
parent
7ea6052755
commit
897e388763
1 changed files with 23 additions and 3 deletions
|
@ -4,10 +4,30 @@ if ! [[ $KERNEL_INSTALL_MACHINE_ID ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ARCH=$(uname -m)
|
# PV and PVH Xen DomU guests boot with pygrub that doesn't have BLS support,
|
||||||
|
# also Xen Dom0 use the menuentries from 20_linux_xen and not the ones from
|
||||||
|
# 10_linux. So BLS support needs to be disabled for both Xen Dom0 and DomU.
|
||||||
|
if [[ -e /sys/hypervisor/type ]] && grep -q "^xen$" /sys/hypervisor/type; then
|
||||||
|
RUN_MKCONFIG=true
|
||||||
|
DISABLE_BLS=true
|
||||||
|
fi
|
||||||
|
|
||||||
# Is only needed for ppc64* since we can't assume a BLS capable bootloader there
|
ARCH=$(uname -m)
|
||||||
if [[ $ARCH != "ppc64" && $ARCH != "ppc64le" ]]; then
|
# Older ppc64le OPAL firmware don't have BLS support so grub2-mkconfig has to
|
||||||
|
# be run to generate a GRUB config file that contains menuentry commands.
|
||||||
|
if [[ $ARCH = "ppc64le" ]]; then
|
||||||
|
RUN_MKCONFIG=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $DISABLE_BLS = "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
|
||||||
|
|
||||||
|
# A traditional grub configuration file needs to be generated only in the case when
|
||||||
|
# the bootloaders are not capable of populating a menu entry from the BLS fragments.
|
||||||
|
if [[ $RUN_MKCONFIG != "true" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue