Received: from list by lists.gnu.org with archive (Exim 4.71) id 1dBUZE-0000Lh-Tx for mharc-grub-devel@gnu.org; Thu, 18 May 2017 19:10:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBUZD-0000La-6b for grub-devel@gnu.org; Thu, 18 May 2017 19:10:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBUZ8-00064i-7H for grub-devel@gnu.org; Thu, 18 May 2017 19:10:47 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:28034) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dBUZ7-00062M-U6 for grub-devel@gnu.org; Thu, 18 May 2017 19:10:42 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v4INAbRd020494 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2017 23:10:37 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v4INAaTe021407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 18 May 2017 23:10:37 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id v4INAaPr028931; Thu, 18 May 2017 23:10:36 GMT Received: from brm-t84-02.us.oracle.com (/10.80.150.81) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 18 May 2017 16:10:36 -0700 From: Eric Snowberg To: grub-devel@gnu.org Cc: phcoder@gmail.com, daniel.kiper@oracle.com Subject: [PATCH] sparc64: Don't use devspec to determine the OBP path Date: Thu, 18 May 2017 17:10:22 -0600 Message-Id: <1495149022-744961-1-git-send-email-eric.snowberg@oracle.com> X-Mailer: git-send-email 1.7.1 X-Source-IP: userv0021.oracle.com [156.151.31.71] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy] X-Received-From: 156.151.31.81 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 May 2017 23:10:48 -0000 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 --- grub-core/osdep/linux/ofpath.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/grub-core/osdep/linux/ofpath.c b/grub-core/osdep/linux/ofpath.c index a79682a..3a8bc95 100644 --- a/grub-core/osdep/linux/ofpath.c +++ b/grub-core/osdep/linux/ofpath.c @@ -120,6 +120,7 @@ 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) @@ -128,6 +129,7 @@ find_obppath (const char *sysfs_path_orig) fd = open(path, O_RDONLY); } +#endif if (fd < 0 || fstat (fd, &st) < 0) { if (fd >= 0) -- 1.7.1