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,8 +8,10 @@ fi
# also Xen Dom0 use the menuentries from 20_linux_xen and not the ones from # 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. # 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/type ]] && grep -q "^xen$" /sys/hypervisor/type; then
RUN_MKCONFIG=true if [ ! -e /sys/hypervisor/guest_type ] || ! grep -q "^HVM$" /sys/hypervisor/guest_type; then
DISABLE_BLS=true RUN_MKCONFIG=true
DISABLE_BLS=true
fi
fi fi
ARCH=$(uname -m) ARCH=$(uname -m)