99-grub-mkconfig: Avoid disabling BLS usage for Xen HVM VMs

Xen PV and PVH guest use direct kernel boot and may use 'pygrub' tool to
parse guest's grub config. The tool is incompatible with BLS and thus
99-grub-mkconfig.install disables it. The problem is observed with HVM
guests which are 'normal' VMs and don't require pygrub compatibility. E.g.
legacy AWS instance types are of this kind. Disabling BLS for them is
undesired and unjustified. Luckily, kernel driver for Xen provides
'/sys/hypervisor/guest_type' interface telling us which type of guest are
we running in.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
This commit is contained in:
Vitaly Kuznetsov 2024-07-02 13:54:10 +02:00
parent d4811852b4
commit 28040b73c9

View file

@ -8,9 +8,11 @@ fi
# 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
if [ ! -e /sys/hypervisor/guest_type ] || ! grep -q "^HVM$" /sys/hypervisor/guest_type; then
RUN_MKCONFIG=true
DISABLE_BLS=true
fi
fi
ARCH=$(uname -m)
# Older ppc64le OPAL firmware (petitboot version < 1.8.0) don't have BLS support