clone 479056 -1
retitle 479056 support for virtio devices (mixed up with cciss stuff)
retitle -1 support for CCISS devices
thanks

On Fri, May 02, 2008 at 10:37:32PM -0700, Roland Dreier wrote:
> I have a similar problem with [...]

Next time, please don't add stuff to another bug just because it's similar.
File a new one instead.

> HP DL380 servers with a RAID controller
> that uses the "cciss" driver.  Disks show up under /dev/cciss like:
> 
>     /dev/cciss/c0d0p6 on / type ext3 (rw,errors=remount-ro)
> 
> And since grub no longer understands that, grub-mkdevicemap leaves me
> with an empty device.map and I get
> 
>     grub-probe: error: Cannot find a GRUB drive for /dev/cciss/c0d0p6.  Check 
> your device.map.
> 
> from update-grub.

Could you use the attached patch on grub-common, and report?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/biosdisk.c ./util/biosdisk.c
--- ../grub2/util/biosdisk.c	2008-04-07 18:45:01.000000000 +0200
+++ ./util/biosdisk.c	2008-05-06 13:36:36.000000000 +0200
@@ -233,7 +233,7 @@ linux_find_partition (char *dev, unsigne
       p = real_dev + 8;
       format = "%d";
     }
-  else if (strncmp (real_dev + 5, "rd/c", 4) == 0)
+  else if (strncmp (real_dev + 5, "rd/c", 4) == 0)	/* dac960 */
     {
       p = strchr (real_dev + 9, 'd');
       if (! p)
@@ -245,6 +245,18 @@ linux_find_partition (char *dev, unsigne
 
       format = "p%d";
     }
+  else if (strncmp (real_dev + 5, "cciss/c", sizeof("cciss/c")-1) == 0)
+    {
+      p = strchr (real_dev + 5 + sizeof("cciss/c")-1, 'd');
+      if (! p)
+	return 0;
+
+      p++;
+      while (*p && isdigit (*p))
+	p++;
+
+      format = "p%d";
+    }
   else
     return 0;
 
diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp ../grub2/util/grub-mkdevicemap.c ./util/grub-mkdevicemap.c
--- ../grub2/util/grub-mkdevicemap.c	2008-05-06 12:10:08.000000000 +0200
+++ ./util/grub-mkdevicemap.c	2008-05-06 13:37:28.000000000 +0200
@@ -283,6 +283,12 @@ get_i2o_disk_name (char *name, char unit
 {
   sprintf (name, "/dev/i2o/hd%c", unit);
 }
+
+static void
+get_cciss_disk_name (char *name, int controller, int drive)
+{
+  sprintf (name, "/dev/cciss/c%dd%d", controller, drive);
+}
 #endif
 
 /* Check if DEVICE can be read. If an error occurs, return zero,
@@ -504,6 +510,30 @@ make_device_map (const char *device_map,
       }
   }
     
+  /* This is for CCISS - we have
+     /dev/cciss/c<controller>d<logical drive>p<partition>.  */
+  {
+    int controller, drive;
+    
+    for (controller = 0; controller < 3; controller++)
+      {
+	for (drive = 0; drive < 10; drive++)
+	  {
+	    char name[24];
+	    
+	    get_cciss_disk_name (name, controller, drive);
+	    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++;
+	      }
+	  }
+      }
+  }
+    
   /* This is for I2O - we have /dev/i2o/hd<logical drive><partition> */
   {
     char unit;

Reply via email to