From 7c2bab5e98d1f376ef9bea2cf2f8f0a6db3dc933 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Mar 26 2020 17:30:49 +0000 Subject: grub-switch-to-blscfg: Update grub2 binary in ESP for OSTree systems Related: rhbz#1751272 Signed-off-by: Javier Martinez Canillas --- diff --git a/0205-grub-switch-to-blscfg-Update-grub2-binary-in-ESP-for.patch b/0205-grub-switch-to-blscfg-Update-grub2-binary-in-ESP-for.patch new file mode 100644 index 0000000..5993a6b --- /dev/null +++ b/0205-grub-switch-to-blscfg-Update-grub2-binary-in-ESP-for.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Thu, 26 Mar 2020 15:08:30 +0100 +Subject: [PATCH] grub-switch-to-blscfg: Update grub2 binary in ESP for OSTree + systems + +The grub2 EFI binary in the ESP isn't updated as a part of an OSTree update +transaction. So let's make the script to update this and also create a file +to indicate that the installed version has support for the blscfg module. + +Related: rhbz#1751272 + +Signed-off-by: Javier Martinez Canillas +--- + util/grub-switch-to-blscfg.in | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in +index 49b3985fadb..a05a8d98554 100644 +--- a/util/grub-switch-to-blscfg.in ++++ b/util/grub-switch-to-blscfg.in +@@ -266,6 +266,15 @@ copy_bls() { + fi + } + ++# The grub2 EFI binary is not copied to the ESP as a part of an ostree ++# transaction. Make sure a grub2 version with BLS support is installed. ++if test -f /run/ostree-booted && test -d /sys/firmware/efi/efivars/; then ++ grub_binary="$(find /usr/lib/ostree-boot/efi/EFI/${EFIDIR}/ -name grub*.efi)" ++ cp ${grub_binary} ${grubdir} || exit 1 ++ # Create a hidden file to indicate that grub2 now has BLS support. ++ touch /boot/grub2/.grub2-blscfg-supported ++fi ++ + GENERATE=0 + if grep '^GRUB_ENABLE_BLSCFG=.*' "${etcdefaultgrub}" \ + | grep -vq '^GRUB_ENABLE_BLSCFG="*true"*\s*$' ; then diff --git a/grub.patches b/grub.patches index 483aa8b..1704303 100644 --- a/grub.patches +++ b/grub.patches @@ -202,3 +202,4 @@ Patch0201: 0201-efi-net-Allow-to-specify-a-port-number-in-addresses.patch Patch0202: 0202-efi-ip4_config-Improve-check-to-detect-literal-IPv6-.patch Patch0203: 0203-efi-net-Print-a-debug-message-if-parsing-the-address.patch Patch0204: 0204-blscfg-return-NULL-instead-of-a-zero-length-array-in.patch +Patch0205: 0205-grub-switch-to-blscfg-Update-grub2-binary-in-ESP-for.patch diff --git a/grub2.spec b/grub2.spec index a353222..0b74f16 100644 --- a/grub2.spec +++ b/grub2.spec @@ -9,7 +9,7 @@ Name: grub2 Epoch: 1 Version: 2.04 -Release: 10%{?dist} +Release: 11%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -509,6 +509,10 @@ rm -r /boot/grub2.tmp/ || : %endif %changelog +* Thu Mar 26 2020 Javier Martinez Canillas - 2.04-11 +- grub-switch-to-blscfg: Update grub2 binary in ESP for OSTree systems + Related: rhbz#1751272 + * Tue Mar 17 2020 Javier Martinez Canillas - 2.04-10 - Fix for entries having an empty initrd command and HTTP boot issues Resolves: rhbz#1806022