diff --git a/ChangeLog b/ChangeLog index d0df5dc68..9097f250f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-04-30 David S. Miller + * util/hostdisk.c (device_is_wholedisk): New function. + (grub_util_biosdisk_get_grub_dev): Shortcut when hdg.start is + zero only if device_is_wholedisk() returns true. + * util/hostdisk.c (convert_system_partition_to_system_disk): Handle virtual disk devices named /dev/vdiskX as found on sparc and powerpc. diff --git a/util/hostdisk.c b/util/hostdisk.c index af93f9759..eaccb73dc 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -833,6 +833,16 @@ convert_system_partition_to_system_disk (const char *os_dev) #endif } +static int +device_is_wholedisk (const char *os_dev) +{ + int len = strlen (os_dev); + + if (os_dev[len - 1] < '0' || os_dev[len - 1] > '9') + return 1; + return 0; +} + static int find_system_device (const char *os_dev) { @@ -968,7 +978,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) grub_util_info ("%s starts from %lu", os_dev, hdg.start); - if (hdg.start == 0) + if (hdg.start == 0 && device_is_wholedisk (os_dev)) return name; grub_util_info ("opening the device %s", name);