]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/grub-0.97/grub-0.96-i2o-raid.patch
Anpassung der Pfadangaben für GRUB.
[ipfire-2.x.git] / src / patches / grub-0.97 / grub-0.96-i2o-raid.patch
CommitLineData
27996c53
MT
1diff -ru grub-0.96-orig/lib/device.c grub-0.96/lib/device.c
2--- grub-0.96-orig/lib/device.c 2005-02-16 22:33:09.669384408 -0600
3+++ grub-0.96/lib/device.c 2005-02-17 00:47:05.127596672 -0600
4@@ -407,6 +407,12 @@
5 {
6 sprintf (name, "/dev/ataraid/d%c", unit + '0');
7 }
8+
9+static void
10+get_i2o_disk_name (char *name, int unit)
11+{
12+ sprintf (name, "/dev/i2o/hd%c", unit + 'a');
13+}
14 #endif
15
16 /* Check if DEVICE can be read. If an error occurs, return zero,
17@@ -798,6 +804,26 @@
18 }
19 }
20 }
21+
22+ /* I2O disks. */
23+ for (i = 0; i < 8; i++)
24+ {
25+ char name[16];
26+
27+ get_i2o_disk_name (name, i);
28+ if (check_device (name))
29+ {
30+ (*map)[num_hd + 0x80] = strdup (name);
31+ assert ((*map)[num_hd + 0x80]);
32+
33+ /* If the device map file is opened, write the map. */
34+ if (fp)
35+ fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
36+
37+ num_hd++;
38+ }
39+ }
40+
41 #endif /* __linux__ */
42
43 /* OK, close the device map file if opened. */
44@@ -858,8 +884,15 @@
45 if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
46 strcpy (dev + strlen(dev) - 5, "/part");
47 }
48- sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
49-
50+ sprintf (dev + strlen(dev), "%s%d",
51+ /* Compaq smart and others */
52+ (strncmp(dev, "/dev/ida/", 9) == 0 ||
53+ strncmp(dev, "/dev/ataraid/", 13) == 0 ||
54+ strncmp(dev, "/dev/cciss/", 11) == 0 ||
55+ strncmp(dev, "/dev/rd/", 8) == 0 ||
56+ strncmp(dev, "/dev/i2o/", 9) == 0) ? "p" : "",
57+ ((partition >> 16) & 0xFF) + 1);
58+
59 /* Open the partition. */
60 fd = open (dev, O_RDWR);
61 if (fd < 0)