diff options
author | Chris Lumens <clumens@redhat.com> | 2008-09-15 16:39:59 -0400 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2008-09-15 16:39:59 -0400 |
commit | 6a71f323a242dcad5fee07075c1c69e1d63daaec (patch) | |
tree | bff69fe67f194438892dae459460c8dc884ca666 /isys | |
parent | 4365be91d6bc5a28d212d551e95de63569fe23a7 (diff) | |
download | anaconda-6a71f323a242dcad5fee07075c1c69e1d63daaec.tar.gz anaconda-6a71f323a242dcad5fee07075c1c69e1d63daaec.tar.xz anaconda-6a71f323a242dcad5fee07075c1c69e1d63daaec.zip |
On HDISO installs, mark LABEL= and UUID= partitions as protected.
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.c | 19 | ||||
-rwxr-xr-x | isys/isys.py | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/isys/isys.c b/isys/isys.c index d583da45b..181688fbc 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -132,6 +132,7 @@ static PyObject * doSegvHandler(PyObject *s, PyObject *args); static PyObject * doAuditDaemon(PyObject *s); 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 PyMethodDef isysModuleMethods[] = { @@ -180,6 +181,7 @@ static PyMethodDef isysModuleMethods[] = { { "auditdaemon", (PyCFunction) doAuditDaemon, METH_NOARGS, NULL }, { "prefix2netmask", (PyCFunction) doPrefixToNetmask, METH_VARARGS, NULL }, { "getblkid", (PyCFunction) doGetBlkidData, METH_VARARGS, NULL }, + { "getdevicebytoken", (PyCFunction) doGetDeviceByToken, METH_VARARGS, NULL }, { "isCapsLockEnabled", (PyCFunction) doIsCapsLockEnabled, METH_VARARGS, NULL }, { NULL, NULL, 0, NULL } } ; @@ -932,6 +934,23 @@ static PyObject * doAuditDaemon(PyObject *s) { return Py_None; } +static PyObject *doGetDeviceByToken(PyObject *s, PyObject *args) { + blkid_cache cache; + char *token, *value, *dev; + + if (!PyArg_ParseTuple(args, "ss", &token, &value)) return NULL; + + blkid_get_cache(&cache, NULL); + + dev = blkid_get_devname(cache, token, value); + if (dev == NULL) { + Py_INCREF(Py_None); + return Py_None; + } else { + return Py_BuildValue("s", dev); + } +} + static PyObject * doGetBlkidData(PyObject * s, PyObject * args) { char * dev, * key; blkid_cache cache; diff --git a/isys/isys.py b/isys/isys.py index 8cec02aed..40fb67594 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -775,6 +775,9 @@ def dhcpNetDevice(device): return _isys.dhcpnetdevice(devname, v4, v4method, v6, v6method, klass) +def getDeviceByToken(token, value): + return _isys.getdevicebytoken(token, value) + def readFSUuid(device): if not os.path.exists(device): device = "/dev/%s" % device |