summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/grub/more-raid.patch
blob: 39db23474b9b24149ed53ba7fc353dfd2a49ea36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
--- grub-0.95/lib/device.c.moreraid	2004-11-30 17:09:36.736099360 -0500
+++ grub-0.95/lib/device.c	2004-11-30 17:12:17.319686944 -0500
@@ -544,6 +544,17 @@
 }
 
 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');
@@ -920,7 +931,7 @@
     
     for (controller = 0; controller < 8; controller++)
       {
-	for (drive = 0; drive < 15; drive++)
+	for (drive = 0; drive < 32; drive++)
 	  {
 	    char name[24];
 	    
@@ -940,6 +951,70 @@
       }
   }
 #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.  */
   if (fp)