2008-05-09 Robert Millan <rmh@aybabtu.com>

* util/biosdisk.c (linux_find_partition, get_os_disk): Handle Virtio
        devices.
        * util/grub-mkdevicemap.c (get_virtio_disk_name)
        (make_device_map): Likewise.
        Reported by Aurelien Jarno <aurel32@debian.org>
This commit is contained in:
robertmh 2008-05-09 12:13:03 +00:00
parent ed7593907d
commit 1cf4059a49
3 changed files with 34 additions and 2 deletions

View file

@ -266,6 +266,12 @@ get_scsi_disk_name (char *name, int unit)
}
#ifdef __linux__
static void
get_virtio_disk_name (char *name, int unit)
{
sprintf (name, "/dev/vd%c", unit + 'a');
}
static void
get_dac960_disk_name (char *name, int controller, int drive)
{
@ -455,6 +461,22 @@ make_device_map (const char *device_map, int floppy_disks)
}
#ifdef __linux__
/* Virtio disks. */
for (i = 0; i < 20; i++)
{
char name[16];
get_virtio_disk_name (name, i);
if (check_device (name))
{
char *p;
p = grub_util_get_disk_name (num_hd, name);
fprintf (fp, "(%s)\t%s\n", p, name);
free (p);
num_hd++;
}
}
/* ATARAID disks. */
for (i = 0; i < 8; i++)
{