[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #14903] /dev/i2o/hda does not have any corresponding BIOS drive
From: |
Peter Jones |
Subject: |
Re: [bug #14903] /dev/i2o/hda does not have any corresponding BIOS drive. |
Date: |
Wed, 02 Nov 2005 14:10:23 -0500 |
On Wed, 2005-11-02 at 17:57 +0000, anonymous wrote:
> If I do grub-install /dev/i2o/hda, however, I get this:
> /dev/i2o/hda does not have any corresponding BIOS drive.
>
> As it was able to boot with RH9, there should be something wrong... is it a
> bug or am I doing some mistake?
We have a patch for i2o, and several other drivers that present devices
with nonstandard names, in our grub package. The patch, which is
against a somewhat heavily patched grub 0.95, is below. YMMV.
--- grub-0.95/lib/device.c.weirdblock 2004-05-23 12:34:29.000000000 -0400
+++ grub-0.95/lib/device.c 2005-11-02 14:06:07.000000000 -0500
@@ -403,10 +403,27 @@
}
static void
+get_cciss_disk_name (char * name, int controller, int drive)
+{
+ sprintf (name, "/dev/cciss/c%dd%d", controller, drive);
+}
+
+static void
+get_cpqarray_disk_name (char * name, int controller, int drive)
+{
+ sprintf (name, "/dev/ida/c%dd%d", controller, drive);
+}
+static void
get_ataraid_disk_name (char *name, int unit)
{
sprintf (name, "/dev/ataraid/d%c", unit + '0');
}
+
+static void
+get_i2o_disk_name (char *name, int unit)
+{
+ sprintf (name, "/dev/i2o/hd%c", unit + 'a');
+}
#endif
/* Check if DEVICE can be read. If an error occurs, return zero,
@@ -779,7 +796,7 @@
for (controller = 0; controller < 8; controller++)
{
- for (drive = 0; drive < 15; drive++)
+ for (drive = 0; drive < 32; drive++)
{
char name[24];
@@ -798,6 +815,90 @@
}
}
}
+
+ /* I2O disks. */
+ for (i = 0; i < 8; i++)
+ {
+ char name[16];
+
+ get_i2o_disk_name (name, i);
+ 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__ */
+
+#ifdef __linux__
+ /* This is for cciss - we have
+ /dev/cciss/c<controller>d<logical drive>p<partition>.
+
+ cciss driver currently supports up to 8 controllers, 16 logical
+ drives, and 7 partitions. */
+ {
+ int controller, drive;
+
+ for (controller = 0; controller < 8; controller++)
+ {
+ for (drive = 0; drive < 16; drive++)
+ {
+ char name[24];
+
+ get_cciss_disk_name (name, controller, drive);
+ 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__ */
+
+#ifdef __linux__
+ /* This is for cpqarray - we have
+ /dev/ida/c<controller>d<logical drive>p<partition>.
+
+ cpqarray driver currently supports up to 8 controllers, 16 logical
+ drives, and 15 partitions. */
+ {
+ int controller, drive;
+
+ for (controller = 0; controller < 8; controller++)
+ {
+ for (drive = 0; drive < 15; drive++)
+ {
+ char name[24];
+
+ get_cpqarray_disk_name (name, controller, drive);
+ 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. */
@@ -858,7 +959,14 @@
if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
strcpy (dev + strlen(dev) - 5, "/part");
}
- sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
+
+ sprintf (dev + strlen(dev), "%s%d",
+ /* Compaq smart and others */
+ (strncmp(dev, "/dev/ida/", 9) == 0 ||
+ strncmp(dev, "/dev/ataraid/", 13) == 0 ||
+ strncmp(dev, "/dev/cciss/", 11) == 0 ||
+ strncmp(dev, "/dev/rd/", 8) == 0) ? "p" : "",
+ ((partition >> 16) & 0xFF) + 1);
/* Open the partition. */
fd = open (dev, O_RDWR);
--
Peter