diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-06-07 03:38:22 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-06-07 03:38:22 +0000 |
commit | 7c4e4c456505e682cc3f491db26ced0b723bafad (patch) | |
tree | 6530198d25e4f983470f792f99830da471df196c /isys | |
parent | 810ef80041161060dd3b86f60831a880df770832 (diff) | |
download | anaconda-7c4e4c456505e682cc3f491db26ced0b723bafad.tar.gz anaconda-7c4e4c456505e682cc3f491db26ced0b723bafad.tar.xz anaconda-7c4e4c456505e682cc3f491db26ced0b723bafad.zip |
make getting the raid superblock a little more flexible, add a getpagesize function
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.c | 6 | ||||
-rw-r--r-- | isys/isys.py | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/isys/isys.c b/isys/isys.c index 7705fa49c..3801f9b2c 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -98,6 +98,7 @@ static PyObject * doisIsoImage(PyObject * s, PyObject * args); static PyObject * dogetGeometry(PyObject * s, PyObject * args); static PyObject * getFramebufferInfo(PyObject * s, PyObject * args); static PyObject * printObject(PyObject * s, PyObject * args); +static PyObject * doGetPageSize(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL }, @@ -150,6 +151,7 @@ static PyMethodDef isysModuleMethods[] = { { "isisoimage", (PyCFunction) doisIsoImage, METH_VARARGS, NULL}, { "getGeometry", (PyCFunction) dogetGeometry, METH_VARARGS, NULL}, { "fbinfo", (PyCFunction) getFramebufferInfo, METH_VARARGS, NULL}, + { "getpagesize", (PyCFunction) doGetPageSize, METH_VARARGS, NULL}, { "printObject", (PyCFunction) printObject, METH_VARARGS, NULL}, { NULL } } ; @@ -1592,6 +1594,10 @@ static PyObject * getFramebufferInfo(PyObject * s, PyObject * args) { return Py_BuildValue("(iii)", fb.xres, fb.yres, fb.bits_per_pixel); } +static PyObject * doGetPageSize(PyObject * s, PyObject * args) { + return Py_BuildValue("i", getpagesize()); +} + static PyObject * printObject (PyObject * o, PyObject * args) { PyObject * obj; char buf[256]; diff --git a/isys/isys.py b/isys/isys.py index 00dc71cfb..f7a2ef280 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -75,7 +75,10 @@ def raidstart(mdDevice, aMember): def raidsb(mdDevice): makeDevInode(mdDevice, "/tmp/md") - fd = os.open("/tmp/md", os.O_RDONLY) + return raidsbFromDevice("/tmp/md") + +def raidsbFromDevice(device): + fd = os.open(device, os.O_RDONLY) rc = 0 try: rc = _isys.getraidsb(fd) @@ -475,5 +478,8 @@ def ideCdRwList(): return newList +def getpagesize(): + return _isys.getpagesize() + printObject = _isys.printObject |