Bug#290098: grub: doesn't work with cciss and others

Guido Guenther Guido Guenther <agx@debian.org>, 290098@bugs.debian.org
Wed, 12 Jan 2005 18:27:33 +0100


--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: grub
Severity: important
Version: 0.95+cvs20040624-12

Hi,
many devices (cciss, ida) name partitions like
<disk>p<part_number> instead of <disk><part_number> (note the extra p).
Grub then fails when calling e.g. 'setup (hd0)'.  This patch fixes the
problem for cciss, ataraid, ida and others. 
Taken from fedora core 3.
Cheers,
 -- Guido

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: powerpc (ppc)
Kernel: Linux 2.6.10-agx0
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="grub-special_device_names.diff"

--- tmp/grub-0.95+cvs20040624/lib/device.c	2004-05-23 18:45:35.000000000 +0200
+++ grub-0.95+cvs20040624/lib/device.c	2005-01-12 18:19:14.000000000 +0100
@@ -858,8 +938,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);
   if (fd < 0)

--Kj7319i9nmIyA2yE--