diff --git a/0292-blscfg-remove-BLS-file-size-check.patch b/0292-blscfg-remove-BLS-file-size-check.patch new file mode 100644 index 0000000..edd6e9e --- /dev/null +++ b/0292-blscfg-remove-BLS-file-size-check.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 7 May 2019 13:54:23 +0200 +Subject: [PATCH] blscfg: remove BLS file size check + +The read_entry() function checks the BLS file size and ignores the entry +if the file size isn't correct. The problem is that it will only work if +the struct grub_file layout and fields are the same in the GRUB version +used to build the blscfg.mod, than the one that's installed as GRUB core. + +But commit 84a0e9699f8 ("Add progress module to display load progress of +files.") added a .name field to struct grub_file, and this change landed +in the GRUB version used by Fedora 21. + +Since the GRUB core is never updated when the grub2 package is upgraded, +the blscfg module won't be compatible with any GRUB that was installed by +Fedora 20 or eralier. + +The blscfg.mod is copied to /boot/grub2/i386-pc/ in legacy BIOS installs +when the GRUB configuration is switched to BLS, so this will lead to BLS +files being ignored due grub_file_size() reporting wrong file sizes. This +is caused by the struct grub_file .size field offset being different in +Fedora 20 than later releases. + +This check is doing more harm than good, so let's just remove it to make +the blscfg module compatible at least up to GRUB core that was installed +by Fedora 19. + +Related: rhbz#1652806 + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/commands/blscfg.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c +index bb93b7f4904..bd008b04bec 100644 +--- a/grub-core/commands/blscfg.c ++++ b/grub-core/commands/blscfg.c +@@ -412,7 +412,6 @@ static int read_entry ( + int rc = 0; + char *p = NULL; + grub_file_t f = NULL; +- grub_off_t sz; + struct bls_entry *entry; + struct read_entry_info *info = (struct read_entry_info *)data; + +@@ -442,10 +441,6 @@ static int read_entry ( + goto finish; + } + +- sz = grub_file_size (f); +- if (sz == GRUB_FILE_SIZE_UNKNOWN || sz > 1024*1024) +- goto finish; +- + entry = grub_zalloc (sizeof (*entry)); + if (!entry) + goto finish; diff --git a/grub.patches b/grub.patches index 631a81d..d59dfe3 100644 --- a/grub.patches +++ b/grub.patches @@ -289,3 +289,4 @@ Patch0288: 0288-10_linux_bls-don-t-add-users-option-to-generated-men.patch Patch0289: 0289-grub.d-Split-out-boot-success-reset-from-menu-auto-h.patch Patch0290: 0290-HTTP-boot-strncmp-returns-0-on-equal.patch Patch0291: 0291-Add-10_reset_boot_success-to-Makefile.patch +Patch0292: 0292-blscfg-remove-BLS-file-size-check.patch diff --git a/grub2.spec b/grub2.spec index 19972ef..a7e20bf 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 78%{?dist} +Release: 79%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -476,6 +476,10 @@ rm -r /boot/grub2.tmp/ || : %endif %changelog +* Tue May 07 2019 Javier Martinez Canillas - 2.02-79 +- Make blscfg module compatible at least up to the Fedora 19 GRUB core + Related: rhbz#1652806 + * Thu Apr 18 2019 Javier Martinez Canillas - 2.02-78 - Add 10_reset_boot_success to Makefile Related: rhbz#1701003