summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorKarsten Hopp <karsten@redhat.de>2001-06-20 13:15:44 +0000
committerKarsten Hopp <karsten@redhat.de>2001-06-20 13:15:44 +0000
commit6a81b8274f1259a1a03189de0ff8841ff1e1d96a (patch)
tree00c81e07d8bb4acee580c043bd29f63fca0c9ae5 /isys
parent716d3e554119528a88cbaeb9ec8ffbe79e44ac1d (diff)
downloadanaconda-6a81b8274f1259a1a03189de0ff8841ff1e1d96a.tar.gz
anaconda-6a81b8274f1259a1a03189de0ff8841ff1e1d96a.tar.xz
anaconda-6a81b8274f1259a1a03189de0ff8841ff1e1d96a.zip
patches for s390
Diffstat (limited to 'isys')
-rw-r--r--isys/devnodes.c12
-rw-r--r--isys/isys.c11
-rw-r--r--isys/isys.py1
-rw-r--r--isys/nfsmount.c4
-rw-r--r--isys/probe.c40
-rw-r--r--isys/smp.c29
6 files changed, 95 insertions, 2 deletions
diff --git a/isys/devnodes.c b/isys/devnodes.c
index 624176bf3..54638964f 100644
--- a/isys/devnodes.c
+++ b/isys/devnodes.c
@@ -143,6 +143,18 @@ int devMakeInode(char * devName, char * path) {
minor = 1;
if (devName[3])
minor += devName[3] - '1';
+ } else if (!strncmp(devName, "dasd", 4)) {
+ /* IBM Dasd Drives */
+ type = S_IFBLK;
+ major = 94;
+ minor = ( devName[4] - 'a' ) * 4;
+ if (devName[5])
+ minor += devName[5] - '0';
+ } else if (!strncmp(devName, "mnd", 4)) {
+ /* IBM MiniDisk Drives */
+ type = S_IFBLK;
+ major = 95;
+ minor = devName[3] - 'a';
} else if (!strncmp(devName, "rd/", 3)) {
/* dac 960 "/rd/c0d0{p1}" */
type = S_IFBLK;
diff --git a/isys/isys.c b/isys/isys.c
index d61710d17..3f61b47ea 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -155,6 +155,7 @@ static void probedListDealloc (probedListObject * o);
static PyObject * probedListNet(probedListObject * s, PyObject * args);
static PyObject * probedListScsi(probedListObject * s, PyObject * args);
static PyObject * probedListIde(probedListObject * s, PyObject * args);
+static PyObject * probedListDasd(probedListObject * s, PyObject * args);
static int probedListLength(PyObject * o);
static PyObject * probedListSubscript(probedListObject * o, int item);
@@ -162,6 +163,7 @@ static PyMethodDef probedListObjectMethods[] = {
{ "updateNet", (PyCFunction) probedListNet, METH_VARARGS, NULL },
{ "updateScsi", (PyCFunction) probedListScsi, METH_VARARGS, NULL },
{ "updateIde", (PyCFunction) probedListIde, METH_VARARGS, NULL },
+ { "updateDasd", (PyCFunction) probedListDasd, METH_VARARGS, NULL },
{ NULL },
};
@@ -856,6 +858,15 @@ static PyObject * probedListScsi(probedListObject * o, PyObject * args) {
return Py_None;
}
+static PyObject * probedListDasd(probedListObject * o, PyObject * args) {
+ if (!PyArg_ParseTuple(args, "")) return NULL;
+
+ kdFindDasdList(&o->list, 0);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+}
+
int pdc_dev_running_raid(int fd);
#ifdef __i386__
diff --git a/isys/isys.py b/isys/isys.py
index 525877da4..d852c2a70 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -175,6 +175,7 @@ def driveDict(klassArg):
p = _isys.ProbedList()
p.updateIde()
p.updateScsi()
+ p.updateDasd()
dict = {}
for (klass, dev, descr) in p:
diff --git a/isys/nfsmount.c b/isys/nfsmount.c
index f4151aa3a..85bc8d1ca 100644
--- a/isys/nfsmount.c
+++ b/isys/nfsmount.c
@@ -42,6 +42,7 @@
#include <netdb.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
+#include <rpcsvc/nfs_prot.h>
#include <rpc/pmap_clnt.h>
#include <sys/socket.h>
#include <sys/time.h>
@@ -53,7 +54,6 @@
#include "nfsmount.h"
#define NFS_NEED_KERNEL_TYPES
-#include <linux/nfs.h>
#include "mount_constants.h"
#include "nfs_mount4.h"
#undef NFS_NEED_KERNEL_TYPES
@@ -808,7 +808,7 @@ fail:
#endif
static struct {
- enum nfs_stat stat;
+ enum nfsstat stat;
int errnum;
} nfs_errtbl[] = {
{ NFS_OK, 0 },
diff --git a/isys/probe.c b/isys/probe.c
index a66956ef6..800a14ff8 100644
--- a/isys/probe.c
+++ b/isys/probe.c
@@ -404,6 +404,46 @@ 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;
diff --git a/isys/smp.c b/isys/smp.c
index 3ece6cd15..a7e577d65 100644
--- a/isys/smp.c
+++ b/isys/smp.c
@@ -39,6 +39,31 @@ int alphaDetectSMP(void)
}
#endif /* __alpha__ */
+#if defined (__s390__) || defined (__s390x__)
+int s390DetectSMP(void)
+{
+ int issmp = 0;
+ FILE *f;
+
+ f = fopen("/proc/cpuinfo", "r");
+ if (f) {
+ char buff[1024];
+
+ while (fgets (buff, 1024, f) != NULL) {
+ if (!strncmp (buff, "# processors : ", 18)) {
+ if (strtoul (buff + 18, NULL, 0) > 1)
+ issmp = 1;
+ break;
+ }
+ }
+ fclose(f);
+ } else
+ return -1;
+
+ return issmp;
+}
+#endif /* __s390__ */
+
#ifdef __sparc__
int sparcDetectSMP(void)
{
@@ -460,6 +485,10 @@ int detectSMP(void)
return isSMP = alphaDetectSMP();
#elif __ia64__
return isSMP = 1;
+#elif __s390__
+ return isSMP = s390DetectSMP();
+#elif __s390x__
+ return isSMP = s390DetectSMP();
#else
#error unknown architecture
#endif