From f37ea2e5e179794c60c7925ed0867b8ffd07de41 Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Mon, 25 Nov 2024 13:47:35 -0600 Subject: [PATCH] On grub cfg updates, run grub2-mkconfig for Xen systems Resolves: #RHEL-50691 Signed-off-by: Leo Sandoval --- grubby-bls | 9 +++++++++ grubby.spec | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/grubby-bls b/grubby-bls index fef62db..a67cf31 100755 --- a/grubby-bls +++ b/grubby-bls @@ -620,6 +620,15 @@ update_grubcfg() fi fi + # 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 grub2-mkconfig has to run 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 + fi + fi + if [[ $RUN_MKCONFIG = "true" ]]; then grub2-mkconfig --no-grubenv-update -o "${grub_config}" >& /dev/null fi diff --git a/grubby.spec b/grubby.spec index 658ec91..edd2ffd 100644 --- a/grubby.spec +++ b/grubby.spec @@ -1,6 +1,6 @@ Name: grubby Version: 8.40 -Release: 64%{?dist} +Release: 65%{?dist} Summary: Command line tool for updating bootloader configs License: GPLv2+ URL: https://github.com/rhinstaller/grubby @@ -131,6 +131,10 @@ current boot environment. %{_mandir}/man8/*.8* %changelog +* Thu Dec 05 2024 Leo Sandoval - 8.40-65 +- On grub cfg updates, run grub2-mkconfig for Xen systems + Resolves: #RHEL-50691 + * Wed Jan 10 2024 Marta Lewandowska - 8.40-64 - Do not overwrite all vars that start with GRUB_CMDLINE_LINUX - Resolves: #RHEL-21301