summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--instdata.py8
-rw-r--r--isys/isys.c19
-rwxr-xr-xisys/isys.py3
3 files changed, 30 insertions, 0 deletions
diff --git a/instdata.py b/instdata.py
index 806d9ad51..20af5c9ad 100644
--- a/instdata.py
+++ b/instdata.py
@@ -37,6 +37,7 @@ import iscsi
import zfcp
import urllib
import iutil
+import isys
import users
import shlex
from flags import *
@@ -101,8 +102,15 @@ class InstallData:
elif self.anaconda.methodstr and self.anaconda.methodstr.startswith("hd:"):
method = self.anaconda.methodstr[3:]
device = method.split(":", 3)[0]
+
+ if device.startswith("LABEL="):
+ device = isys.getDeviceByToken("LABEL", device[6:])
+ elif device.startswith("UUID="):
+ device = isys.getDeviceByToken("UUID", device[5:])
+
if device.startswith("/dev/"):
device = device[5:]
+
self.partitions.protected = [device]
def setInstallProgressClass(self, c):
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