summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/probing.c41
1 files changed, 9 insertions, 32 deletions
diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c
index c23ab517b..251e3eb45 100644
--- a/mdk-stage1/probing.c
+++ b/mdk-stage1/probing.c
@@ -808,38 +808,6 @@ void find_media(enum media_bus bus)
}
/* ----------------------------------------------- */
- log_message("looking for Compaq Smart Array media");
- {
- char * procfiles[] = { "/proc/driver/cpqarray/ida0", "/proc/driver/cciss/cciss0", // 2.4 style
- "/proc/array/ida", "/proc/cciss/cciss", // 2.2 style
- NULL };
- static char cpq_descr[] = "Compaq RAID logical disk";
- char ** procfile;
- FILE * f;
-
- for (procfile = procfiles; procfile && *procfile; procfile++) {
- if((f = fopen(*procfile, "rb"))) {
- while (fgets(buf, sizeof(buf), f)) {
- if (ptr_begins_static_str(buf, "ida/") || ptr_begins_static_str(buf, "cciss/")) {
- char * end = strchr(buf, ':');
- if (!end)
- log_message("Inconsistency in %s, line:\n%s", *procfile, buf);
- else {
- *end = '\0';
- tmp[count].name = strdup(buf);
- tmp[count].type = DISK;
- tmp[count].model = cpq_descr;
- log_message("CPQ: found %s", tmp[count].name);
- count++;
- }
- }
- }
- fclose(f);
- }
- }
- }
-
- /* ----------------------------------------------- */
log_message("looking for DAC960");
{
FILE * f;
@@ -877,6 +845,7 @@ void find_media(enum media_bus bus)
// some types of disks (ram, loop, ...) rather than a list to accept.
glob("/sys/block/nvme*", 0, NULL, &globbuf);
glob("/sys/block/vd*", 0, NULL, &globbuf);
+ glob("/sys/block/cciss*", 0, NULL, &globbuf);
for (int i = 0; i < globbuf.gl_pathc; i++) {
char *name, *pathend;
@@ -886,6 +855,14 @@ void find_media(enum media_bus bus)
strncpy(path, globbuf.gl_pathv[i], sizeof(path));
name = strdup(path + 11);
+
+ // Replace ! with /, for example for cciss!c0d0 devices
+ char * c = name;
+ while((c = strchr(c, '!')) != NULL) {
+ *c = '/';
+ c++;
+ }
+
pathend = path + strlen(path);
// Check if this device had been handled by other code