]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/ieee1275/ofpath.c (grub_util_devname_to_ofpath): Use the
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 12 Jan 2011 18:58:32 +0000 (19:58 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 12 Jan 2011 18:58:32 +0000 (19:58 +0100)
realpath'ed device string.
Handle floppy (somewhat).
Issue error in unknown case rather than garbage.
Reported by: Axel Beckert.

ChangeLog
util/ieee1275/ofpath.c

index 74c6affff1c8137ddce3eb4c32d2dcb4418e4dc6..7a3f3f63a39ef83e001937b4754bc38b24b8870c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index fa0d48cf9568d7689f1fb78659c91eddb0b32e8f..1a433345d7bdf0921ed243737b5404bda520a2f8 100644 (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);