diff options
author | Erik Troan <ewt@redhat.com> | 2001-03-14 18:24:06 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2001-03-14 18:24:06 +0000 |
commit | f1881c05f2fb5ef726e2f29439bc75c37ffcb924 (patch) | |
tree | f7d7d07ed2e645cb83190ec3bc8e7a3cc6dce9cd /isys/probe.c | |
parent | 2dae3cac7cbdf590141f4ec915e60669d3b54c07 (diff) | |
download | anaconda-f1881c05f2fb5ef726e2f29439bc75c37ffcb924.tar.gz anaconda-f1881c05f2fb5ef726e2f29439bc75c37ffcb924.tar.xz anaconda-f1881c05f2fb5ef726e2f29439bc75c37ffcb924.zip |
added magic to work around promise raid controllers
Diffstat (limited to 'isys/probe.c')
-rw-r--r-- | isys/probe.c | 48 |
1 files changed, 13 insertions, 35 deletions
diff --git a/isys/probe.c b/isys/probe.c index 3991e239b..3f97364f0 100644 --- a/isys/probe.c +++ b/isys/probe.c @@ -152,15 +152,16 @@ bye: } int kdFindIdeList(struct knownDevices * devices, int code) { + return kdFindFilteredIdeList(devices, code, NULL); +} + +int kdFindFilteredIdeList(struct knownDevices * devices, int code, + kdFilterType filter) { DIR * dir; char path[80]; int fd, i; struct dirent * ent; struct kddevice device; - struct hd_driveid hdId; - char devChar; - char name[10]; - struct cdrom_volctrl vol; if (access("/proc/ide", R_OK)) return 0; @@ -199,7 +200,12 @@ int kdFindIdeList(struct knownDevices * devices, int code) { device.model = strdup(path); } - addDevice(devices, device); + if (filter && !filter(&device)) { + free(device.model); + free(device.name); + } else { + addDevice(devices, device); + } } } } @@ -209,34 +215,6 @@ int kdFindIdeList(struct knownDevices * devices, int code) { closedir(dir); - for (devChar = 'a'; devChar <= 'h'; devChar++) { - sprintf(name, "hd%c", devChar); - if (deviceKnown(devices, name)) continue; - - devMakeInode(name, "/tmp/ideprobe"); - fd = open("/tmp/ideprobe", O_RDONLY | O_NONBLOCK); - unlink("/tmp/ideprobe"); - - if (fd < 0) continue; - - device.name = strdup(name); - - ioctl(fd, HDIO_GET_IDENTITY, &hdId); - close(fd); - - if (!ioctl(fd, CDROMVOLCTRL, &vol)) - device.class = CLASS_CDROM; - else if (hdId.command_set_1 & 4) - device.class = CLASS_FLOPPY; - else - device.class = CLASS_HD; - - if (*hdId.model) - device.model = strdup(hdId.model); - - addDevice(devices, device); - } - qsort(devices->known, devices->numKnown, sizeof(*devices->known), sortDevices); @@ -482,7 +460,7 @@ static int CompaqSmartArrayGetDevices(struct knownDevices * devices) { FILE *f; char buf[256]; char *ptr; - int numMatches = 0, ctlNum = 0; + int ctlNum = 0; char ctl[64]; char *path; @@ -602,7 +580,7 @@ static int CompaqSmartArray5300GetDevices(struct knownDevices * devices) { FILE *f; char buf[256]; char *ptr; - int numMatches = 0, ctlNum = 0; + int ctlNum = 0; char ctl[64]; char *path; |