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