Commit Graph

208 Commits

Author SHA1 Message Date
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
Fedora Release Engineering 1ead121a08 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-28 00:24:28 +00:00
Javier Martinez Canillas a5c9c3a138
fix build with rpm-4.16 and correct --extra-initrd option image path
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-06-26 10:16:05 +02:00
Javier Martinez Canillas 12e62c4f0a
grubby-bls: don't replace options with kernelopts if values are the same
If the options field in a BLS file has the same value than the kernelopts
variable in grubenv, the options is replaced with the kernelopts variable.

This was done to keep the options in the BLS files in sync when possible,
but having the kernel cmdline as a variable in the grubenv file was proven
to be fragile. Instead, the kernel cmdline will be stored in the BLS files
to make the configuration more robust. This will work even if the grubenv
gets corrupted or is deleted.

Since we want to get rid of the kernelopts variable, don't attempt to use
that in the BLS snippets anymore.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-05-13 18:44:59 +02:00
Javier Martinez Canillas 770392fcd0
grubby-bls: only attempt to update cmdline if was already set
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-05-07 10:15:39 +02:00
Javier Martinez Canillas 959c481fa9
Fix installed man page file mode bits
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-05-06 16:24:55 +02:00
Javier Martinez Canillas b2ab29059a
grubby-bls: add a --no-etc-grub-update option and a fix for --args
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-05-05 12:23:10 +02:00
Javier Martinez Canillas f24781c87b
grubby-bls: add a --no-etc-grub-update option
The option makes grubby to not update the GRUB_CMDLINE_LINUX variable in
the /etc/default/grub file when the --update-kernel=ALL option is used.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-05-05 12:08:02 +02:00
Javier Martinez Canillas b1eee22db8
grubby-bls: always escape the delimiter character used in sed commands
The forward slash character is used as the delimiter for sed substitutions
so this is escaped before calling sed.

But this was only done before removing parameters from the kernel command
and not when adding it. Use it for all the cases when the parameters are
replaced in the update_args() function.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-05-05 12:03:58 +02:00
Javier Martinez Canillas 1621d288b6
grubby-bls: minor style cleanup
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-04-30 23:08:02 +02:00
Javier Martinez Canillas 670185c682
Update man page to match current grubby script options and fix a bug
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-04-29 18:37:40 +02:00
Javier Martinez Canillas 303821d014
grubby-bls: update man page to match options in current wrapper script
The man page of the old grubby tool is still shipped in the grubby package
but instead there should be a man page that only documents the options for
the wrapper grubby script that is used to manage the BLS config snippets.

Current man page is confusing for users so let's add one that contains the
options that are supported by the wrapper script but no unsupported ones.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-04-29 18:37:05 +02:00
Javier Martinez Canillas f57406f3ab
grubby-bls: fix corner case when a kernel param value contains a '='
If a kernel command line parameter has a '=' character, grubby fails
to update the options field in the BLS snippet, for example:

$ grubby --update-kernel=foo --args="bar=https://test?token="
sed: -e expression #1, char 30: unknown option to `s'

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-04-29 18:36:57 +02:00
Javier Martinez Canillas 8c7d866907
Make grubby to also update GRUB_CMDLINE_LINUX in /etc/default/grub
The grubby --update-kernel=ALL option is used to update the kernel command
line parameters for all the boot entries. But the updated cmdline is lost
if the grub2-mkconfig command is executed, since in that case the cmdline
is changed with the value set by GRUB_CMDLINE_LINUX in /etc/default/grub.

To prevent the cmdline set by users to be overridden by mistake, keep the
value of GRUB_CMDLINE_LINUX in sync with the current cmdline.

Related: rhbz#1287854

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-03-30 14:25:41 +02:00
Javier Martinez Canillas 5f9558c222
Fix FTBFS and a couple of cleanups
Fix FTBFS
  Resolves: rhbz#1799496
Fix wrong S-o-B tag in patch
Fix warning about using unversioned Obsoletes

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2020-02-10 20:19:29 +01:00
Fedora Release Engineering 03b13cef75 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-29 03:36:54 +00:00
Javier Martinez Canillas b5070e2278
grubby-bls: don't update grubenv when generating grub.cfg for ppc64le
Since PowerNV machines can have a Petitboot versions that still don't have
BLS support, grubby re-generates the grub.cfg file on all ppc64le machines.

But this has the side effect that the grubenv file is updated, which will
overwrite any value that was set by grubby itself. To prevent that run the
grub2-mkconfig with the --no-grubenv-update option.

Related: rhbz#1726514

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-11-30 00:29:12 +01:00
Javier Martinez Canillas 3ffa2d2706
Fix logic that checks for kernelopts in BLS files and some cleanups
grubby-bls: don't print rpm-sort error messages
  Resolves: rhbz#1731924
grubby-bls: remove -o option and support -c for ppc64le grub config
  Resolves: rhbz#1758598
grubby-bls: fix logic to check if the kernelopts var is defined in a BLS
  Resolves: rhbz#1726514

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-11-28 12:11:39 +01:00
Javier Martinez Canillas 08153fc1d6
grubby-bls: fix logic to check if the kernelopts var is defined in a BLS
The logic to check if a kernelopts variable is defined in a BLS entry was
wrong and caused grubby to expand the variables even when it was defined.

Resolves: rhbz#1726514

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-11-28 10:52:53 +01:00
Javier Martinez Canillas 5dafc374ee
grubby-bls: remove -o option and support -c for ppc64le grub config
Resolves: rhbz#1758598

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-11-27 17:13:51 +01:00
Javier Martinez Canillas 77a8c0bcac
grubby-bls: don't print rpm-sort error messages
If there are no BLS snippets, an empty array of strings is passed to the
rpm-sort tool and it will print an error that just confuses grubby users.

Resolves: rhbz#1731924

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-11-27 17:13:32 +01:00
Yuval Turgeman 9baffd002d
grubby-bls: strip only /boot from paths
If the /boot directory is a mount point, then the paths of the kernel and
initramfs images paths in the BLS snippet have to be relative to the root
of the boot partition. So the /boot prefix has to be stripped from paths
in this case.

But the function was wrongly stripping the entire path instead of only the
/boot prefix, which prevented having kernels and initrds in subdirectories.

Signed-off-by: Yuval Turgeman <yturgema@redhat.com>
2019-08-06 16:03:53 +02:00
Fedora Release Engineering 4009bc7ed4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 07:49:12 +00:00
Javier Martinez Canillas b50c79e71c
Add a kernel-install plugin to execute hook scripts in /etc/kernel/
The kernel hook scripts in /etc/kernel/postinst.d and /etc/kernel/prerm.d
were executed by the new-kernel-pkg --rpmposttrans and --remove options.

But with a BLS configuration the new-kernel-pkg script isn't executed and
instead the kernel-install plugins are used. Add a kernel-install plugin
that executes the hooks since packages like dkms and akmod make use of it.

Resolves: rhbz#1696202

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-06-17 18:10:58 +02:00
Igor Gnatenko 7c6e97e809
Rebuild for RPM 4.15
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-06-11 00:13:19 +02:00