* util/ieee1275/ofpath.c (grub_util_devname_to_ofpath): Use the

realpath'ed device string.
	Handle floppy (somewhat).
	Issue error in unknown case rather than garbage.
	Reported by: Axel Beckert.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-01-12 19:58:32 +01:00
parent 173b71e9fe
commit 0b5e127b0d
2 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,11 @@
2011-01-12 Vladimir Serbinenko <phcoder@gmail.com>
* util/ieee1275/ofpath.c (grub_util_devname_to_ofpath): Use the
realpath'ed device string.
Handle floppy (somewhat).
Issue error in unknown case rather than garbage.
Reported by: Axel Beckert.
2011-01-12 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub.d/00_header.in (load_video): Handle the case when no video

View File

@ -377,8 +377,8 @@ grub_util_devname_to_ofpath (const char *devname)
if (! name_buf)
grub_util_error ("cannot get the real path of `%s'", devname);
device = get_basename (devname);
devnode = strip_trailing_digits (devname);
device = get_basename (name_buf);
devnode = strip_trailing_digits (name_buf);
devicenode = strip_trailing_digits (device);
ofpath = xmalloc (OF_PATH_MAX);
@ -391,6 +391,13 @@ grub_util_devname_to_ofpath (const char *devname)
else if (device[0] == 'v' && device[1] == 'd' && device[2] == 'i'
&& device[3] == 's' && device[4] == 'k')
of_path_of_vdisk(ofpath, name_buf, device, devnode, devicenode);
else if (device[0] == 'f' && device[1] == 'd'
&& device[2] == '0' && device[3] == '\0')
/* All the models I've seen have a devalias "floppy".
New models have no floppy at all. */
strcpy (ofpath, "floppy");
else
grub_util_error ("unknown device type %s\n", device);
free (devnode);
free (devicenode);