bc092b9
From f8679cedff703b437171f4708d46adbfcff80a65 Mon Sep 17 00:00:00 2001
bc092b9
From: Eric Snowberg <eric.snowberg@oracle.com>
bc092b9
Date: Thu, 18 May 2017 17:10:22 -0600
bbc6a89
Subject: [PATCH 042/192] sparc64: Don't use devspec to determine the OBP path
bc092b9
bc092b9
Don't use devspec to determine the OBP path on SPARC hardware.  Within all
bc092b9
versions of Linux on SPARC, the devspec returns one of three values:
bc092b9
"none", "vnet-port", or "vdisk".  Unlike on PPC, none of these values
bc092b9
are useful in determining the OBP path.
bc092b9
bc092b9
Before this patch grub-ofpathname always returned the wrong value
bc092b9
for a virtual disk. For example:
bc092b9
bc092b9
% grub-ofpathname /dev/vdiskc2
bc092b9
vdisk/disk@2:b
bc092b9
bc092b9
After this patch it now returns the correct value:
bc092b9
bc092b9
% grub-ofpathname /dev/vdiskc2
bc092b9
/virtual-devices@100/channel-devices@200/disk@2:b
bc092b9
bc092b9
Orabug: 24459765
bc092b9
bc092b9
Signed-off-by: Eric Snowberg <eric.snowberg@oracle.com>
bc092b9
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
bc092b9
---
bc092b9
 grub-core/osdep/linux/ofpath.c | 3 +++
bc092b9
 1 file changed, 3 insertions(+)
bc092b9
bc092b9
diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c
bc092b9
index a79682a5e..dce4e59d0 100644
bc092b9
--- a/grub-core/osdep/linux/ofpath.c
bc092b9
+++ b/grub-core/osdep/linux/ofpath.c
bc092b9
@@ -120,6 +120,8 @@ find_obppath (const char *sysfs_path_orig)
bc092b9
 #endif
bc092b9
 
bc092b9
       fd = open(path, O_RDONLY);
bc092b9
+
bc092b9
+#ifndef __sparc__
bc092b9
       if (fd < 0 || fstat (fd, &st) < 0)
bc092b9
 	{
bc092b9
 	  if (fd >= 0)
bc092b9
@@ -127,6 +129,7 @@ find_obppath (const char *sysfs_path_orig)
bc092b9
 	  snprintf(path, path_size, "%s/devspec", sysfs_path);
bc092b9
 	  fd = open(path, O_RDONLY);
bc092b9
 	}
bc092b9
+#endif
bc092b9
 
bc092b9
       if (fd < 0 || fstat (fd, &st) < 0)
bc092b9
 	{
bc092b9
-- 
bbc6a89
2.13.4
bc092b9