summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2020-06-12 18:03:11 +0000
committerPascal Terjan <pterjan@mageia.org>2020-06-12 18:03:11 +0000
commit7b431f1054e8a54d65db43ffdec473042ee29f53 (patch)
treea6f78fff80910005b238e27dee6b24fe38bf9a7c /mdk-stage1
parent353c8adc2ecd4e3fdfe2941d51d8f8f620f073ff (diff)
downloaddrakx-7b431f1054e8a54d65db43ffdec473042ee29f53.tar
drakx-7b431f1054e8a54d65db43ffdec473042ee29f53.tar.gz
drakx-7b431f1054e8a54d65db43ffdec473042ee29f53.tar.bz2
drakx-7b431f1054e8a54d65db43ffdec473042ee29f53.tar.xz
drakx-7b431f1054e8a54d65db43ffdec473042ee29f53.zip
Move CCISS to generic code
Diffstat (limited to 'mdk-stage1')
-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