diff --git a/ChangeLog b/ChangeLog index 63b4fe5c0..447231df6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-25 Vladimir Serbinenko + + * grub-core/disk/ieee1275/ofdisk.c (scan): Fix improper use of device + name as if it was an alias. + 2012-02-25 Vladimir Serbinenko * grub-core/commands/lsacpi.c (options): Fix typo. diff --git a/grub-core/disk/ieee1275/ofdisk.c b/grub-core/disk/ieee1275/ofdisk.c index 80bc06a45..56fed0a6a 100644 --- a/grub-core/disk/ieee1275/ofdisk.c +++ b/grub-core/disk/ieee1275/ofdisk.c @@ -115,26 +115,24 @@ ofdisk_hash_add (char *devpath, char *curcan) static void scan (void) { - auto int dev_iterate (struct grub_ieee1275_devalias *alias); + auto int dev_iterate_real (struct grub_ieee1275_devalias *alias, + int use_name); - int dev_iterate (struct grub_ieee1275_devalias *alias) + int dev_iterate_real (struct grub_ieee1275_devalias *alias, int use_name) { struct ofdisk_hash_ent *op; - grub_dprintf ("disk", "device name = %s type = %s\n", alias->name, - alias->type); if (grub_strcmp (alias->type, "block") != 0) 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->name); + op = ofdisk_hash_find (alias->path); if (!op) { - char *name = grub_strdup (alias->name); + char *name = grub_strdup (use_name ? alias->name : alias->path); char *can = grub_strdup (alias->path); if (!name || !can) { @@ -148,7 +146,19 @@ scan (void) return 0; } - grub_devalias_iterate (dev_iterate); + auto int dev_iterate_alias (struct grub_ieee1275_devalias *alias); + int dev_iterate_alias (struct grub_ieee1275_devalias *alias) + { + return dev_iterate_real (alias, 1); + } + + auto int dev_iterate (struct grub_ieee1275_devalias *alias); + int dev_iterate (struct grub_ieee1275_devalias *alias) + { + return dev_iterate_real (alias, 0); + } + + grub_devalias_iterate (dev_iterate_alias); grub_ieee1275_devices_iterate (dev_iterate); }