Hello community,

here is the log from the commit of package grub2 for openSUSE:Factory checked 
in at 2017-03-05 17:58:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/grub2 (Old)
 and      /work/SRC/openSUSE:Factory/.grub2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "grub2"

Sun Mar  5 17:58:46 2017 rev:156 rq:462013 version:2.02~rc1

Changes:
--------
--- /work/SRC/openSUSE:Factory/grub2/grub2.changes      2017-02-24 
02:43:16.866985811 +0100
+++ /work/SRC/openSUSE:Factory/.grub2.new/grub2.changes 2017-03-05 
17:59:08.125162773 +0100
@@ -1,0 +2,7 @@
+Wed Mar  1 10:29:46 UTC 2017 - mch...@suse.com
+
+- Fix for openQA UEFI USB Boot failure with upstream patch (bsc#1026344)
+  * added 0001-efi-strip-off-final-NULL-from-File-Path-in-grub_efi_.patch
+  * removed 0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch 
+
+-------------------------------------------------------------------
@@ -10,0 +18,5 @@
+
+-------------------------------------------------------------------
+Thu Feb 16 12:55:29 UTC 2017 - msucha...@suse.com
+
+- require efibootmgr in efi package (boo#1025520)

Old:
----
  0001-Revert-efi-properly-terminate-filepath-with-NULL-in-.patch

New:
----
  0001-efi-strip-off-final-NULL-from-File-Path-in-grub_efi_.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ grub2.spec ++++++
--- /var/tmp/diff_new_pack.nsMYvQ/_old  2017-03-05 17:59:09.564958981 +0100
+++ /var/tmp/diff_new_pack.nsMYvQ/_new  2017-03-05 17:59:09.568958416 +0100
@@ -206,7 +206,7 @@
 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
+Patch81:        0001-efi-strip-off-final-NULL-from-File-Path-in-grub_efi_.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
@@ -337,19 +337,11 @@
 %package %{grubefiarch}
 
 Summary:        Bootloader with support for Linux, Multiboot and more
+# Require efibootmgr
+# Without it grub-install is broken so break the package as well if unavailable
 Group:          System/Boot
-%ifarch ia64 x86_64 aarch64
-#Package is available on ia64, x86_64 and aarch64 only and not necessarily 
needed
 Requires:       efibootmgr
 Requires(post): efibootmgr
-%endif
-# Also require efibootmgr on i586 Tumbleweed where it is available
-%if 0%{?suse_version} > 1320
-%ifarch i586
-Requires:       efibootmgr
-Requires(post): efibootmgr
-%endif
-%endif
 Requires:       %{name} = %{version}-%{release}
 Requires(post):        %{name} = %{version}-%{release}
 %if 0%{?update_bootloader_requires:1}

++++++ 0001-efi-strip-off-final-NULL-from-File-Path-in-grub_efi_.patch ++++++
>From 892dfbe113d08c18e51d7c27eee5094f3da530ec Mon Sep 17 00:00:00 2001
From: Andrei Borzenkov <arvidj...@gmail.com>
Date: Sat, 25 Feb 2017 08:39:38 +0300
Subject: [PATCH] efi: strip off final NULL from File Path in
 grub_efi_get_filename

UEFI 2.6 9.3.6.4 File Path Media Device Path says that Path Name is
"A NULL-terminated Path string including directory and file names".

Strip final NULL from Path Name in each File Path node when constructing
full path. To be on safe side, strip all of them.

Fixes failure chainloading grub from grub, when loaded grub truncates
image path and does not find its grub.cfg.

https://bugzilla.opensuse.org/show_bug.cgi?id=1026344

This was triggered by commit ce95549cc54b5d6f494608a7c390dba3aab4fba7;
before it we built Path Name without trailing NULL, and apparently all
other bootloaders use single File Path node, thus not exposing this bug.
---
 grub-core/kern/efi/efi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/grub-core/kern/efi/efi.c b/grub-core/kern/efi/efi.c
index caf9bcc..d467785 100644
--- a/grub-core/kern/efi/efi.c
+++ b/grub-core/kern/efi/efi.c
@@ -366,6 +366,9 @@ grub_efi_get_filename (grub_efi_device_path_t *dp0)
          len = ((GRUB_EFI_DEVICE_PATH_LENGTH (dp) - 4)
                 / sizeof (grub_efi_char16_t));
          fp = (grub_efi_file_path_device_path_t *) dp;
+         /* According to EFI spec Path Name is NULL terminated */
+         while (len > 0 && fp->path_name[len - 1] == 0)
+           len--;
 
          p = (char *) grub_utf16_to_utf8 ((unsigned char *) p, fp->path_name, 
len);
        }
-- 
2.6.6




Reply via email to