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