diff options
author | Matt Wilson <msw@redhat.com> | 1999-08-20 16:33:43 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-08-20 16:33:43 +0000 |
commit | 2b4416c172646ce88f026d7ed7aaaf7b2b1c57db (patch) | |
tree | bec47600db331e7ade98d5d118292cceb8460e06 /isys | |
parent | aa7b059d031379c4d881345c23deea9829430323 (diff) | |
download | anaconda-2b4416c172646ce88f026d7ed7aaaf7b2b1c57db.tar.gz anaconda-2b4416c172646ce88f026d7ed7aaaf7b2b1c57db.tar.xz anaconda-2b4416c172646ce88f026d7ed7aaaf7b2b1c57db.zip |
o boot disk prompt
o check to make sure filesystems have bootable flag for lilo "other" images
o check for kernel images in lilo config
o return status for execwithredirect
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.c | 37 | ||||
-rw-r--r-- | isys/isys.py | 3 |
2 files changed, 40 insertions, 0 deletions
diff --git a/isys/isys.c b/isys/isys.c index 4fe42d873..a333fba6c 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -30,6 +30,7 @@ static PyObject * doConfigNetDevice(PyObject * s, PyObject * args); #endif static PyObject * createProbedList(PyObject * s, PyObject * args); static PyObject * doChroot(PyObject * s, PyObject * args); +static PyObject * doCheckBoot(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "findmoduleinfo", (PyCFunction) doFindModInfo, METH_VARARGS, NULL }, @@ -47,6 +48,7 @@ static PyMethodDef isysModuleMethods[] = { { "confignetdevice", (PyCFunction) doConfigNetDevice, METH_VARARGS, NULL }, #endif { "chroot", (PyCFunction) doChroot, METH_VARARGS, NULL }, + { "checkBoot", (PyCFunction) doCheckBoot, METH_VARARGS, NULL }, { NULL } } ; @@ -337,6 +339,41 @@ static PyObject * doChroot(PyObject * s, PyObject * args) { return Py_None; } +#define BOOT_SIGNATURE 0xaa55 /* boot signature */ +#define BOOT_SIG_OFFSET 510 /* boot signature offset */ + +static PyObject * doCheckBoot (PyObject * s, PyObject * args) { + char * path; + int fd, size; + unsigned short magic; + PyObject * ret; + + /* code from LILO */ + + if (!PyArg_ParseTuple(args, "s", &path)) return NULL; + + if ((fd = open (path, O_RDONLY)) < 0) { + PyErr_SetFromErrno(PyExc_SystemError); + return NULL; + } + + if (lseek(fd,(long) BOOT_SIG_OFFSET, 0) < 0) { + close (fd); + PyErr_SetFromErrno(PyExc_SystemError); + return NULL; + } + + if ((size = read(fd,(char *) &magic, 2)) != 2) { + close (fd); + PyErr_SetFromErrno(PyExc_SystemError); + return NULL; + } + + close (fd); + + return Py_BuildValue("i", magic == BOOT_SIGNATURE); +} + static PyObject * smpAvailable(PyObject * s, PyObject * args) { int result; diff --git a/isys/isys.py b/isys/isys.py index d84fc4ea9..e604aac13 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -13,6 +13,9 @@ def smpAvailable(): def chroot (path): return _isys.chroot (path) +def checkBoot (path): + return _isys.checkBoot (path) + def probePciDevices(): # probes all probeable buses and returns a list of # ( driver, major, minor, description, args ) tuples, where args is a |