Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1LzW9w-0007xh-RU for mharc-grub-devel@gnu.org; Thu, 30 Apr 2009 09:18:40 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LzW9v-0007wa-BS for grub-devel@gnu.org; Thu, 30 Apr 2009 09:18:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LzW9u-0007vt-KN for grub-devel@gnu.org; Thu, 30 Apr 2009 09:18:38 -0400 Received: from [199.232.76.173] (port=48863 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzW9u-0007vb-Co for grub-devel@gnu.org; Thu, 30 Apr 2009 09:18:38 -0400 Received: from 74-93-104-97-washington.hfc.comcastbusiness.net ([74.93.104.97]:48948 helo=sunset.davemloft.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LzW9u-0007nL-1h for grub-devel@gnu.org; Thu, 30 Apr 2009 09:18:38 -0400 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id F330CC8D92C for ; Thu, 30 Apr 2009 06:18:30 -0700 (PDT) Date: Thu, 30 Apr 2009 06:18:30 -0700 (PDT) Message-Id: <20090430.061830.70128321.davem@davemloft.net> To: grub-devel@gnu.org From: David Miller X-Mailer: Mew version 6.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Subject: [PATCH]: Handle lettered OF path partitions on sparc64. X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Apr 2009 13:18:39 -0000 OpenBoot uses ":a", ":b", etc. partition specifiers instead of the numbered ":1", ":2", etc. that the generic ieee1275 code expects. Instead of cruddng up the generic ieee1275 code with this, just convert in the sparc64 specific code beforehand. Committed. 2009-04-30 David S. Miller * kern/sparc64/ieee1275/init.c (grub_machine_set_prefix): If lettered partition specifier is found, convert to numbered. diff --git a/kern/sparc64/ieee1275/init.c b/kern/sparc64/ieee1275/init.c index 5114f76..699f963 100644 --- a/kern/sparc64/ieee1275/init.c +++ b/kern/sparc64/ieee1275/init.c @@ -64,8 +64,8 @@ grub_machine_set_prefix (void) if (grub_prefix[0] != '(') { char bootpath[IEEE1275_MAX_PATH_LEN]; + char *prefix, *path, *colon; grub_ssize_t actual; - char *prefix, *path; if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, sizeof (bootpath), &actual)) @@ -77,6 +77,17 @@ grub_machine_set_prefix (void) } /* Transform an OF device path to a GRUB path. */ + colon = grub_strchr (bootpath, ':'); + if (colon) + { + char *part = colon + 1; + + /* Consistently provide numbered partitions to GRUB. + OpenBOOT traditionally uses alphabetical partition + specifiers. */ + if (part[0] >= 'a' && part[0] <= 'z') + part[0] = '1' + (part[0] - 'a'); + } prefix = grub_ieee1275_encode_devname (bootpath); path = grub_malloc (grub_strlen (grub_prefix)