Hello community,

here is the log from the commit of package grub2 for openSUSE:Factory checked 
in at 2018-10-02 19:39:25
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/grub2 (Old)
 and      /work/SRC/openSUSE:Factory/.grub2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "grub2"

Tue Oct  2 19:39:25 2018 rev:194 rq:638658 version:2.02

Changes:
--------
--- /work/SRC/openSUSE:Factory/grub2/grub2.changes      2018-09-16 
18:30:23.859442246 +0200
+++ /work/SRC/openSUSE:Factory/.grub2.new/grub2.changes 2018-10-02 
19:39:29.146382073 +0200
@@ -1,0 +2,6 @@
+Wed Sep 26 08:01:05 UTC 2018 - [email protected]
+
+- ieee1275: implement FCP methods for WWPN and LUNs (bsc#1093145)
+  * grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch
+
+-------------------------------------------------------------------

New:
----
  grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch

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

Other differences:
------------------
++++++ grub2.spec ++++++
--- /var/tmp/diff_new_pack.wJlK2g/_old  2018-10-02 19:39:30.946379403 +0200
+++ /var/tmp/diff_new_pack.wJlK2g/_new  2018-10-02 19:39:30.950379396 +0200
@@ -258,6 +258,7 @@
 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
 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
 Patch236:       grub2-efi_gop-avoid-low-resolution.patch
@@ -548,6 +549,7 @@
 %patch214 -p1
 %patch215 -p1
 %patch216 -p1
+%patch217 -p1
 %patch233 -p1
 %patch234 -p1
 %patch236 -p1


++++++ grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch ++++++
From: Diego Domingos <[email protected]>
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

This patch enables the fcp-targets and fcp-luns methods which are
responsible to get WWPNs and LUNs for fibre channel devices.

Those methods are specially necessary if the boot directory and grub
installation are in different FCP disks, allowing the dev_iterate()
to find the WWPNs and LUNs when called by searchfs.uuid tool.

Signed-off-by: Diego Domingos <[email protected]>
---
 grub-core/disk/ieee1275/ofdisk.c | 89 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 88 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)
 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 
+        * to find the WWPNs and LUNs to iterate them */
+       grub_ieee1275_ihandle_t ihandle;
+       grub_uint64_t *ptr_targets, *ptr_luns;
+       unsigned int i, j, pos;
+       char *buf, *bufptr;
+
+       struct set_fcp_targets_args
+       {
+               struct grub_ieee1275_common_hdr common;
+               grub_ieee1275_cell_t method;
+               grub_ieee1275_cell_t ihandle;
+               grub_ieee1275_cell_t catch_result;
+               grub_ieee1275_cell_t nentries;
+               grub_ieee1275_cell_t table;
+       } args_targets;
+
+       struct set_fcp_luns_args
+       {
+               struct grub_ieee1275_common_hdr common;
+               grub_ieee1275_cell_t method;
+               grub_ieee1275_cell_t ihandle;
+               grub_ieee1275_cell_t wwpn_h;
+               grub_ieee1275_cell_t wwpn_l;
+               grub_ieee1275_cell_t catch_result;
+               grub_ieee1275_cell_t nentries;
+               grub_ieee1275_cell_t table;
+       } args_luns;
+
+       grub_ieee1275_open (alias->path, &ihandle);
+
+       INIT_IEEE1275_COMMON (&args_targets.common, "call-method", 2, 3);
+       args_targets.method = (grub_ieee1275_cell_t) "fcp-targets";
+       args_targets.ihandle = ihandle;
+       args_targets.table = 0;
+       args_targets.nentries = 0;
+
+       INIT_IEEE1275_COMMON (&args_luns.common, "call-method", 4, 3);
+       args_luns.method = (grub_ieee1275_cell_t) "fcp-luns";
+       args_luns.ihandle = ihandle;
+       args_luns.table = 0;
+       args_luns.nentries = 0;
+
+       IEEE1275_CALL_ENTRY_FN (&args_targets);
+
+       buf = grub_malloc (grub_strlen (alias->path) + 32 + 32);
+
+       if (!buf)
+               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,
+                                               *ptr_targets++);
+                       IEEE1275_CALL_ENTRY_FN (&args_luns);
+                       ptr_luns = *(grub_uint64_t **) (args_luns.table);
+
+                       for(j=0;j<args_luns.nentries; j++){
+                               ptr_luns = *(grub_uint64_t **) (args_luns.table 
+ 4 + 8*j);
+
+                               do {
+                                       if (*ptr_luns == 0){
+                                               dev_iterate_real(buf,buf);
+                                               continue;
+                                       }
+                                       grub_snprintf (&bufptr[pos], 30, ",%" 
PRIxGRUB_UINT64_T,
+                                                       *ptr_luns++);
+                                       dev_iterate_real(buf,buf);
+                               } while(*ptr_luns);
+                       }
+               }
+       }
+
+  grub_ieee1275_close (ihandle);
+  grub_free (buf);
+  return;
+
+  }
+  else if (grub_strcmp (alias->type, "vscsi") == 0)
     {
       static grub_ieee1275_ihandle_t ihandle;
       struct set_color_args


Reply via email to