diff options
author | Guillaume Cottenceau <gc@mandriva.com> | 2001-08-24 19:11:07 +0000 |
---|---|---|
committer | Guillaume Cottenceau <gc@mandriva.com> | 2001-08-24 19:11:07 +0000 |
commit | 1bf4d043db7302d4b5b5a517044271d85064e30b (patch) | |
tree | 3560a71e9e942dc903d7b5347db1221dbab0ba42 /mdk-stage1/probing.c | |
parent | a7e7894247de459f0be84c29c45f39c35a595b4d (diff) | |
download | drakx-1bf4d043db7302d4b5b5a517044271d85064e30b.tar drakx-1bf4d043db7302d4b5b5a517044271d85064e30b.tar.gz drakx-1bf4d043db7302d4b5b5a517044271d85064e30b.tar.bz2 drakx-1bf4d043db7302d4b5b5a517044271d85064e30b.tar.xz drakx-1bf4d043db7302d4b5b5a517044271d85064e30b.zip |
enable install from Compaq Smart Array
Diffstat (limited to 'mdk-stage1/probing.c')
-rw-r--r-- | mdk-stage1/probing.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c index 0e4a53e24..703913a0e 100644 --- a/mdk-stage1/probing.c +++ b/mdk-stage1/probing.c @@ -22,7 +22,7 @@ /* * This contains stuff related to probing: - * (1) any (actually only SCSI, NET, USB Controllers) devices (autoprobe for PCI and USB) + * (1) any (actually only SCSI, NET, CPQ, USB Controllers) devices (autoprobe for PCI and USB) * (2) IDE media * (3) SCSI media * (4) ETH devices @@ -53,7 +53,7 @@ #include "probing.h" -enum bus_type { IDE, SCSI }; +enum bus_type { IDE, SCSI, CPQ }; struct media_info { char * name; @@ -387,7 +387,6 @@ static void find_media(void) /* ----------------------------------------------- */ log_message("looking for scsi media"); - fd = open("/proc/scsi/scsi", O_RDONLY); if (fd != -1) { enum { SCSI_TOP, SCSI_HOST, SCSI_VENDOR, SCSI_TYPE } state = SCSI_TOP; @@ -511,6 +510,36 @@ static void find_media(void) } /* ----------------------------------------------- */ + log_message("looking for Compaq Smart Array media"); + { + char * procfiles[] = { "/proc/driver/array/ida0", "/proc/array/ida", + "/proc/driver/cciss/cciss0", "/proc/cciss/cciss", + NULL }; + char ** procfile = procfiles; + FILE * f; + while (procfile && *procfile && (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 = "Compaq RAID logical disk"; + log_message("CPQ: found %s", tmp[count].name); + tmp[count].bus = CPQ; + count++; + } + } + } + fclose(f); + procfile++; + } + } + + /* ----------------------------------------------- */ tmp[count].name = NULL; count++; |