From 12e62c4f0a6b0582e9292f19ea7771efc09f9789 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Wed, 13 May 2020 18:44:59 +0200 Subject: [PATCH] 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 --- grubby-bls | 4 ---- grubby.spec | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/grubby-bls b/grubby-bls index 5b428a0..74dbe5b 100755 --- a/grubby-bls +++ b/grubby-bls @@ -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 diff --git a/grubby.spec b/grubby.spec index 4d9aedf..bc3e307 100644 --- a/grubby.spec +++ b/grubby.spec @@ -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 - 8.40-45 +- grubby-bls: don't replace options with kernelopts if values are the same + * Wed May 06 2020 Javier Martinez Canillas - 8.40-44 - Fix installed man page file mode bits