diff --git a/0220-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch b/0220-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch new file mode 100644 index 0000000..97d2e06 --- /dev/null +++ b/0220-http-Prepend-prefix-when-the-HTTP-path-is-relative-a.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 2 Jun 2020 13:25:01 +0200 +Subject: [PATCH] http: Prepend prefix when the HTTP path is relative as done + in efi/http + +There are two different HTTP drivers that can be used when requesting an +HTTP resource: the efi/http that uses the EFI_HTTP_PROTOCOL and the http +that uses GRUB's HTTP and TCP/IP implementation. + +The efi/http driver appends a prefix that is defined in the variable +http_path, but the http driver doesn't. + +So using this driver and attempting to fetch a resource using a relative +path fails. + +Signed-off-by: Javier Martinez Canillas +--- + grub-core/net/http.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/grub-core/net/http.c b/grub-core/net/http.c +index b52b558d631..7f878b56157 100644 +--- a/grub-core/net/http.c ++++ b/grub-core/net/http.c +@@ -501,13 +501,20 @@ http_open (struct grub_file *file, const char *filename) + { + grub_err_t err; + struct http_data *data; ++ const char *http_path; + + data = grub_zalloc (sizeof (*data)); + if (!data) + return grub_errno; + file->size = GRUB_FILE_SIZE_UNKNOWN; + +- data->filename = grub_strdup (filename); ++ /* If path is relative, prepend http_path */ ++ http_path = grub_env_get ("http_path"); ++ if (http_path && filename[0] != '/') ++ data->filename = grub_xasprintf ("%s/%s", http_path, filename); ++ else ++ data->filename = grub_strdup (filename); ++ + if (!data->filename) + { + grub_free (data); diff --git a/0221-fix-build-with-rpm-4.16.patch b/0221-fix-build-with-rpm-4.16.patch new file mode 100644 index 0000000..2a2e389 --- /dev/null +++ b/0221-fix-build-with-rpm-4.16.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Thierry Vignaud +Date: Mon, 8 Jun 2020 06:50:21 +0200 +Subject: [PATCH] fix build with rpm-4.16 + +Signed-off-by: Thierry Vignaud +--- + configure.ac | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/configure.ac b/configure.ac +index eff160b6931..5d3316185da 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1887,6 +1887,15 @@ if test x"$rpm_sort_excuse" = x ; then + [Define to 1 if you have the rpm library.]) + fi + ++if test x"$LIBRPM" = x ; then ++ # Check for rpm library. ++ AC_CHECK_LIB([rpmio], [rpmvercmp], [], ++ [rpm_sort_excuse="rpmio missing rpmvercmp"]) ++ LIBRPM="-lrpmio"; ++ AC_DEFINE([HAVE_RPMIO], [1], ++ [Define to 1 if you have the rpm library.]) ++fi ++ + AC_SUBST([LIBRPM]) + + LIBGEOM= diff --git a/grub.patches b/grub.patches index 22276ca..914eeab 100644 --- a/grub.patches +++ b/grub.patches @@ -217,3 +217,5 @@ Patch0216: 0216-tpm-Don-t-propagate-TPM-measurement-errors-to-the-ve.patch Patch0217: 0217-tpm-Enable-module-for-all-EFI-platforms.patch 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 diff --git a/grub2.spec b/grub2.spec index 418260f..ad65078 100644 --- a/grub2.spec +++ b/grub2.spec @@ -9,7 +9,7 @@ Name: grub2 Epoch: 1 Version: 2.04 -Release: 23%{?dist} +Release: 24%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPLv3+ URL: http://www.gnu.org/software/grub/ @@ -504,6 +504,10 @@ rm -r /boot/grub2.tmp/ || : %endif %changelog +* 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) + * Fri Jun 05 2020 Javier Martinez Canillas - 2.04-23 - Install GRUB as \EFI\BOOT\BOOTARM.EFI in armv7hl