diff --git a/0301-Remove-bogus-load_env-after-blscfg-command-in-10_lin.patch b/0301-Remove-bogus-load_env-after-blscfg-command-in-10_lin.patch new file mode 100644 index 0000000..b5ad399 --- /dev/null +++ b/0301-Remove-bogus-load_env-after-blscfg-command-in-10_lin.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 14 May 2019 20:37:44 +0200 +Subject: [PATCH] Remove bogus load_env after blscfg command in 10_linux + +The grubenv is already loaded in the 00_header snippet, so there's +no need to load it anywhere else. + +Signed-off-by: Javier Martinez Canillas +--- + util/grub.d/10_linux.in | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in +index 8f7ecf65df9..350903fa5ab 100644 +--- a/util/grub.d/10_linux.in ++++ b/util/grub.d/10_linux.in +@@ -162,9 +162,6 @@ set default_kernelopts="root=${linux_root_device_thisversion} ro ${args}" + + insmod blscfg + blscfg +-if [ -s \$prefix/grubenv ]; then +- load_env +-fi + EOF + + if [ "x${GRUB_GRUBENV_UPDATE}" = "xyes" ]; then diff --git a/0302-blscfg-Don-t-leave-grub_errno-set-to-an-error-if-the.patch b/0302-blscfg-Don-t-leave-grub_errno-set-to-an-error-if-the.patch new file mode 100644 index 0000000..e02ca07 --- /dev/null +++ b/0302-blscfg-Don-t-leave-grub_errno-set-to-an-error-if-the.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Wed, 15 May 2019 01:46:00 +0200 +Subject: [PATCH] blscfg: Don't leave grub_errno set to an error if the command + succeeded + +After a command is executed, the function grub_print_error() is called to +print any active error messages if these exist. + +The blscfg command calls to the grub_strtol() function to try to convert +the default entry string to a number, in case the default is an index. + +If this function is not able to do the conversion, it sets the grub_errno +variable to GRUB_ERR_BAD_NUMBER. But the blscfg command wrongly left that +set and so the caller would be confused thinking that the command failed +and that an error message has to be printed. + +This caused the first error in the stack to be printed, polluting the GRUB +output and preventing the menu to be hidden. So reset the grub_error var +to GRUB_ERR_NONE again if was set to GRUB_ERR_BAD_NUMBER by grub_strtol(). + +Resolves: rhbz#1699761 + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/commands/blscfg.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index bd008b04bec..26dbe873fe4 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -999,8 +999,10 @@ is_default_entry(const char *def_entry, struct bls_entry *entry, int idx) + return true; + + def_idx = (int)grub_strtol(def_entry, NULL, 0); +- if (grub_errno == GRUB_ERR_BAD_NUMBER) ++ if (grub_errno == GRUB_ERR_BAD_NUMBER) { ++ grub_errno = GRUB_ERR_NONE; + return false; ++ } + + if (def_idx == idx) + return true; diff --git a/grub.patches b/grub.patches index 7167f04..bddbbcc 100644 --- a/grub.patches +++ b/grub.patches @@ -298,3 +298,5 @@ Patch0297: 0297-Don-t-assume-that-boot-commands-will-only-return-on-.patch Patch0298: 0298-Add-10_reset_boot_success-to-Makefile.patch Patch0299: 0299-Fix-undefined-references-for-fdt-when-building-with-.patch Patch0300: 0300-blscfg-remove-BLS-file-size-check.patch +Patch0301: 0301-Remove-bogus-load_env-after-blscfg-command-in-10_lin.patch +Patch0302: 0302-blscfg-Don-t-leave-grub_errno-set-to-an-error-if-the.patch diff --git a/grub2.spec b/grub2.spec index 7aca3cd..31e1a5c 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 82%{?dist} +Release: 83%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -518,6 +518,11 @@ rm -r /boot/grub2.tmp/ || : %endif %changelog +* Wed May 15 2019 Javier Martinez Canillas - 2.02-83 +- Fix error messages wrongly being printed when executing blscfg command + Resolves: rhbz#1699761 +- Remove bogus load_env after blscfg command in 10_linux + * Tue May 07 2019 Javier Martinez Canillas - 2.02-82 - Make blscfg module compatible at least up to the Fedora 19 GRUB core Related: rhbz#1652806