* kern/sparc64/ieee1275/init.c (grub_machine_set_prefix): If

lettered partition specifier is found, convert to numbered.
This commit is contained in:
davem 2009-04-30 13:17:10 +00:00
parent e2bf39b2d7
commit ac8a2baae4
2 changed files with 17 additions and 1 deletions

View file

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