Bug#265027: Solution.

Piotr Roszatycki Piotr Roszatycki <Piotr_Roszatycki@netia.net.pl>, 265027@bugs.debian.org
Wed, 6 Oct 2004 13:56:28 +0200


--Boundary-00=_s19YBJhYaaQioU2
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

tag 265027 patch
thanks

On Friday 01 of October 2004 21:08, Robert Millan wrote:
> On Tue, Sep 28, 2004 at 01:15:58PM +0200, Piotr Roszatycki wrote:
> > I'd like to patch the grub and upload to sarge. This is serious bug for
> > me, at least on Compaq servers.
>
> Sorry for the delay.  We need more help to keep up with GRUB maintainance
> (see RFH #248397).
>
> Please could you provide a patch against the Debian package?  I think I can
> merge both this and cciss in upstream and Debian.

I've attached the patch which replaces patches/raid_cciss.diff. It seems is 
working correctly.

-- 
 .''`.    Piotr Roszatycki, Netia SA
: :' :    mailto:Piotr_Roszatycki@netia.net.pl
`. `'     mailto:dexter@debian.org
  `-

--Boundary-00=_s19YBJhYaaQioU2
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="raid_cciss+ida.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="raid_cciss+ida.diff"

diff -ru grub-0.95+cvs20040624/lib/device.c grub-0.95+cvs20040624.debian/lib/device.c
--- grub-0.95+cvs20040624/lib/device.c	2004-05-23 18:45:35 +0200
+++ grub-0.95+cvs20040624.debian/lib/device.c	2004-10-06 13:43:44 +0200
@@ -403,6 +403,18 @@
 }
 
 static void
+get_cciss_disk_name (char *name, int controller, int drive)
+{
+  sprintf (name, "/dev/cciss/c%dd%d", controller, drive);
+}
+
+static void
+get_ida_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');
@@ -798,6 +810,74 @@
 	  }
       }
   }
+
+  /* This is for CCISS, its like the DAC960  - we have
+     /dev/cciss/<controller>d<logical drive>p<partition> 
+
+     It currently supports up to 3 controllers, 10 logical volumes
+     and 10 partitions
+
+     Code gratuitously copied from DAC960 above.
+     Horms <horms@verge.net.au> 23rd July 2004
+  */
+  {
+    int controller, drive;
+    
+    for (controller = 0; controller < 2; controller++)
+      {
+	for (drive = 0; drive < 9; 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++;
+	      }
+	  }
+      }
+  }
+
+  /* This is for Compaq Smart Array, its like the DAC960  - we have
+     /dev/ida/<controller>d<logical drive>p<partition> 
+
+     It currently supports up to 3 controllers, 10 logical volumes
+     and 15 partitions
+
+     Code gratuitously copied from DAC960 above.
+     Piotr Roszatycki <dexter@debian.org>
+  */
+  {
+    int controller, drive;
+    
+    for (controller = 0; controller < 2; controller++)
+      {
+	for (drive = 0; drive < 9; drive++)
+	  {
+	    char name[24];
+	    
+	    get_ida_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.  */

--Boundary-00=_s19YBJhYaaQioU2--