+2011-01-12 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Use alias->path rather than buggy "canon".
+
+ * grub-core/disk/ieee1275/ofdisk.c (ofdisk_hash_add_real): New function.
+ (ofdisk_hash_add): New argument curcan. All users updated.
+
2011-01-11 Colin Watson <cjwatson@ubuntu.com>
* configure.ac: Fall back to `true' if `makeinfo' does not exist.
}
static struct ofdisk_hash_ent *
-ofdisk_hash_add (char *devpath)
+ofdisk_hash_add_real (char *devpath)
{
+ struct ofdisk_hash_ent *p;
struct ofdisk_hash_ent **head = &ofdisk_hash[ofdisk_hash_fn(devpath)];
- struct ofdisk_hash_ent *p, *pcan;
- char *curcan;
p = grub_malloc(sizeof (*p));
if (!p)
p->next = *head;
p->shortest = 0;
*head = p;
+ return p;
+}
+
+static struct ofdisk_hash_ent *
+ofdisk_hash_add (char *devpath, char *curcan)
+{
+ struct ofdisk_hash_ent *p, *pcan;
+
+ p = ofdisk_hash_add_real (devpath);
+
+ grub_dprintf ("disk", "devpath = %s, canonical = %s\n", devpath, curcan);
- curcan = grub_ieee1275_canonicalise_devname (devpath);
if (!curcan)
{
- grub_errno = GRUB_ERR_NONE;
+ p->shortest = devpath;
return p;
}
pcan = ofdisk_hash_find (curcan);
if (!pcan)
- pcan = ofdisk_hash_add (curcan);
+ pcan = ofdisk_hash_add_real (curcan);
else
grub_free (curcan);
return 0;
grub_dprintf ("disk", "disk name = %s\n", alias->name);
+ grub_dprintf ("disk", "disk name = %s, path = %s\n", alias->name,
+ alias->path);
- op = ofdisk_hash_find (alias->path);
+ op = ofdisk_hash_find (alias->name);
if (!op)
{
char *name = grub_strdup (alias->name);
- if (!name)
+ char *can = grub_strdup (alias->path);
+ if (!name || !can)
{
grub_errno = GRUB_ERR_NONE;
+ grub_free (name);
+ grub_free (can);
return 0;
}
- op = ofdisk_hash_add (name);
+ op = ofdisk_hash_add (name, can);
}
return 0;
}
struct ofdisk_hash_ent *op;
op = ofdisk_hash_find (devpath);
if (!op)
- op = ofdisk_hash_add (devpath);
+ op = ofdisk_hash_add (devpath, NULL);
else
grub_free (devpath);
if (!op)