Commit graph

232 commits

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
Leo Sandoval
6095bc576b Update cfg when setting a default kernel
Signed-off-by: Raju Cheerla <rcheerla@redhat.com>
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
2025-07-30 12:16:29 -06:00
Fedora Release Engineering
0eb1bed0a5 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-24 16:39:20 +00:00
Leo Sandoval
7d63bffff9 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 <lsandova@redhat.com>
2025-03-20 11:28:33 -06:00
Fedora Release Engineering
06113ecc4c Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-17 05:15:43 +00:00
Martin Hicks
beb5f2b8a8 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 <martin@sr-research.com>
Signed-off-by: Nicolas Frayer <nfrayer@redhat.com>
2025-01-06 11:00:58 +01:00
Martin Hicks
50760fed68 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 <martin@sr-research.com>
2025-01-06 09:47:28 +00:00
Leo Sandoval
6f82f6bf08 grubby-bls: on PPC systems, remove petiboot's version checks
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
2024-12-06 12:15:22 -06:00
Leo Sandoval
410b6c7592 grubby-bls: in s390* systems, run zipl on grub cfg update event
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
2024-12-06 12:05:42 -06:00
David Abdurachmanov
a94c545ae2 Add riscv64 support
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2024-12-02 14:01:33 +01:00
Leo Sandoval
014744456d On grub cfg updates, run grub2-mkconfig for Xen systems
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
2024-11-25 14:15:44 -06:00
Fedora Release Engineering
fbdec79a3e Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-18 08:39:45 +00:00
Emanuele Petriglia
197adec183 Fix small typo in --args help message 2024-04-10 14:38:27 +00:00
Fedora Release Engineering
758f62e580 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-24 21:05:49 +00:00
Fedora Release Engineering
5318daa5c6 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-20 21:34:21 +00:00
Marta Lewandowska
893f94f428 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 <mlewando@redhat.com>
2024-01-11 09:40:17 +01:00
Miroslav Suchý
a73ecd5815 Migrate to SPDX license
This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_2
2023-12-01 08:13:01 +00:00
Zbigniew Jędrzejewski-Szmek
aa9b1b454f Drop installkernel so that it can by provided by systemd
systemd has kernel-install which supports being invoked as installkernel.
After the file is removed from grubby, we can just provide a symlink
installkernel → kernel-install.
2023-09-11 13:14:30 +02:00
Fedora Release Engineering
3d050aaf49 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-20 05:39:58 +00:00
Marta Lewandowska
8656bfd565 Do not set root with not copying default 2023-02-21 19:10:32 -05:00
Fedora Release Engineering
d696710922 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-19 11:35:50 +00:00
Robbie Harwood
68f872a10e Drop custom rpm-sort
See-also: https://github.com/rpm-software-management/rpm/pull/2249
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-11-01 13:58:51 -04:00
Robbie Harwood
9f3764d8d2 Apply Marta's copy-default args fix
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-10-04 17:16:29 +00:00
Marta Lewandowska
2f6207731e Fix passing --args without copy-default
Fix so that --args are not passed by default if copy-default is not used.
Set root when --args are passed without copy-default.
2022-10-04 13:08:06 +00:00
Robbie Harwood
0da23ad751 Give up and just pull the config from BLS
Suggested-by: Bojan Smojver <bojan@rexursive.com>
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-08-22 21:47:49 +00:00
Robbie Harwood
74ff4810be Mark package as obsoleting -deprecated
Resolves: #2117817
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-08-17 15:17:48 +00:00
Robbie Harwood
1faea2de0a Handle updating /etc/kernel/cmdline
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-08-02 18:00:16 -04:00
Fedora Release Engineering
c8241463d7 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-21 13:06:10 +00:00
Robbie Harwood
29fb24f205 Clarify that grub files aren't used on s390x in man page
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-07-19 19:26:03 +00:00
Robbie Harwood
810b5eee5a Update spec file for previous change
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-06-22 14:43:48 -04:00
Robbie Harwood
78927fa5ed Revert "Additionally write to /etc/kernel/cmdline"
This reverts commit 599a2e1a99.

Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-06-22 14:43:02 -04:00
Robbie Harwood
599a2e1a99 Additionally write to /etc/kernel/cmdline
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-05-31 17:23:49 +00:00
Robbie Harwood
79765ad0d7 Stop building on ia32
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-04-27 13:13:57 -04:00
Robbie Harwood
aaefddefe8 rpm-sort: fix missing include and sort
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-04-27 13:08:31 -04:00
Robbie Harwood
415ad451de Remove upstream and layers of indirection around -bls
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-04-27 13:08:25 -04:00
Robbie Harwood
1bc3038166 Add missing changelog (Remove grubby-deprecated)
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-03-15 16:06:36 -04:00
Robbie Harwood
59ba93105a grubby-bls: wire up -h (help)
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
2022-03-10 20:40:02 +00:00
Robbie Harwood
dfdd26c908 grubby-bls: wire up -h (help)
Originally authored by Lukas Herbolt.
2022-02-07 16:42:57 -05:00
Fedora Release Engineering
0dd1a4fc40 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-20 11:50:18 +00:00
Fedora Release Engineering
eaef784cc6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-22 07:09:11 +00:00
Javier Martinez Canillas
e69860d718
Man page and package description fixes
Clarify package description
  Resolves: rhbz#1913299
