From a12921113e167e13d7352d4af63aad75d2b28a05c394d28a91fc6745a6674b12 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Sun, 24 Mar 2019 13:55:49 +0000 Subject: [PATCH] Accepting request 686300 from Base:System OBS-URL: https://build.opensuse.org/request/show/686300 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=202 --- ...ee1275-FCP-methods-for-WWPN-and-LUNs.patch | 93 ++++++++++++------- grub2-ieee1275-open-raw-mode.patch | 60 ------------ grub2.changes | 16 ++++ grub2.spec | 6 +- 4 files changed, 78 insertions(+), 97 deletions(-) delete mode 100644 grub2-ieee1275-open-raw-mode.patch diff --git a/grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch b/grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch index 9913742..054aaf0 100644 --- a/grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch +++ b/grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch @@ -1,8 +1,7 @@ +From a7a3ad361b4a75d052e9b4389b44a9f3848f3b9f Mon Sep 17 00:00:00 2001 From: Diego Domingos Date: Fri, 10 Aug 2018 16:29:50 -0400 -Subject: ieee1275: implement FCP methods for WWPN and LUNs -References: bsc#1093145 -Patch-mainline: not yet +Subject: [PATCH] ieee1275: implement FCP methods for WWPN and LUNs This patch enables the fcp-targets and fcp-luns methods which are responsible to get WWPNs and LUNs for fibre channel devices. @@ -13,21 +12,21 @@ to find the WWPNs and LUNs when called by searchfs.uuid tool. Signed-off-by: Diego Domingos --- - grub-core/disk/ieee1275/ofdisk.c | 89 +++++++++++++++++++++++++++++++++++++++- - 1 file changed, 88 insertions(+), 1 deletion(-) + grub-core/disk/ieee1275/ofdisk.c | 109 ++++++++++++++++++++++++++++++++++++++- + 1 file changed, 108 insertions(+), 1 deletion(-) -diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c -index 235c0fe..bb213f1 100644 ---- a/grub-core/disk/ieee1275/ofdisk.c -+++ b/grub-core/disk/ieee1275/ofdisk.c -@@ -209,7 +209,94 @@ dev_iterate_real (const char *name, const char *path) +Index: grub-2.02/grub-core/disk/ieee1275/ofdisk.c +=================================================================== +--- grub-2.02.orig/grub-core/disk/ieee1275/ofdisk.c ++++ grub-2.02/grub-core/disk/ieee1275/ofdisk.c +@@ -209,7 +209,118 @@ dev_iterate_real (const char *name, cons static void dev_iterate (const struct grub_ieee1275_devalias *alias) { - if (grub_strcmp (alias->type, "vscsi") == 0) + if (grub_strcmp (alias->type, "fcp") == 0){ + -+ /* If we are dealing with fcp devices, we need ++ /* If we are dealing with fcp devices, we need + * to find the WWPNs and LUNs to iterate them */ + grub_ieee1275_ihandle_t ihandle; + grub_uint64_t *ptr_targets, *ptr_luns; @@ -56,7 +55,11 @@ index 235c0fe..bb213f1 100644 + grub_ieee1275_cell_t table; + } args_luns; + -+ grub_ieee1275_open (alias->path, &ihandle); ++ if(grub_ieee1275_open (alias->path, &ihandle)) ++ { ++ grub_dprintf("disk", "failed to open the disk while iterating FCP disk path=%s\n", alias->path); ++ return; ++ } + + INIT_IEEE1275_COMMON (&args_targets.common, "call-method", 2, 3); + args_targets.method = (grub_ieee1275_cell_t) "fcp-targets"; @@ -70,41 +73,61 @@ index 235c0fe..bb213f1 100644 + args_luns.table = 0; + args_luns.nentries = 0; + -+ IEEE1275_CALL_ENTRY_FN (&args_targets); ++ if (IEEE1275_CALL_ENTRY_FN (&args_targets) == -1) ++ { ++ grub_dprintf("disk", "failed to get the targets while iterating FCP disk path=%s\n", alias->path); ++ grub_ieee1275_close(ihandle); ++ return; ++ } + + buf = grub_malloc (grub_strlen (alias->path) + 32 + 32); + + if (!buf) -+ return; ++ { ++ grub_ieee1275_close(ihandle); ++ return; ++ } + + bufptr = grub_stpcpy (buf, alias->path); + + /* For each WWPN discovered we need to find his associated LUNS + * calling the fcp-luns method */ -+ for (i=0; i< args_targets.nentries; i++){ -+ ptr_targets = *(grub_uint64_t **) (args_targets.table + 4 + 8 * i); -+ while(*ptr_targets){ -+ args_luns.wwpn_l = (grub_ieee1275_cell_t) (*ptr_targets); -+ args_luns.wwpn_h = (grub_ieee1275_cell_t) (*ptr_targets >> 32); -+ pos=grub_snprintf (bufptr, 32, "/disk@%" PRIxGRUB_UINT64_T, ++ for (i=0; i< args_targets.nentries; i++) ++ { ++ ptr_targets = *(grub_uint64_t **) (args_targets.table + 4 + 8 * i); ++ while(*ptr_targets) ++ { ++ args_luns.wwpn_l = (grub_ieee1275_cell_t) (*ptr_targets); ++ args_luns.wwpn_h = (grub_ieee1275_cell_t) (*ptr_targets >> 32); ++ pos=grub_snprintf (bufptr, 32, "/disk@%" PRIxGRUB_UINT64_T, + *ptr_targets++); -+ IEEE1275_CALL_ENTRY_FN (&args_luns); -+ ptr_luns = *(grub_uint64_t **) (args_luns.table); + -+ for(j=0;j - #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 903a2f8..5504257 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Tue Mar 19 06:14:47 UTC 2019 - mchang + +- Use %doc for older products for compatibility, or may end up with + unsuccessful build result + * grub2.spec + +------------------------------------------------------------------- +Tue Mar 19 04:18:46 UTC 2019 - mchang + +- Revert grub2-ieee1275-open-raw-mode.patch for regression of crashing lvm on + multipath SAN (bsc#1113702) + * deleted grub2-ieee1275-open-raw-mode.patch +- Add exception handling to FCP lun enumeration (bsc#1113702) + * grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch + ------------------------------------------------------------------- Wed Feb 20 08:38:55 UTC 2019 - mchang@suse.com diff --git a/grub2.spec b/grub2.spec index 05ad9f4..985417e 100644 --- a/grub2.spec +++ b/grub2.spec @@ -265,7 +265,6 @@ 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 Patch215: grub2-ppc64-cas-new-scope.patch Patch216: 0001-ofnet-Initialize-structs-in-bootpath-parser.patch Patch217: grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch @@ -576,7 +575,6 @@ swap partition while in resuming %patch211 -p1 %patch212 -p1 %patch213 -p1 -%patch214 -p1 %patch215 -p1 %patch216 -p1 %patch217 -p1 @@ -1100,7 +1098,11 @@ fi %files -f %{name}.lang %defattr(-,root,root,-) +%if 0%{?suse_version} < 1500 +%doc COPYING +%else %license COPYING +%endif %doc NEWS README %doc THANKS TODO ChangeLog %doc docs/autoiso.cfg docs/osdetect.cfg