From a73ecd5815d180cfd6a8adce7e23cf652462fa70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Fri, 1 Dec 2023 08:13:01 +0000 Subject: [PATCH 01/17] Migrate to SPDX license This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2 --- grubby.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grubby.spec b/grubby.spec index af0bbdc..a82fe14 100644 --- a/grubby.spec +++ b/grubby.spec @@ -5,7 +5,7 @@ Name: grubby Version: 8.40 Release: 72%{?dist} Summary: Command line tool for updating bootloader configs -License: GPLv2+ +License: GPL-2.0-or-later Source1: grubby-bls # Source2: rpm-sort.c Source3: COPYING From 893f94f4284445d5337ccd7c08aa265ef9d09f86 Mon Sep 17 00:00:00 2001 From: Marta Lewandowska Date: Wed, 10 Jan 2024 16:40:47 +0200 Subject: [PATCH 02/17] Don't overwrite vars that start with GRUB_CMDLINE_LINUX When updating args for ALL kernels, grubby clobbers all variables in /etc/default/grub that start with GRUB_CMDLINE_LINUX and renders that line multiple times, for each variable that exists. This breaks using recovery mode. Fix so this doesn't happen anymore. Signed-off-by: Marta Lewandowska --- grubby-bls | 2 +- grubby.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/grubby-bls b/grubby-bls index 2d59de7..ac82950 100755 --- a/grubby-bls +++ b/grubby-bls @@ -500,7 +500,7 @@ update_bls_fragment() { if [[ -n $old_args ]]; then opts="$(update_args "${old_args}" "${remove_args}" "${add_args}")" opts="$(echo "$opts" | sed -e 's/\//\\\//g')" - sed -i -e "s/^GRUB_CMDLINE_LINUX.*/GRUB_CMDLINE_LINUX=\\\"${opts}\\\"/" "${grub_etc_default}" + sed -i -e "s/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\\\"${opts}\\\"/" "${grub_etc_default}" fi fi diff --git a/grubby.spec b/grubby.spec index a82fe14..f4bac16 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 72%{?dist} +Release: 73%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Wed Jan 10 2024 Marta Lewandowska - 8.40-73 +- Do not overwrite all vars that start with GRUB_CMDLINE_LINUX + * Mon Sep 11 2023 Zbigniew Jedrzejewski-Szmek - 8.40-72 - Drop installkernel so that it can be provided by systemd From 5318daa5c6383c3927ef85c81d28b3dfb0fdecd9 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jan 2024 21:34:21 +0000 Subject: [PATCH 03/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- grubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grubby.spec b/grubby.spec index f4bac16..a1c39e0 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 73%{?dist} +Release: 74%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Sat Jan 20 2024 Fedora Release Engineering - 8.40-74 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Wed Jan 10 2024 Marta Lewandowska - 8.40-73 - Do not overwrite all vars that start with GRUB_CMDLINE_LINUX From 758f62e580bc1732088a3a1ceb2847312ab020c4 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Wed, 24 Jan 2024 21:05:49 +0000 Subject: [PATCH 04/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- grubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grubby.spec b/grubby.spec index a1c39e0..421a493 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 74%{?dist} +Release: 75%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Wed Jan 24 2024 Fedora Release Engineering - 8.40-75 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sat Jan 20 2024 Fedora Release Engineering - 8.40-74 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 197adec183a9b0c645c99384c69346efc84cf1fe Mon Sep 17 00:00:00 2001 From: Emanuele Petriglia Date: Wed, 10 Apr 2024 14:38:27 +0000 Subject: [PATCH 05/17] Fix small typo in --args help message --- grubby-bls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grubby-bls b/grubby-bls index ac82950..1182a4a 100755 --- a/grubby-bls +++ b/grubby-bls @@ -630,7 +630,7 @@ print_usage() cat < Date: Thu, 18 Jul 2024 08:39:45 +0000 Subject: [PATCH 06/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- grubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grubby.spec b/grubby.spec index 421a493..8478d3e 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 75%{?dist} +Release: 76%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 8.40-76 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Wed Jan 24 2024 Fedora Release Engineering - 8.40-75 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 014744456dc40ad11344facea8b575cbcdb039ea Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Mon, 25 Nov 2024 13:47:35 -0600 Subject: [PATCH 07/17] On grub cfg updates, run grub2-mkconfig for Xen systems Signed-off-by: Leo Sandoval --- grubby-bls | 9 +++++++++ grubby.spec | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/grubby-bls b/grubby-bls index 1182a4a..c7cb264 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 8478d3e..5ee8ddc 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,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Mon Nov 25 2024 Leo Sandoval - 8.40-77 +- On grub cfg updates, run grub2-mkconfig for Xen systems + * Thu Jul 18 2024 Fedora Release Engineering - 8.40-76 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From a94c545ae243d8050eec603e6df38c84e2f5f5ca Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Thu, 21 Mar 2024 17:09:57 +0200 Subject: [PATCH 08/17] Add riscv64 support Signed-off-by: David Abdurachmanov --- 10-devicetree.install | 2 +- grubby.spec | 7 +++++-- 2 files changed, 6 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 5ee8ddc..63b5b6f 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 @@ -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,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Mon Dec 02 2024 David Abdurachmanov - 8.40-78 +- Add riscv64 support + * Mon Nov 25 2024 Leo Sandoval - 8.40-77 - On grub cfg updates, run grub2-mkconfig for Xen systems From 410b6c7592b831b18d5b2e18ccd28422c309c539 Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Mon, 25 Nov 2024 13:07:52 -0600 Subject: [PATCH 09/17] grubby-bls: in s390* systems, run zipl on grub cfg update event Signed-off-by: Leo Sandoval --- grubby-bls | 6 +++++- grubby.spec | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/grubby-bls b/grubby-bls index c7cb264..8d26a06 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 63b5b6f..bf11b1c 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,9 @@ 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 + * Mon Dec 02 2024 David Abdurachmanov - 8.40-78 - Add riscv64 support From 6f82f6bf089e69d8ab59531766de0a79a4a21319 Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Tue, 3 Dec 2024 17:54:14 -0600 Subject: [PATCH 10/17] grubby-bls: on PPC systems, remove petiboot's version checks Signed-off-by: Leo Sandoval --- grubby-bls | 23 ++--------------------- grubby.spec | 5 ++++- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/grubby-bls b/grubby-bls index 8d26a06..8fbaa27 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 bf11b1c..dab4aa7 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,9 @@ 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 + * Fri Dec 06 2024 Leo Sandoval - 8.40-79 - grubby-bls: in s390* systems, run zipl on grub cfg update event From 50760fed68aefd7a29bfc818a7dc8bf2168e3539 Mon Sep 17 00:00:00 2001 From: Martin Hicks Date: Wed, 24 Jul 2024 12:00:45 -0400 Subject: [PATCH 11/17] Allow custom filenames to exceed 10 9 sorts after 10, so "next" was always 10 and would overwrite previous 10~custom.conf files Signed-off-by: Martin Hicks --- grubby-bls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grubby-bls b/grubby-bls index 8fbaa27..526cf6c 100755 --- a/grubby-bls +++ b/grubby-bls @@ -356,7 +356,7 @@ get_custom_bls_filename() { prefix="${bls_target%%${arch}}" prefix="${prefix%.*}" - last=($(for bls in ${prefix}.*~custom*.conf ; do + last=($(for bls in $(ls ${prefix}.*~custom*.conf 2>/dev/null | sort -V); do if ! [[ -e "${bls}" ]] ; then continue fi From beb5f2b8a8856c22ef76566eea54c7bb0b3721cf Mon Sep 17 00:00:00 2001 From: Martin Hicks Date: Fri, 26 Jul 2024 08:22:44 -0400 Subject: [PATCH 12/17] Add 'custom' file entries at first gap Don't add a the next custom file after the last existing entry. This could result in a growing custom number with a large gap at the beginning. Fill the custom entries starting from 0. Signed-off-by: Martin Hicks Signed-off-by: Nicolas Frayer --- grubby-bls | 30 +++++++++++++++++------------- grubby.spec | 5 ++++- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/grubby-bls b/grubby-bls index 526cf6c..2785583 100755 --- a/grubby-bls +++ b/grubby-bls @@ -356,22 +356,26 @@ get_custom_bls_filename() { prefix="${bls_target%%${arch}}" prefix="${prefix%.*}" - last=($(for bls in $(ls ${prefix}.*~custom*.conf 2>/dev/null | sort -V); do - if ! [[ -e "${bls}" ]] ; then - continue - fi - bls="${bls##${prefix}.}" - bls="${bls%%~custom*}" - echo "${bls}" - done | tail -n1)) || : + first_gap=$( + first=0 + for bls_entry in $(ls "${prefix}".*~custom*.conf 2>/dev/null | sort -V); do + if [[ -e ${bls_entry} ]]; then + bls_entry="${bls_entry##"${prefix}".}" + bls_entry="${bls_entry%%~custom*}" + if [[ "${bls_entry}" = "${first}" ]]; then + first=$((first+1)) + else + break + fi + fi + done + echo "${first}") || : - if [[ -z $last ]]; then - last="0" - else - last=$((last+1)) + if [[ -z "$first_gap" ]]; then + first_gap="0" fi - echo "${bls_target}" | sed -e "s!${prefix}!${prefix}.${last}~custom!" + echo "${bls_target}" | sed -e "s!${prefix}!${prefix}.${first_gap}~custom!" } add_bls_fragment() { diff --git a/grubby.spec b/grubby.spec index dab4aa7..d7efabe 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,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Mon Jan 06 2025 Nicolas Frayer - 8.40-81 +- Fixups to custom kernel targets + * Fri Dec 06 2024 Leo Sandoval - 8.40-80 - grubby-bls: on PPC systems, remove petiboot's version checks From 06113ecc4c8825b2b4788514f51b9f39afb3fbbf Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 05:15:43 +0000 Subject: [PATCH 13/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- grubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grubby.spec b/grubby.spec index d7efabe..9813791 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 @@ -74,6 +74,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 8.40-82 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Mon Jan 06 2025 Nicolas Frayer - 8.40-81 - Fixups to custom kernel targets From 7d63bffff90403fdb8e33c0a30562e0d73cafeeb Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Thu, 20 Mar 2025 11:28:33 -0600 Subject: [PATCH 14/17] 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. Signed-off-by: Leo Sandoval --- grubby-bls | 20 +++++++++++--------- grubby.spec | 6 +++++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/grubby-bls b/grubby-bls index 2785583..555fd13 100755 --- a/grubby-bls +++ b/grubby-bls @@ -599,17 +599,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 9813791..1ffa529 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 +* Thu Mar 20 2025 Leo Sandoval - 8.40-83 +- 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 + * Fri Jan 17 2025 Fedora Release Engineering - 8.40-82 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 0eb1bed0a54ae1c41514e636f4016560cd355cdf Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 16:39:20 +0000 Subject: [PATCH 15/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- grubby.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grubby.spec b/grubby.spec index 1ffa529..6abb3ed 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 83%{?dist} +Release: 84%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 8.40-84 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu Mar 20 2025 Leo Sandoval - 8.40-83 - 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 6095bc576b3aa216400f1cc133ade107d4830ea7 Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Wed, 30 Jul 2025 12:16:29 -0600 Subject: [PATCH 16/17] Update cfg when setting a default kernel Signed-off-by: Raju Cheerla Signed-off-by: Leo Sandoval --- grubby-bls | 2 +- grubby.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/grubby-bls b/grubby-bls index 555fd13..11b69b1 100755 --- a/grubby-bls +++ b/grubby-bls @@ -567,7 +567,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 6abb3ed..a7ec5c4 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 84%{?dist} +Release: 85%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -74,6 +74,9 @@ fi %{_mandir}/man8/grubby.8* %changelog +* Wed Jul 30 2025 Leo Sandoval - 8.40-85 +- Update cfg when setting a default kernel + * Thu Jul 24 2025 Fedora Release Engineering - 8.40-84 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 482a2825c47c4fd28a18beb279a3e826461bf878 Mon Sep 17 00:00:00 2001 From: Simon de Vlieger Date: Wed, 10 Dec 2025 07:50:55 +0100 Subject: [PATCH 17/17] spec: own `/etc/sysconfig/kernel` `grubby` reads the `/etc/sysconfig/kernel` file which isn't owned by the package, nor created by it. This leads to all image build tooling having to take special care to write this file [1] [2] so produced deliverables automatically update their kernels. This commit moves the creation of this file to the `grubby` package so things work 'out of the box' instead of needing to do out-of-package configuration by third parties. [1]: https://pagure.io/fedora-kiwi-descriptions/blob/f43/f/root/etc/sysconfig [2]: https://github.com/osbuild/images/blob/a8fafe8d9b9f7fa0d4e7316b15452acd63c6941d/data/distrodefs/fedora/imagetypes.yaml#L1027-L1028 Signed-off-by: Simon de Vlieger --- grubby.spec | 10 +++++++++- kernel.sysconfig | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 kernel.sysconfig diff --git a/grubby.spec b/grubby.spec index a7ec5c4..87b8787 100644 --- a/grubby.spec +++ b/grubby.spec @@ -3,7 +3,7 @@ Name: grubby Version: 8.40 -Release: 85%{?dist} +Release: 86%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -12,6 +12,7 @@ Source3: COPYING Source5: 95-kernel-hooks.install Source6: 10-devicetree.install Source7: grubby.8 +Source8: kernel.sysconfig BuildRequires: gcc BuildRequires: glib2-devel @@ -59,6 +60,9 @@ install -D -m 0755 -t %{buildroot}%{_prefix}/lib/kernel/install.d/ %{SOURCE6} mkdir -p %{buildroot}%{_mandir}/man8 install -m 0644 %{SOURCE7} %{buildroot}%{_mandir}/man8/ +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +install -m 0644 %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/kernel + %post if [ "$1" = 2 ]; then arch=$(uname -m) @@ -72,8 +76,12 @@ fi %attr(0755,root,root) %{_prefix}/lib/kernel/install.d/10-devicetree.install %attr(0755,root,root) %{_prefix}/lib/kernel/install.d/95-kernel-hooks.install %{_mandir}/man8/grubby.8* +%config(noreplace) %{_sysconfdir}/sysconfig/kernel %changelog +* Wed Dec 10 2025 Simon de Vlieger - 8.40-86 +- Own `/etc/sysconfig/kernel` which is used for `grubby` configuration + * Wed Jul 30 2025 Leo Sandoval - 8.40-85 - Update cfg when setting a default kernel diff --git a/kernel.sysconfig b/kernel.sysconfig new file mode 100644 index 0000000..8da1970 --- /dev/null +++ b/kernel.sysconfig @@ -0,0 +1,6 @@ +# UPDATEDEFAULT specifies if kernel-install should make +# new kernels the default +UPDATEDEFAULT=yes + +# DEFAULTKERNEL specifies the default kernel package type +DEFAULTKERNEL=kernel-core