Update man page to not mention the GRUB config in the ESP anymore
  Resolves: rhbz#1958458

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2021-06-23 10:21:14 +02:00
Javier Martinez Canillas
9ebc469d54
Update man page to not mention the GRUB config in the ESP anymore
After https://fedoraproject.org/wiki/Changes/UnifyGrubConfig the config in
ESP is only used as a stub to load the actual GRUB config the in /boot dir.

Don't mention this file in the grubby man page, since users shouldn't even
be aware of that config file.

Resolves: rhbz#1958458

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2021-06-23 08:22:58 +02:00
Javier Martinez Canillas
e94425201f
Clarify package description
The grubby script was meant to be a temporary solution to provide backward
compatibility with existing grubby users. But it turned out that grubby is
the recommended approach to modify the boot loader entries.

Let's make clear in the package description that this is not only meant to
be used for legacy compatibility purposes, which may discourage its usage.

Resolves: rhbz#1913299

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2021-06-23 07:56:49 +02:00
Javier Martinez Canillas
2b59d1355d
grubby-bls: expand only the kernelopts variable
The BLS snippets have the options field set to a kernelopts variable by
default, which is set in GRUB's environemnt block to the kernel cmdline.

When the kernel command line parameters are modified for all the entries,
the value of this kernelopts variable is modified. But if the cmdline is
modified for a single entry, then the kernelopts variable is expanded and
the resulted modified value stored in the BLS snippet.

The grubby tool expanded all the variables in the options field, but it's
possible that some of these variables are managed by another tool. For
example the tuned program adds a tuned variable that shouldn't be changed
by the grubby tool. Otherwise it will mangle the tuned configuration set.

To prevent this, let's make grubby to only expand the kernelopts variable.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2021-06-09 23:40:23 +02:00
Javier Martinez Canillas
5d3963841d
grubby-bs: Fix changing kernel cmdline params not working on ppc64le
Currently the grubby script re-generates a GRUB config file that contains
menuentry commands for every /boot/loader/entries/*.conf file snippet.

But this is only needed for ppc64le machines that have a Petitboot version
that doesn't support parsing BLS snippets. Instead of generating a config
on any ppc64le machine, restrict this for the case where is really needed.

The /etc/grub.d/10_linux script already takes this into account and does
not add menuentry commands unless is needed. But the grubby script didn't
check this, causing changing kernel cmdline params to not work on ppc64le.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2021-04-26 18:46:31 +02:00
Fedora Release Engineering
786a133370 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-26 13:00:54 +00:00
Tom Stellard
fd57e031d4
Use make_build macro instead of plain make
This will make it possible for buildroots to inject arguments to
make by redefining the %__make macro.
2020-12-30 17:27:35 +01:00
Peter Robinson
536f42db1c Add device tree kernel install option, minor cleanups 2020-11-24 10:44:12 +00:00
Josh Boyer
b91640a743 Only require s390utils-core
zipl appears to be the only thing grubby needs, and that is provided by s390utils-core.  Change the Requires to that, which allows for a more minimal installation.
2020-10-26 16:13:44 -04:00
Josh Boyer
3498276978 Only require s390utils-core
zipl appears to be the only thing grubby needs, and that is provided by s390utils-core.  Change the Requires to that, which allows for a more minimal installation.
2020-10-24 12:33:50 +00:00