diff options
Diffstat (limited to 'libre/grub')
-rw-r--r-- | libre/grub/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch | 44 | ||||
-rw-r--r-- | libre/grub/PKGBUILD | 11 |
2 files changed, 52 insertions, 3 deletions
diff --git a/libre/grub/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch b/libre/grub/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch new file mode 100644 index 000000000..b79610724 --- /dev/null +++ b/libre/grub/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch @@ -0,0 +1,44 @@ +From ce95549cc54b5d6f494608a7c390dba3aab4fba7 Mon Sep 17 00:00:00 2001 +From: Andrei Borzenkov <arvidjaar@gmail.com> +Date: Thu, 15 Dec 2016 16:07:00 +0300 +Subject: efi: properly terminate filepath with NULL in chainloader + +EFI File Path Media Device Path is defined as NULL terminated string; +but chainloader built file paths without final NULL. This caused error +with Secure Boot and Linux Foundation PreLoader on Acer with InsydeH20 BIOS. +Apparently firmware failed verification with EFI_INVALID_PARAMETER which is +considered fatal error by PreLoader. + +Reported and tested by Giovanni Santini <itachi.sama.amaterasu@gmail.com> +--- + grub-core/loader/efi/chainloader.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c +index 522a716..adc8563 100644 +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -122,6 +122,8 @@ copy_file_path (grub_efi_file_path_device_path_t *fp, + if (*p == '/') + *p = '\\'; + ++ /* File Path is NULL terminated */ ++ fp->path_name[size++] = '\0'; + fp->header.length = size * sizeof (grub_efi_char16_t) + sizeof (*fp); + } + +@@ -156,8 +158,10 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) + d = GRUB_EFI_NEXT_DEVICE_PATH (d); + } + ++ /* File Path is NULL terminated. Allocate space for 2 extra characters */ ++ /* FIXME why we split path in two components? */ + file_path = grub_malloc (size +- + ((grub_strlen (dir_start) + 1) ++ + ((grub_strlen (dir_start) + 2) + * GRUB_MAX_UTF16_PER_UTF8 + * sizeof (grub_efi_char16_t)) + + sizeof (grub_efi_file_path_device_path_t) * 2); +-- +cgit v1.0 + diff --git a/libre/grub/PKGBUILD b/libre/grub/PKGBUILD index 2884401b2..ba993a8b4 100644 --- a/libre/grub/PKGBUILD +++ b/libre/grub/PKGBUILD @@ -20,7 +20,7 @@ _pkgver='2.02' _GRUB_GIT_TAG='grub-2.02-beta3' _GRUB_EXTRAS_COMMIT=f2a079441939eee7251bf141986cdd78946e1d20 -_UNIFONT_VER='8.0.01' +_UNIFONT_VER='9.0.06' [[ "${CARCH}" = 'armv7h' ]] && _EFI_ARCH='arm' [[ "${CARCH}" = 'x86_64' ]] && _EFI_ARCH='x86_64' @@ -38,7 +38,7 @@ pkgname=('grub') 'grub-omap3_beagle_xm' 'grub-omap3_beagle_xm_ab') pkgdesc='GNU GRand Unified Bootloader (2), (Parabola rebranded)' pkgver='2.02.beta3' -pkgrel='4.parabola1' +pkgrel='6.parabola1' epoch='1' url='https://www.gnu.org/software/grub/' arch=('x86_64' 'i686' 'armv7h') @@ -79,6 +79,7 @@ source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG} '0003-10_linux-20_linux_xen-detect-parabola-initramfs.patch' '0004-add-GRUB_COLOR_variables.patch' '0005-10_linux-fix-grouping-of-tests.patch' + '0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch' 'grub.default' '0003-10_linux-20_linux_xen-detect-am335x_bone+am335x_boneblack-devicetree-file.patch' '0003-10_linux-20_linux_xen-detect-omap3_beagle-devicetree-file.patch' @@ -89,12 +90,13 @@ source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG} md5sums=('SKIP' 'SKIP' - '31cd5b872d38a3a3581ef1f7b2ef1216' + 'd849b5922485692d26bb1cb239259274' 'SKIP' '9589ec46a04f9bb4d5da987340a4a324' '3a9bb9bafe0062388e11f72f0e80ba7e' 'e506ae4a9f9f7d1b765febfa84e10d48' 'f1999315bbd25b4b9359919ce9b36144' + 'a248d3f53f1fc38cfd7e49b99a559b43' '8d1dd54ae4a1b550c097e056892ce953' 'a46695e19b588a53b8bac9e3b3c56096' '803f5b5f56ba6d74ca84aea67659116e' @@ -127,6 +129,9 @@ prepare() { msg 'Patch to fix grouping of tests for GRUB_DEVICE' patch -Np1 -i "${srcdir}/0005-10_linux-fix-grouping-of-tests.patch" + msg "Patch to properly terminate filepath with NULL in chainloader" + patch -Np1 -i "${srcdir}/0006-efi-properly-terminate-filepath-with-NULL-in-chainloader.patch" + msg 'Fix DejaVuSans.ttf location so that grub-mkfont can create *.pf2 files for starfield theme' sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "${srcdir}/grub-${_pkgver}/configure.ac" |