2007-08-28 Robert Millan <rmh@aybabtu.com>
* util/i386/get_disk_name.c: New. Implement grub_util_get_disk_name() to tell grub-mkdevicemap how to name devices. * util/ieee1275/get_disk_name.c: Likewise (using "ofpathname -a" feature). * conf/i386-efi.rmk (grub_mkdevicemap_SOURCES): Add util/i386/get_disk_name.c. * conf/i386-pc.rmk (grub_mkdevicemap_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_mkdevicemap_SOURCES): Add util/ieee1275/get_disk_name.c. * include/grub/util/misc.h: grub_util_get_disk_name() declaration. * DISTLIST: Add util/i386/get_disk_name.c and util/ieee1275/get_disk_name.c. * util/grub-mkdevicemap.c: Replace device naming logic with grub_util_get_disk_name() calls.
This commit is contained in:
parent
5a0d3cca6d
commit
29d0928cd7
7 changed files with 54 additions and 9 deletions
|
@ -402,8 +402,11 @@ make_device_map (const char *device_map, int floppy_disks)
|
|||
|
||||
if (realpath (discn, name))
|
||||
{
|
||||
char *p;
|
||||
strcat (name, "/disc");
|
||||
fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
|
||||
p = grub_util_get_disk_name (num_hd, name);
|
||||
fprintf (fp, "(%s)\t%s\n", p, name);
|
||||
free (p);
|
||||
}
|
||||
|
||||
num_hd++;
|
||||
|
@ -421,7 +424,10 @@ make_device_map (const char *device_map, int floppy_disks)
|
|||
get_ide_disk_name (name, i);
|
||||
if (check_device (name))
|
||||
{
|
||||
fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
|
||||
char *p;
|
||||
p = grub_util_get_disk_name (num_hd, name);
|
||||
fprintf (fp, "(%s)\t%s\n", p, name);
|
||||
free (p);
|
||||
num_hd++;
|
||||
}
|
||||
}
|
||||
|
@ -435,7 +441,10 @@ make_device_map (const char *device_map, int floppy_disks)
|
|||
get_ataraid_disk_name (name, i);
|
||||
if (check_device (name))
|
||||
{
|
||||
fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
|
||||
char *p;
|
||||
p = grub_util_get_disk_name (num_hd, name);
|
||||
fprintf (fp, "(%s)\t%s\n", p, name);
|
||||
free (p);
|
||||
num_hd++;
|
||||
}
|
||||
}
|
||||
|
@ -449,7 +458,10 @@ make_device_map (const char *device_map, int floppy_disks)
|
|||
get_scsi_disk_name (name, i);
|
||||
if (check_device (name))
|
||||
{
|
||||
fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
|
||||
char *p;
|
||||
p = grub_util_get_disk_name (num_hd, name);
|
||||
fprintf (fp, "(%s)\t%s\n", p, name);
|
||||
free (p);
|
||||
num_hd++;
|
||||
}
|
||||
}
|
||||
|
@ -472,7 +484,10 @@ make_device_map (const char *device_map, int floppy_disks)
|
|||
get_dac960_disk_name (name, controller, drive);
|
||||
if (check_device (name))
|
||||
{
|
||||
fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
|
||||
char *p;
|
||||
p = grub_util_get_disk_name (num_hd, name);
|
||||
fprintf (fp, "(%s)\t%s\n", p, name);
|
||||
free (p);
|
||||
num_hd++;
|
||||
}
|
||||
}
|
||||
|
@ -490,7 +505,10 @@ make_device_map (const char *device_map, int floppy_disks)
|
|||
get_i2o_disk_name (name, unit);
|
||||
if (check_device (name))
|
||||
{
|
||||
fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
|
||||
char *p;
|
||||
p = grub_util_get_disk_name (num_hd, name);
|
||||
fprintf (fp, "(%s)\t%s\n", p, name);
|
||||
free (p);
|
||||
num_hd++;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue