diff options
author | laroche <laroche> | 2001-07-20 08:08:06 +0000 |
---|---|---|
committer | laroche <laroche> | 2001-07-20 08:08:06 +0000 |
commit | 28a046bd21960576b3c1628b75e6f19a4e039046 (patch) | |
tree | c28c206e6e6a726761093b4181302d59cb2a48e0 /isys/probe.c | |
parent | b28e0fc487e766dd9e236f7660c02210c7d6c616 (diff) | |
download | anaconda-28a046bd21960576b3c1628b75e6f19a4e039046.tar.gz anaconda-28a046bd21960576b3c1628b75e6f19a4e039046.tar.xz anaconda-28a046bd21960576b3c1628b75e6f19a4e039046.zip |
add s390/s390x patches
Diffstat (limited to 'isys/probe.c')
-rw-r--r-- | isys/probe.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/isys/probe.c b/isys/probe.c index 0ec53a278..149a73a3b 100644 --- a/isys/probe.c +++ b/isys/probe.c @@ -403,6 +403,43 @@ bye: return val; } +int kdFindDasdList(struct knownDevices * devices, int code) { + /* patch for s390 by Oliver Paukstadt <oliver.paukstadt@millenux.com> */ + /* based upon code by Erik Tews <erik.tews@gmx.net> */ + FILE * fd; + struct kddevice device; + char line[200]; + char name[10]; + char status[10]; + char model[30]; + + if (access("/proc/dasd/devices", R_OK)) return 0; + /* a system without /proc/dasd/devices is nothing to worry about */ + + fd = fopen ("/proc/dasd/devices", "r"); + if (fd == NULL) return 1; + + /* Every line in this file is a harddisk */ + while ((fgets(line, 190, fd)) != NULL) { + sscanf(line, "%*X %*[(A-Z)] at (%*d:%*d) is %[a-z0-9]:%s ", name, status); + /* Take every dasd, formated and unformated */ + + if (!deviceKnown(devices, name)) { + snprintf(model, sizeof(model), "IBM DASD (%s)", status); + device.class = CLASS_HD; + device.name = strdup(name); + device.model = strdup(model); + device.code = code; + addDevice(devices, device); + } + } + fclose (fd); + + qsort(devices->known, devices->numKnown, sizeof(*devices->known), + sortDevices); + return 0; +} + struct knownDevices kdInit(void) { struct knownDevices kd; |