From 6ef3acfa4ce3c78619b694da6b522655a3c18fc89f7679ab3cdcc94f593218a6 Mon Sep 17 00:00:00 2001 From: Michael Chang Date: Thu, 23 Feb 2017 15:35:40 +0000 Subject: [PATCH] Accepting request 460048 from home:michael-chang:bsc:1026344 - Temporary fix for openQA UEFI USB Boot failure (bsc#1026344) * 0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch OBS-URL: https://build.opensuse.org/request/show/460048 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=258 --- ...rly-terminate-filepath-with-NULL-in-.patch | 39 +++++++++++++++++++ grub2.changes | 6 +++ grub2.spec | 2 + 3 files changed, 47 insertions(+) create mode 100644 0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch diff --git a/0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch b/0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch new file mode 100644 index 0000000..0d7ab44 --- /dev/null +++ b/0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch @@ -0,0 +1,39 @@ +From 28f83642deb777cce122c3629ddbd7b44a7f95b4 Mon Sep 17 00:00:00 2001 +From: Michael Chang +Date: Thu, 23 Feb 2017 22:39:37 +0800 +Subject: [PATCH] Revert "efi: properly terminate filepath with NULL in + chainloader" + +This reverts commit ce95549cc54b5d6f494608a7c390dba3aab4fba7. +--- + grub-core/loader/efi/chainloader.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/grub-core/loader/efi/chainloader.c b/grub-core/loader/efi/chainloader.c +index adc8563..522a716 100644 +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -122,8 +122,6 @@ 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); + } + +@@ -158,10 +156,8 @@ 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) + 2) ++ + ((grub_strlen (dir_start) + 1) + * GRUB_MAX_UTF16_PER_UTF8 + * sizeof (grub_efi_char16_t)) + + sizeof (grub_efi_file_path_device_path_t) * 2); +-- +2.6.6 + diff --git a/grub2.changes b/grub2.changes index 162bcec..6ce2086 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Feb 23 15:06:44 UTC 2017 - mchang@suse.com + +- Temporary fix for openQA UEFI USB Boot failure (bsc#1026344) + * 0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch + ------------------------------------------------------------------- Fri Feb 17 06:46:11 UTC 2017 - mchang@suse.com diff --git a/grub2.spec b/grub2.spec index 0640b10..649d09c 100644 --- a/grub2.spec +++ b/grub2.spec @@ -206,6 +206,7 @@ Patch77: grub2-s390x-08-workaround-part-to-disk.patch Patch78: grub2-commands-introduce-read_file-subcommand.patch Patch79: grub2-efi-chainload-harder.patch Patch80: grub2-emu-4-all.patch +Patch81: 0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch # Btrfs snapshot booting related patches Patch101: grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch Patch102: grub2-btrfs-02-export-subvolume-envvars.patch @@ -461,6 +462,7 @@ swap partition while in resuming %patch78 -p1 %patch79 -p1 %patch80 -p1 +%patch81 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1