diff --git a/grub2-ieee1275-open-raw-mode.patch b/grub2-ieee1275-open-raw-mode.patch new file mode 100644 index 0000000..468412c --- /dev/null +++ b/grub2-ieee1275-open-raw-mode.patch @@ -0,0 +1,60 @@ +From: diegodo@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 + #include ++#include ++#include + + #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; + } + diff --git a/grub2.changes b/grub2.changes index b74b4d4..6c97146 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Apr 17 07:54:15 UTC 2018 - mchang@suse.com + +- Fallback to raw mode if Open Firmware returns invalid ihandler (bsc#1071559) + * grub2-ieee1275-open-raw-mode.patch + ------------------------------------------------------------------- Thu Apr 12 08:41:39 UTC 2018 - mchang@suse.com diff --git a/grub2.spec b/grub2.spec index 1d7e6bb..d6e6d17 100644 --- a/grub2.spec +++ b/grub2.spec @@ -245,13 +245,15 @@ Patch164: grub2-suse-remove-linux-root-param.patch # 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 @@ swap partition while in resuming %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