From 9fe12cf22212ddf6572d680e2e07af63defb29f1 Mon Sep 17 00:00:00 2001 From: Dan Streetman Date: Thu, 28 May 2026 13:50:40 -0400 Subject: [PATCH] feat(grubby): provide the /etc/sysconfig/kernel file This file has a setting, UPDATEDEFAULT=, which is used by the kernel-install (aka installkernel) program to determine if the default kernel should be updated to use the newly installed kernel. This sets UPDATEDEFAULT=yes, so a newly installed kernel will be set as the default kernel (on the next boot); without this, the default kernel will remain set to the current kernel. Taken from upstream: https://src.fedoraproject.org/rpms/grubby/c/482a2825c47c4fd28a18beb279a3e826461bf878 Fixes: AB#20392 --- base/comps/components.toml | 1 - base/comps/grubby/grubby.comp.toml | 30 ++++++++++++++++++++++++++++++ base/comps/grubby/kernel.sysconfig | 6 ++++++ locks/grubby.lock | 2 +- specs/g/grubby/grubby.spec | 6 +++++- specs/g/grubby/kernel.sysconfig | 6 ++++++ 6 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 base/comps/grubby/grubby.comp.toml create mode 100644 base/comps/grubby/kernel.sysconfig create mode 100644 specs/g/grubby/kernel.sysconfig diff --git a/base/comps/components.toml b/base/comps/components.toml index e460cc32019..a9f322d1324 100644 --- a/base/comps/components.toml +++ b/base/comps/components.toml @@ -1107,7 +1107,6 @@ includes = ["**/*.comp.toml", "component-check-disablement.toml", "component-min [components.grep] [components.groff] [components.grpc] -[components.grubby] [components.gsettings-desktop-schemas] [components.gsl] [components.gsm] diff --git a/base/comps/grubby/grubby.comp.toml b/base/comps/grubby/grubby.comp.toml new file mode 100644 index 00000000000..8b4d5957e81 --- /dev/null +++ b/base/comps/grubby/grubby.comp.toml @@ -0,0 +1,30 @@ +[components.grubby] + +[[components.grubby.overlays]] +description = "Provide /etc/sysconfig/kernel file" +type = "file-add" +file = "kernel.sysconfig" +source = "kernel.sysconfig" + +[[components.grubby.overlays]] +description = "Provide /etc/sysconfig/kernel file" +type = "spec-add-tag" +tag = "Source999" +value = "kernel.sysconfig" + +[[components.grubby.overlays]] +description = "Provide /etc/sysconfig/kernel file" +type = "spec-append-lines" +section = "%install" +lines = [ + "mkdir -p %{buildroot}%{_sysconfdir}/sysconfig", + "install -m 0644 %{SOURCE999} %{buildroot}%{_sysconfdir}/sysconfig/kernel", +] + +[[components.grubby.overlays]] +description = "Provide /etc/sysconfig/kernel file" +type = "spec-append-lines" +section = "%files" +lines = [ + "%config(noreplace) %{_sysconfdir}/sysconfig/kernel", +] diff --git a/base/comps/grubby/kernel.sysconfig b/base/comps/grubby/kernel.sysconfig new file mode 100644 index 00000000000..8da19709dc0 --- /dev/null +++ b/base/comps/grubby/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 diff --git a/locks/grubby.lock b/locks/grubby.lock index bd649b7a44c..6786e068048 100644 --- a/locks/grubby.lock +++ b/locks/grubby.lock @@ -2,5 +2,5 @@ version = 1 import-commit = '6095bc576b3aa216400f1cc133ade107d4830ea7' upstream-commit = '6095bc576b3aa216400f1cc133ade107d4830ea7' -input-fingerprint = 'sha256:b671086c622372cdbe19f56c5b93a8cf2e9c9011cda4ef5ca095be17b87fd3d1' +input-fingerprint = 'sha256:4e4d6eadfa7a610b2590ae529250234d165b48bfbaa2ad7d4d1d2627a82b78f6' resolution-input-hash = 'sha256:466421704711c4fd3c71f0b2ed715a0e61d49e3e26f3a2637fee755795849c8e' diff --git a/specs/g/grubby/grubby.spec b/specs/g/grubby/grubby.spec index 87c0a32628a..52d8b66c104 100644 --- a/specs/g/grubby/grubby.spec +++ b/specs/g/grubby/grubby.spec @@ -6,7 +6,7 @@ Name: grubby Version: 8.40 -Release: 86%{?dist} +Release: 87%{?dist} Summary: Command line tool for updating bootloader configs License: GPL-2.0-or-later Source1: grubby-bls @@ -40,6 +40,7 @@ Conflicts: uboot-tools < 2021.01-0.1.rc2 Obsoletes: %{name}-bls < %{version}-%{release} Obsoletes: %{name}-deprecated < %{version}-%{release} +Source999: kernel.sysconfig %description This package provides a grubby compatibility script that manages BootLoaderSpec files and is meant to be backward compatible with @@ -62,6 +63,8 @@ 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 %{SOURCE999} %{buildroot}%{_sysconfdir}/sysconfig/kernel %post if [ "$1" = 2 ]; then arch=$(uname -m) @@ -76,6 +79,7 @@ fi %attr(0755,root,root) %{_prefix}/lib/kernel/install.d/95-kernel-hooks.install %{_mandir}/man8/grubby.8* +%config(noreplace) %{_sysconfdir}/sysconfig/kernel %changelog * Wed Jul 30 2025 Leo Sandoval - 8.40-85 - Update cfg when setting a default kernel diff --git a/specs/g/grubby/kernel.sysconfig b/specs/g/grubby/kernel.sysconfig new file mode 100644 index 00000000000..8da19709dc0 --- /dev/null +++ b/specs/g/grubby/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