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

* util/biosdisk.c (linux_find_partition, get_os_disk): Handle MMC
        devices.
        * util/grub-mkdevicemap.c (get_mmc_disk_name)
        (make_device_map): Likewise.
This commit is contained in:
robertmh 2008-05-28 19:53:25 +00:00
parent 887d2619bf
commit 23023641b8
3 changed files with 46 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2008-05-28 Robert Millan <rmh@aybabtu.com>
* util/biosdisk.c (linux_find_partition, get_os_disk): Handle MMC
devices.
* util/grub-mkdevicemap.c (get_mmc_disk_name)
(make_device_map): Likewise.
2008-05-20 Bean <bean123ch@gmail.com>
* fs/fshelp.c (grub_fshelp_map_block): New function.

View file

@ -239,7 +239,7 @@ linux_find_partition (char *dev, unsigned long sector)
|| strncmp (real_dev + 5, "sd", 2) == 0)
&& real_dev[7] >= 'a' && real_dev[7] <= 'z')
{
p = real_dev + 8;
p = real_dev + sizeof("/dev/hda")-1;
format = "%d";
}
else if (strncmp (real_dev + 5, "rd/c", 4) == 0) /* dac960 */
@ -266,6 +266,11 @@ linux_find_partition (char *dev, unsigned long sector)
format = "p%d";
}
else if (strncmp (real_dev + 5, "mmcblk", sizeof("mmcblk")-1) == 0)
{
p = real_dev + sizeof("/dev/mmcblk0")-1;
format = "p%d";
}
else
return 0;
@ -675,6 +680,17 @@ get_os_disk (const char *os_dev)
return path;
}
/* If this is a MultiMediaCard (MMC). */
if (strncmp ("mmcblk", p, sizeof ("mmcblk") - 1) == 0)
{
/* /dev/mmcblk[0-9]+(p[0-9]+)? */
p = strchr (p, 'p');
if (p)
*p = '\0';
return path;
}
/* If this is an IDE, SCSI or Virtio disk. */
if ((strncmp ("hd", p, 2) == 0
|| strncmp ("vd", p, 2) == 0

View file

@ -296,6 +296,12 @@ get_cciss_disk_name (char *name, int controller, int drive)
sprintf (name, "/dev/cciss/c%dd%d", controller, drive);
}
static void
get_mmc_disk_name (char *name, int unit)
{
sprintf (name, "/dev/mmcblk%d", unit);
}
static void
get_xvd_disk_name (char *name, int unit)
{
@ -598,6 +604,22 @@ make_device_map (const char *device_map, int floppy_disks)
}
}
/* MultiMediaCard (MMC). */
for (i = 0; i < 10; i++)
{
char name[16];
get_mmc_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++;
}
}
finish:
#endif /* __linux__ */