From 61e80385391de00c59c759250b2fa387d94309ff Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Tue, 2 Jul 2024 13:54:10 +0200 Subject: [PATCH] 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 --- 99-grub-mkconfig.install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/99-grub-mkconfig.install b/99-grub-mkconfig.install index d9686b5..1411f6a 100755 --- a/99-grub-mkconfig.install +++ b/99-grub-mkconfig.install @@ -8,8 +8,10 @@ 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 - RUN_MKCONFIG=true - DISABLE_BLS=true + 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)