Dash:
[t2.git] / package / boot / grub / grub-0.97-cciss.patch
blob9d87029462e1401fb166eceebd01f5b2bfb553e7
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../grub/grub-0.97-cciss.patch
5 # Copyright (C) 2008 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
15 # --- T2-COPYRIGHT-NOTE-END ---
18 mpp@0x3381e.de
20 --- grub-0.97/lib/device.c 2008-12-22 11:39:13.000000000 +0100
21 +++ grub-0.97/lib/device.c 2008-12-22 12:42:07.000000000 +0100
22 @@ -407,6 +407,12 @@
25 static void
26 +get_cciss_disk_name (char *name, int controller, int drive)
28 + sprintf (name, "/dev/cciss/c%dd%d", controller, drive);
31 +static void
32 get_ataraid_disk_name (char *name, int unit)
34 sprintf (name, "/dev/ataraid/d%c", unit + '0');
35 @@ -805,6 +811,37 @@
40 + /* This is for SmartArray - we have
41 + /dev/cciss/c<controller>d<logical drive>p<partition>.
43 + cciss driver currently supports up to 8 controllers, 32 logical
44 + drives, and 7 partitions. */
45 + {
46 + int controller, drive;
48 + for (controller = 0; controller < 8; controller++)
49 + {
50 + for (drive = 0; drive < 15; drive++)
51 + {
52 + char name[24];
54 + get_cciss_disk_name (name, controller, drive);
55 + if (check_device (name))
56 + {
57 + (*map)[num_hd + 0x80] = strdup (name);
58 + assert ((*map)[num_hd + 0x80]);
60 + /* If the device map file is opened, write the map. */
61 + if (fp)
62 + fprintf (fp, "(hd%d)\t%s\n", num_hd, name);
64 + num_hd++;
65 + }
66 + }
67 + }
68 + }
70 #endif /* __linux__ */
72 /* OK, close the device map file if opened. */
73 @@ -865,7 +902,14 @@
74 if (strcmp (dev + strlen(dev) - 5, "/disc") == 0)
75 strcpy (dev + strlen(dev) - 5, "/part");
77 - sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
78 + if ( strncmp(dev,"/dev/cciss/",11)==0 )
79 + {
80 + sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1);
81 + }
82 + else
83 + {
84 + sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1);
85 + }
87 /* Open the partition. */
88 fd = open (dev, O_RDWR);