2006-06-24 Robert Millan <robertmh@gnu.org>

* lib/device.c (get_i2o_disk_name): New function.
        (init_device_map) [__linux__]: Add support for I2O devices.
This commit is contained in:
robertmh 2006-06-24 14:05:38 +00:00
parent 7a1b51024a
commit 5ac9679fb0
2 changed files with 34 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2006-06-24 Robert Millan <robertmh@gnu.org>
* lib/device.c (get_i2o_disk_name): New function.
(init_device_map) [__linux__]: Add support for I2O devices.
2006-05-02 Pavel Roskin <proski@gnu.org> 2006-05-02 Pavel Roskin <proski@gnu.org>
* stage2/stage2.c (run_menu): Fix "savedefault" to save only top * stage2/stage2.c (run_menu): Fix "savedefault" to save only top

View file

@ -407,6 +407,12 @@ get_ataraid_disk_name (char *name, int unit)
{ {
sprintf (name, "/dev/ataraid/d%c", unit + '0'); sprintf (name, "/dev/ataraid/d%c", unit + '0');
} }
static void
get_i2o_disk_name (char *name, char unit)
{
sprintf (name, "/dev/i2o/hd%c", unit);
}
#endif #endif
/* Check if DEVICE can be read. If an error occurs, return zero, /* Check if DEVICE can be read. If an error occurs, return zero,
@ -801,6 +807,29 @@ init_device_map (char ***map, const char *map_file, int floppy_disks)
} }
} }
} }
/* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */
{
int unit;
for (unit = 'a'; unit < 'f'; unit++)
{
char name[24];
get_i2o_disk_name (name, unit);
if (check_device (name))
{
(*map)[num_hd + 0x80] = strdup (name);
assert ((*map)[num_hd + 0x80]);
/* If the device map file is opened, write the map. */
if (fp)
fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
num_hd++;
}
}
}
#endif /* __linux__ */ #endif /* __linux__ */
/* OK, close the device map file if opened. */ /* OK, close the device map file if opened. */