From 5ac9679fb0fef76d4dc7000f00ce76cb0d3577af Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 24 Jun 2006 14:05:38 +0000 Subject: [PATCH] 2006-06-24 Robert Millan * lib/device.c (get_i2o_disk_name): New function. (init_device_map) [__linux__]: Add support for I2O devices. --- ChangeLog | 5 +++++ lib/device.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/ChangeLog b/ChangeLog index 526021934..e3f83b7e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-06-24 Robert Millan + + * lib/device.c (get_i2o_disk_name): New function. + (init_device_map) [__linux__]: Add support for I2O devices. + 2006-05-02 Pavel Roskin * stage2/stage2.c (run_menu): Fix "savedefault" to save only top diff --git a/lib/device.c b/lib/device.c index d0663b396..5774291c6 100644 --- a/lib/device.c +++ b/lib/device.c @@ -407,6 +407,12 @@ get_ataraid_disk_name (char *name, int unit) { 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 /* 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 */ + { + 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__ */ /* OK, close the device map file if opened. */