From 51e876849c88ad6c2eb96fec736845b4954b4417 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Thu, 18 Jun 2020 15:13:22 +0200 Subject: [PATCH] Only mark GRUB as BLS supported in OSTree systems with a boot partition OSTree doesn't support installations that don't have a boot partition. The BLS snippets assume that there will be one, so this has to be checked and only mark GRUB as supporting BLS in OSTree systems have a boot partition. Signed-off-by: Javier Martinez Canillas --- ...s-BLS-supported-in-OSTree-systems-wi.patch | 35 +++++++++++++++++++ grub.patches | 1 + grub2.spec | 5 ++- 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0222-Only-mark-GRUB-as-BLS-supported-in-OSTree-systems-wi.patch diff --git a/0222-Only-mark-GRUB-as-BLS-supported-in-OSTree-systems-wi.patch b/0222-Only-mark-GRUB-as-BLS-supported-in-OSTree-systems-wi.patch new file mode 100644 index 0000000..dbb24f2 --- /dev/null +++ b/0222-Only-mark-GRUB-as-BLS-supported-in-OSTree-systems-wi.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Thu, 18 Jun 2020 11:19:00 +0200 +Subject: [PATCH] Only mark GRUB as BLS supported in OSTree systems with a boot + partition + +The script grub2-switch-to-blscfg updates the grub2 EFI binary in OSTree +systems and marks that has BLS support, to indicate that's not necessary +to add menuentry commands since the BLS snippets can be used to populate +the GRUB boot menu. + +But OSTree doesn't support installations that don't have a boot partition, +the BLS snippets assume that there will be one so this has to be checked +and only mark the bootloader as supporting BLS in OSTree installations +that have /boot as a mountpoint. + +Signed-off-by: Javier Martinez Canillas +--- + util/grub-switch-to-blscfg.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/util/grub-switch-to-blscfg.in b/util/grub-switch-to-blscfg.in +index cb229126128..a851424beb2 100644 +--- a/util/grub-switch-to-blscfg.in ++++ b/util/grub-switch-to-blscfg.in +@@ -261,7 +261,8 @@ copy_bls() { + # but only do this if the blsdir is not set, to make sure that the BLS + # parsing module will search for the BLS snippets in the default path. + if test -f /run/ostree-booted && test -d /sys/firmware/efi/efivars && \ +- ! ${grub_editenv} - list | grep -q blsdir; then ++ ! ${grub_editenv} - list | grep -q blsdir && \ ++ mountpoint -q /boot; then + grub_binary="$(find /usr/lib/ostree-boot/efi/EFI/${EFIDIR}/ -name grub*.efi)" + install -m 700 ${grub_binary} ${grubdir} || exit 1 + # Create a hidden file to indicate that grub2 now has BLS support. diff --git a/grub.patches b/grub.patches index 914eeab..43421fc 100644 --- a/grub.patches +++ b/grub.patches @@ -219,3 +219,4 @@ Patch0218: 0218-10_linux.in-Don-t-update-BLS-files-that-aren-t-manag.patch Patch0219: 0219-x86-efi-Reduce-maximum-bounce-buffer-size-to-16-MiB.patch Patch0220: 0220-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch Patch0221: 0221-fix-build-with-rpm-4.16.patch +Patch0222: 0222-Only-mark-GRUB-as-BLS-supported-in-OSTree-systems-wi.patch diff --git a/grub2.spec b/grub2.spec index ad65078..8d37198 100644 --- a/grub2.spec +++ b/grub2.spec @@ -9,7 +9,7 @@ Name: grub2 Epoch: 1 Version: 2.04 -Release: 24%{?dist} +Release: 25%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -504,6 +504,9 @@ rm -r /boot/grub2.tmp/ || : %endif %changelog +* Thu Jun 18 2020 Javier Martinez Canillas - 2.04-25 +- Only mark GRUB as BLS supported in OSTree systems with a boot partition + * Mon Jun 08 2020 Javier Martinez Canillas - 2.04-24 - http: Prepend prefix when the HTTP path is relative as done in efi/http - Fix build with rpm-4.16 (thierry.vignaud)