Compare commits

..

1 commit

Author SHA1 Message Date
Simon de Vlieger
482a2825c4
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]: a8fafe8d9b/data/distrodefs/fedora/imagetypes.yaml (L1027-L1028)

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
2025-12-10 07:59:31 +01:00
2 changed files with 15 additions and 1 deletions

View file

@ -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 <cmdr@supakeen.com> - 8.40-86
- Own `/etc/sysconfig/kernel` which is used for `grubby` configuration
* Wed Jul 30 2025 Leo Sandoval <lsandova@redhat.com> - 8.40-85
- Update cfg when setting a default kernel

6
kernel.sysconfig Normal file
View file

@ -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