Hello community,

here is the log from the commit of package grub2 for openSUSE:Factory checked 
in at 2018-04-22 14:34:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/grub2 (Old)
 and      /work/SRC/openSUSE:Factory/.grub2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "grub2"

Sun Apr 22 14:34:07 2018 rev:182 rq:598028 version:2.02

Changes:
--------
--- /work/SRC/openSUSE:Factory/grub2/grub2.changes      2018-04-17 
11:09:32.904835222 +0200
+++ /work/SRC/openSUSE:Factory/.grub2.new/grub2.changes 2018-04-22 
14:34:09.908854248 +0200
@@ -1,0 +2,6 @@
+Tue Apr 17 07:54:15 UTC 2018 - mch...@suse.com
+
+- Fallback to raw mode if Open Firmware returns invalid ihandler (bsc#1071559)
+  * grub2-ieee1275-open-raw-mode.patch
+
+-------------------------------------------------------------------

New:
----
  grub2-ieee1275-open-raw-mode.patch

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

Other differences:
------------------
++++++ grub2.spec ++++++
--- /var/tmp/diff_new_pack.bvG2nG/_old  2018-04-22 14:34:11.988778974 +0200
+++ /var/tmp/diff_new_pack.bvG2nG/_new  2018-04-22 14:34:11.992778829 +0200
@@ -245,13 +245,15 @@
 # PPC64 LE support
 Patch205:       grub2-ppc64le-disable-video.patch
 Patch207:       grub2-ppc64le-memory-map.patch
+# PPC 
+Patch210:       0002-Add-Virtual-LAN-support.patch 
+Patch211:       grub2-ppc64-cas-reboot-support.patch
+Patch212:       
grub2-install-remove-useless-check-PReP-partition-is-empty.patch
+Patch213:       grub2-Fix-incorrect-netmask-on-ppc64.patch
+Patch214:       grub2-ieee1275-open-raw-mode.patch
 Patch233:       grub2-use-stat-instead-of-udevadm-for-partition-lookup.patch
 Patch234:       
fix-grub2-use-stat-instead-of-udevadm-for-partition-lookup-with-new-glibc.patch
-Patch235:       0002-Add-Virtual-LAN-support.patch 
 Patch236:       grub2-efi_gop-avoid-low-resolution.patch
-Patch277:       grub2-ppc64-cas-reboot-support.patch
-Patch278:       
grub2-install-remove-useless-check-PReP-partition-is-empty.patch
-Patch279:       grub2-Fix-incorrect-netmask-on-ppc64.patch
 # Support HTTP Boot IPv4 and IPv6 (fate#320129)
 Patch280:       0001-misc-fix-invalid-character-recongition-in-strto-l.patch
 Patch281:       0002-net-read-bracketed-ipv6-addrs-and-port-numbers.patch
@@ -522,13 +524,14 @@
 %patch164 -p1
 %patch205 -p1
 %patch207 -p1
+%patch210 -p1
+%patch211 -p1
+%patch212 -p1
+%patch213 -p1
+%patch214 -p1
 %patch233 -p1
 %patch234 -p1
-%patch235 -p1
 %patch236 -p1
-%patch277 -p1
-%patch278 -p1
-%patch279 -p1
 %patch280 -p1
 %patch281 -p1
 %patch282 -p1


++++++ grub2-ieee1275-open-raw-mode.patch ++++++
From: dieg...@br.ibm.com
References: bsc#1071559
Patch-Mainline: no

Because Openfirmware returns invalid ihandler when it tries to open a disk
which his first partition is not a supported one by the firmware (Prep, FAT,
ISO), the grub needs to understand when it should open the disk in "raw mode",
appending a ":0" in the end of the device path.

Openfirmware is unable to open disk that contains a unknown first partition
(i.e it is not a PreP, Fat, ISO) ; We needed to open the disk in "raw mode" and
so Grub was required to take care of partitions and contents.

Index: grub-2.02/grub-core/kern/ieee1275/ieee1275.c
===================================================================
--- grub-2.02.orig/grub-core/kern/ieee1275/ieee1275.c
+++ grub-2.02/grub-core/kern/ieee1275/ieee1275.c
@@ -19,6 +19,8 @@
 
 #include <grub/ieee1275/ieee1275.h>
 #include <grub/types.h>
+#include <grub/misc.h>
+#include <grub/mm.h>
 
 #define IEEE1275_PHANDLE_INVALID  ((grub_ieee1275_cell_t) -1)
 #define IEEE1275_IHANDLE_INVALID  ((grub_ieee1275_cell_t) 0)
@@ -458,8 +460,31 @@ grub_ieee1275_open (const char *path, gr
   if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
     return -1;
   *result = args.result;
-  if (args.result == IEEE1275_IHANDLE_INVALID)
-    return -1;
+  if (args.result == IEEE1275_IHANDLE_INVALID){
+
+    int path_len = grub_strlen(path);
+    if ((path[path_len-3] == ':') && (path[path_len-2] == '0')){
+        return -1;
+    }
+
+    char *new_path = grub_malloc(grub_strlen(path) + 3);
+    char *optr;
+    optr = grub_stpcpy (new_path, path);
+    *optr++ = ':';
+    *optr++ = '0';
+    *optr++ = '\0';
+
+    args.path = (grub_ieee1275_cell_t) new_path;
+
+    if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
+        return -1;
+    
+    *result = args.result;
+    if (args.result == IEEE1275_IHANDLE_INVALID)
+        return -1;
+    
+  }
+
   return 0;
 }
 


Reply via email to