okay heres the complete patch with changelog.
Okuji can you check it over and commit!

Thanks

On Fri, Aug 24, 2001 at 08:50:25AM +0200, Adrian Phillips wrote:
> Here is a patch to fix the rest, I don't have time for 2/3 weeks to
> make sure it follows the standard and write a ChangeLog so if anyone
> feels like doing that for me in the meanwhile (Jason ?) then go ahead.

-- 
Jason Thomas                           Phone:  +61 2 6257 7111
System Administrator  -  UID 0         Fax:    +61 2 6257 7311
tSA Consulting Group Pty. Ltd.         Mobile: 0418 29 66 81
1 Hall Street Lyneham ACT 2602         http://www.topic.com.au/
Index: ChangeLog
===================================================================
RCS file: /cvsroot/grub/grub/ChangeLog,v
retrieving revision 1.429
diff -u -r1.429 ChangeLog
--- ChangeLog   2001/08/08 08:00:01     1.429
+++ ChangeLog   2001/08/24 07:36:53
@@ -1,3 +1,13 @@
+2001-08-24  Jason Thomas  <[EMAIL PROTECTED]>
+       * lib/device.c: add support for DAC960 raid controller.
+       New function get_dac960_disk_name.
+       From Adrian Phillips <[EMAIL PROTECTED]>
+
+2001-08-21  Jason Thomas  <[EMAIL PROTECTED]>
+
+       * util/grub-install.in (convert): Support the device naming
+       scheme for DAC960 hardware raid controller.
+
 2001-08-08  OKUJI Yoshinori  <[EMAIL PROTECTED]>
 
        From Derrik Pates <[EMAIL PROTECTED]>:
Index: lib/device.c
===================================================================
RCS file: /cvsroot/grub/grub/lib/device.c,v
retrieving revision 1.13
diff -u -r1.13 device.c
--- lib/device.c        2001/02/28 11:19:39     1.13
+++ lib/device.c        2001/08/24 07:36:54
@@ -267,6 +267,14 @@
 #endif
 }
 
+#ifdef __linux__
+static void
+get_dac960_disk_name (char *name, int controller, int drive)
+{
+  sprintf (name, "/dev/rd/c%dd%d", controller, drive);
+}
+#endif
+
 /* Check if DEVICE can be read. If an error occurs, return zero,
    otherwise return non-zero.  */
 int
@@ -446,6 +454,9 @@
 init_device_map (char ***map, const char *map_file, int floppy_disks)
 {
   int i;
+#ifdef __linux__
+  int controller, drive;
+#endif
   int num_hd = 0;
   FILE *fp = 0;
 
@@ -576,6 +587,34 @@
          num_hd++;
        }
     }
+
+#ifdef __linux__
+  /* This is for DAC960 - we have
+        /dev/rd/c<controller>d<logical drive>p<partition>.
+
+        DAC960 driver currently supports up to 8 controllers, 32 logical
+        drives, and 7 partitions. */
+  for (controller = 0; controller < 8; controller++)
+       {
+         for (drive = 0; drive < 15; drive++)
+               {
+                 char name[24];
+
+                 get_dac960_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
   
   /* OK, close the device map file if opened.  */
   if (fp)
Index: util/grub-install.in
===================================================================
RCS file: /cvsroot/grub/grub/util/grub-install.in,v
retrieving revision 1.28
diff -u -r1.28 grub-install.in
--- util/grub-install.in        2001/07/13 11:51:24     1.28
+++ util/grub-install.in        2001/08/24 07:36:55
@@ -78,11 +78,13 @@
     linux*)
        tmp_disk=`echo "$1" | sed -e 's%\([sh]d[a-z]\)[0-9]*$%\1%' \
                                  -e 's%\(fd[0-9]*\)$%\1%' \
-                                 -e 's%/part[0-9]*$%/disc%'`
+                                 -e 's%/part[0-9]*$%/disc%' \
+                                 -e 's%\(c[0-7]d[0-9]*\).*$%\1%'`
        tmp_part=`echo "$1" | sed -e 's%.*/[sh]d[a-z]\([0-9]*\)$%\1%' \
                                  -e 's%.*/fd[0-9]*$%%' \
                                  -e 's%.*/floppy/[0-9]*$%%' \
-                                 -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%'`
+                                 -e 's%.*/\(disc\|part\([0-9]*\)\)$%\2%' \
+                                 -e 's%.*c[0-7]d[0-9]*p*%%'`
        ;;
     gnu*)
        tmp_disk=`echo "$1" | sed 's%\([sh]d[0-9]*\).*%\1%'`

PGP signature

Reply via email to