summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-10-02 04:01:20 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-10-02 04:01:20 -1000
commite19b0cd8078b52e3aeeec5ca22d80f14d49968b3 (patch)
treed0137ef6cf64e2efa0d447f5f8a919b07ab01a1d /isys
parent47138291a6ee6e38aed60bee72c477df683f3c86 (diff)
downloadanaconda-e19b0cd8078b52e3aeeec5ca22d80f14d49968b3.tar.gz
anaconda-e19b0cd8078b52e3aeeec5ca22d80f14d49968b3.tar.xz
anaconda-e19b0cd8078b52e3aeeec5ca22d80f14d49968b3.zip
Support ksdevice=link when booting from boot.iso.
If the user supplies ksdevice=link, make sure we automatically select the first network device found that has an active link.
Diffstat (limited to 'isys')
-rw-r--r--isys/isys.c16
-rwxr-xr-xisys/isys.py3
2 files changed, 19 insertions, 0 deletions
diff --git a/isys/isys.c b/isys/isys.c
index 4ecf947d0..b3466ab04 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -131,6 +131,7 @@ static PyObject * doPrefixToNetmask(PyObject *s, PyObject *args);
static PyObject * doGetBlkidData(PyObject * s, PyObject * args);
static PyObject * doGetDeviceByToken(PyObject *s, PyObject *args);
static PyObject * doIsCapsLockEnabled(PyObject * s, PyObject * args);
+static PyObject * doGetLinkStatus(PyObject * s, PyObject * args);
static PyMethodDef isysModuleMethods[] = {
{ "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL },
@@ -177,6 +178,7 @@ static PyMethodDef isysModuleMethods[] = {
{ "getblkid", (PyCFunction) doGetBlkidData, METH_VARARGS, NULL },
{ "getdevicebytoken", (PyCFunction) doGetDeviceByToken, METH_VARARGS, NULL },
{ "isCapsLockEnabled", (PyCFunction) doIsCapsLockEnabled, METH_VARARGS, NULL },
+ { "getLinkStatus", (PyCFunction) doGetLinkStatus, METH_VARARGS, NULL },
{ NULL, NULL, 0, NULL }
} ;
@@ -916,4 +918,18 @@ static PyObject * doIsCapsLockEnabled(PyObject * s, PyObject * args) {
return PyBool_FromLong(state.locked_mods & LockMask);
}
+static PyObject * doGetLinkStatus(PyObject * s, PyObject * args) {
+ char *dev = NULL;
+
+ if (!PyArg_ParseTuple(args, "s", &dev)) {
+ return NULL;
+ }
+
+ if (get_link_status(dev) == 1) {
+ return PyBool_FromLong(1);
+ }
+
+ return PyBool_FromLong(0);
+}
+
/* vim:set shiftwidth=4 softtabstop=4: */
diff --git a/isys/isys.py b/isys/isys.py
index 189bd7fd1..57672d8f6 100755
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -1056,6 +1056,9 @@ def isPaeAvailable():
return isPAE
+def getLinkStatus(dev):
+ return _isys.getLinkStatus(dev)
+
auditDaemon = _isys.auditdaemon
handleSegv = _isys.handleSegv