From b8a47ad3db7a29ba662937b19e1235d56de50854 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Tue, 29 Oct 2024 08:28:59 -0700 Subject: [PATCH 1/7] Bump release for October 2024 mass rebuild: Resolves: RHEL-64018 --- grubby.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grubby.spec b/grubby.spec index 130a86f..f988fc9 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 76%{?dist} +Release: 77%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,10 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Tue Oct 29 2024 Troy Dawson - 8.40-77 +- Bump release for October 2024 mass rebuild: + Resolves: RHEL-64018 + * Mon Jun 24 2024 Troy Dawson - 8.40-76 - Bump release for June 2024 mass rebuild From e4d631d56e3302db5b0c41ca539b90028d8520fe Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Mon, 25 Nov 2024 13:47:35 -0600 Subject: [PATCH 2/7] On grub cfg updates, run grub2-mkconfig for Xen systems Resolves: #RHEL-70200 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 ac82950..f2a6bab 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 f988fc9..7539a0b 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 77%{?dist} +Release: 78%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,10 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Thu Dec 05 2024 Leo Sandoval - 8.40-78 +- On grub cfg updates, run grub2-mkconfig for Xen systems + Resolves: #RHEL-70200 + * Tue Oct 29 2024 Troy Dawson - 8.40-77 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018 From 855ff97323d3e8dcd59888f1ccbff9d712cec856 Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Mon, 25 Nov 2024 13:07:52 -0600 Subject: [PATCH 3/7] grubby-bls: in s390* systems, run zipl on grub cfg update event Resolves: #RHEL-36092 Signed-off-by: Leo Sandoval --- grubby-bls | 6 +++++- grubby.spec | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/grubby-bls b/grubby-bls index f2a6bab..ed50ec3 100755 --- a/grubby-bls +++ b/grubby-bls @@ -630,7 +630,11 @@ update_grubcfg() fi if [[ $RUN_MKCONFIG = "true" ]]; then - grub2-mkconfig --no-grubenv-update -o "${grub_config}" >& /dev/null + if [[ $bootloader = "zipl" ]]; then + zipl + else + grub2-mkconfig --no-grubenv-update -o "${grub_config}" &> /dev/null + fi fi } diff --git a/grubby.spec b/grubby.spec index 7539a0b..7085b59 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 78%{?dist} +Release: 79%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,10 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Fri Dec 06 2024 Leo Sandoval - 8.40-79 +- grubby-bls: in s390* systems, run zipl on grub cfg update event + Resolves: #RHEL-36092 + * Thu Dec 05 2024 Leo Sandoval - 8.40-78 - On grub cfg updates, run grub2-mkconfig for Xen systems Resolves: #RHEL-70200 From b16dacf88a0dadf084c7e2a4d4a6ea981a6aacf2 Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Tue, 3 Dec 2024 17:54:14 -0600 Subject: [PATCH 4/7] grubby-bls: on PPC systems, remove petiboot's version checks Resolves: #RHEL-70194 Signed-off-by: Leo Sandoval --- grubby-bls | 23 ++--------------------- grubby.spec | 6 +++++- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/grubby-bls b/grubby-bls index ed50ec3..0116707 100755 --- a/grubby-bls +++ b/grubby-bls @@ -595,29 +595,10 @@ remove_var_prefix() { update_grubcfg() { - # Older ppc64le OPAL firmware (petitboot version < 1.8.0) don't have BLS support - # so grub2-mkconfig has to be run to generate a config with menuentry commands. + # Older ppc64le OPAL firmware don't have BLS support so grub2-mkconfig has to be run + # to generate a config with menuentry commands. if [ "${arch}" = "ppc64le" ] && [ -d /sys/firmware/opal ]; then RUN_MKCONFIG="true" - petitboot_path="/sys/firmware/devicetree/base/ibm,firmware-versions/petitboot" - - if test -e ${petitboot_path}; then - read -r -d '' petitboot_version < ${petitboot_path} - petitboot_version="$(echo ${petitboot_version//v})" - - if test -n ${petitboot_version}; then - major_version="$(echo ${petitboot_version} | cut -d . -f1)" - minor_version="$(echo ${petitboot_version} | cut -d . -f2)" - - re='^[0-9]+$' - if [[ $major_version =~ $re ]] && [[ $minor_version =~ $re ]] && - ([[ ${major_version} -gt 1 ]] || - [[ ${major_version} -eq 1 && - ${minor_version} -ge 8 ]]); then - RUN_MKCONFIG="false" - fi - fi - fi fi # PV and PVH Xen DomU guests boot with pygrub that doesn't have BLS support, diff --git a/grubby.spec b/grubby.spec index 7085b59..a86ffd3 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 79%{?dist} +Release: 80%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,10 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Fri Dec 06 2024 Leo Sandoval - 8.40-80 +- grubby-bls: on PPC systems, remove petiboot's version checks + Resolves: #RHEL-70194 + * Fri Dec 06 2024 Leo Sandoval - 8.40-79 - grubby-bls: in s390* systems, run zipl on grub cfg update event Resolves: #RHEL-36092 From ec995a48f381bb190ac2dfe4a93b401d0c5532ed Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Thu, 20 Mar 2025 10:19:48 -0600 Subject: [PATCH 5/7] grubby-bls: in s390* systems, run zipl on grub cfg update event Change takes into account s390* systems as target for zipl execution. Reformat better archs/scenarios when either zipl or grub2-mkconfig must be run. Resolves: #RHEL-36092 Signed-off-by: Leo Sandoval --- grubby-bls | 20 +++++++++++--------- grubby.spec | 7 ++++++- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/grubby-bls b/grubby-bls index 0116707..1e8901c 100755 --- a/grubby-bls +++ b/grubby-bls @@ -595,17 +595,19 @@ remove_var_prefix() { update_grubcfg() { - # Older ppc64le OPAL firmware don't have BLS support so grub2-mkconfig has to be run - # to generate a config with menuentry commands. - if [ "${arch}" = "ppc64le" ] && [ -d /sys/firmware/opal ]; then + # Turn on RUN_MKCONFIG on different archs/scenarios + if [[ "${arch}" = 's390' ]] || [[ "${arch}" = 's390x' ]]; then + # On s390/s390x systems, run mkconfig/zipl RUN_MKCONFIG="true" - 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 + elif [[ "${arch}" = "ppc64le" ]] && [[ -d /sys/firmware/opal ]]; then + # Older ppc64le OPAL firmware don't have BLS support so grub2-mkconfig has to be run + # to generate a config with menuentry commands. + RUN_MKCONFIG="true" + elif [[ -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 + # 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. RUN_MKCONFIG=true fi fi diff --git a/grubby.spec b/grubby.spec index a86ffd3..c6e0b42 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 80%{?dist} +Release: 81%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,11 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Thu Mar 20 2025 Leo Sandoval - 8.40-81 +- grubby-bls: in s390* systems, run zipl on grub cfg update event + Fixes previous commit and formats better the conditions that trigger grub cfg updates + Resolves: #RHEL-36092 + * Fri Dec 06 2024 Leo Sandoval - 8.40-80 - grubby-bls: on PPC systems, remove petiboot's version checks Resolves: #RHEL-70194 From 2d21d90d421be4a59bf8607885520425904bc4e5 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 3 Apr 2025 14:51:24 +0200 Subject: [PATCH 6/7] Fix riscv64 build Resolves: RHEL-85989 Signed-off-by: Andrea Bolognani --- 10-devicetree.install | 2 +- grubby.spec | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/10-devicetree.install b/10-devicetree.install index 3345391..fdea5ec 100755 --- a/10-devicetree.install +++ b/10-devicetree.install @@ -2,7 +2,7 @@ # set -x -if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]] +if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 || "$(uname -m)" == riscv64 ]] then COMMAND="$1" KERNEL_VERSION="$2" diff --git a/grubby.spec b/grubby.spec index c6e0b42..63167c8 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 81%{?dist} +Release: 82%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -21,7 +21,7 @@ BuildRequires: pkgconfig BuildRequires: popt-devel BuildRequires: rpm-devel BuildRequires: sed -%ifarch aarch64 x86_64 %{power64} +%ifarch aarch64 x86_64 %{power64} riscv64 BuildRequires: grub2-tools-minimal Requires: grub2-tools-minimal Requires: grub2-tools @@ -74,6 +74,10 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Wed Apr 16 2025 Andrea Bolognani - 8.40-82 +- Fix riscv64 build + Resolves: RHEL-85989 + * Thu Mar 20 2025 Leo Sandoval - 8.40-81 - grubby-bls: in s390* systems, run zipl on grub cfg update event Fixes previous commit and formats better the conditions that trigger grub cfg updates From 4c1f179617f973e163898797a2759b3bc46f8eae Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Wed, 30 Jul 2025 11:17:16 -0600 Subject: [PATCH 7/7] Update cfg when setting a default kernel Resolves:#RHEL-101784 Signed-off-by: Raju Cheerla Signed-off-by: Leo Sandoval --- grubby-bls | 2 +- grubby.spec | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/grubby-bls b/grubby-bls index 1e8901c..aad243d 100755 --- a/grubby-bls +++ b/grubby-bls @@ -563,7 +563,7 @@ set_default_bls() { echo "default=${default}" >> "${zipl_config}" fi fi - + update_grubcfg print_info "The default is ${bls_file[$index]} with index $index and kernel $(get_prefix)${bls_linux[$index]}" } diff --git a/grubby.spec b/grubby.spec index 63167c8..7337daf 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 82%{?dist} +Release: 83%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,10 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Wed Jul 30 2025 Leo Sandoval - 8.40-83 +- Update cfg when setting a default kernel + Resolves:#RHEL-101784 + * Wed Apr 16 2025 Andrea Bolognani - 8.40-82 - Fix riscv64 build Resolves: RHEL-85989