# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../grub/grub-0.97-cciss.patch # Copyright (C) 2008 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- mpp@0x3381e.de --- grub-0.97/lib/device.c 2008-12-22 11:39:13.000000000 +0100 +++ grub-0.97/lib/device.c 2008-12-22 12:42:07.000000000 +0100 @@ -407,6 +407,12 @@ } static void +get_cciss_disk_name (char *name, int controller, int drive) +{ + sprintf (name, "/dev/cciss/c%dd%d", controller, drive); +} + +static void get_ataraid_disk_name (char *name, int unit) { sprintf (name, "/dev/ataraid/d%c", unit + '0'); @@ -805,6 +811,37 @@ } } } + + /* This is for SmartArray - we have + /dev/cciss/cdp. + + cciss driver currently supports up to 8 controllers, 32 logical + drives, and 7 partitions. */ + { + int controller, drive; + + for (controller = 0; controller < 8; controller++) + { + for (drive = 0; drive < 15; 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__ */ /* OK, close the device map file if opened. */ @@ -865,7 +902,14 @@ if (strcmp (dev + strlen(dev) - 5, "/disc") == 0) strcpy (dev + strlen(dev) - 5, "/part"); } - sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1); + if ( strncmp(dev,"/dev/cciss/",11)==0 ) + { + sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1); + } + else + { + sprintf (dev + strlen(dev), "%d", ((partition >> 16) & 0xFF) + 1); + } /* Open the partition. */ fd = open (dev, O_RDWR);