All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: Handle lettered OF path partitions on sparc64.
@ 2009-04-30 13:18 David Miller
  0 siblings, 0 replies; only message in thread
From: David Miller @ 2009-04-30 13:18 UTC (permalink / raw)
  To: grub-devel


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  <davem@davemloft.net>

	* 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)



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-30 13:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-30 13:18 [PATCH]: Handle lettered OF path partitions on sparc64 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.