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>
This commit is contained in:
Javier Martinez Canillas 2020-05-13 18:44:59 +02:00
parent 770392fcd0
commit 12e62c4f0a
No known key found for this signature in database
GPG Key ID: C751E590D63F3D69
2 changed files with 4 additions and 5 deletions

View File

@ -521,10 +521,6 @@ update_bls_fragment() {
if [[ $param != "ALL" || "$(has_kernelopts "$i")" = "false" ]]; then
set_bls_value "${bls_file[$i]}" "options" "${new_args}"
fi
if [[ $bootloader = grub2 && "$(has_kernelopts "$i")" = "false" && $opts = $new_args ]]; then
set_bls_value "${bls_file[$i]}" "options" "\$kernelopts"
fi
fi
if [[ -n $initrd ]]; then

View File

@ -1,6 +1,6 @@
Name: grubby
Version: 8.40
Release: 44%{?dist}
Release: 45%{?dist}
Summary: Command line tool for updating bootloader configs
License: GPLv2+
URL: https://github.com/rhinstaller/grubby
@ -136,6 +136,9 @@ current boot environment.
%{_mandir}/man8/*.8*
%changelog
* Wed May 13 2020 Javier Martinez Canillas <javierm@redhat.com> - 8.40-45
- grubby-bls: don't replace options with kernelopts if values are the same
* Wed May 06 2020 Javier Martinez Canillas <javierm@redhat.com> - 8.40-44
- Fix installed man page file mode bits