summaryrefslogtreecommitdiffstats
path: root/kickstart.py
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2006-01-31 16:34:46 +0000
committerPeter Jones <pjones@redhat.com>2006-01-31 16:34:46 +0000
commitf033eecdbb369371bdae382231518d4d372eb41a (patch)
tree989d64d4711f0c88cc2c775797d5dcc4e5ef788a /kickstart.py
parente494efe5247cfdd65ca6d3679ccb93bceb862e53 (diff)
downloadanaconda-f033eecdbb369371bdae382231518d4d372eb41a.tar.gz
anaconda-f033eecdbb369371bdae382231518d4d372eb41a.tar.xz
anaconda-f033eecdbb369371bdae382231518d4d372eb41a.zip
- add kickstart dmraid support
Diffstat (limited to 'kickstart.py')
-rw-r--r--kickstart.py32
1 files changed, 31 insertions, 1 deletions
diff --git a/kickstart.py b/kickstart.py
index 69a566a7b..8a2bb0d8b 100644
--- a/kickstart.py
+++ b/kickstart.py
@@ -282,6 +282,33 @@ class AnacondaKSHandlers(KickstartHandlers):
if nd.gateway != "":
id.instClass.setGateway(id, nd.gateway)
+ def doDmRaid(self, id, args):
+ KickstartHandlers.doDmRaid(self, args)
+
+ from partedUtils import DiskSet
+ ds = DiskSet()
+ ds.startDmRaid()
+
+ raid = self.ksdata.dmraids[-1]
+ log.debug("Searching for dmraid '%s'" % (raid.name,))
+ for rs in DiskSet.dmList or []:
+ it = True
+ for dev in raid.devices:
+ dev = dev.split('/')[-1]
+ log.debug("dmraid '%s' has members %s" % (rs.name, list(rs.members)))
+ if not dev in rs.members:
+ log.debug("dmraid '%s' does not have device %s, skipping" \
+ % (rs.name, dev))
+ it = False
+ if it:
+ log.debug("found dmraid '%s', changing name to %s" \
+ % (rs.name, raid.name))
+ # why doesn't rs.name go through the setter here?
+ newname = raid.name
+ ds.renameDmRaid(rs, newname)
+ return
+ ds.startDmRaid()
+
def doPartition(self, id, args):
KickstartHandlers.doPartition(self, args)
pd = self.ksdata.partitions[-1]
@@ -348,7 +375,10 @@ class AnacondaKSHandlers(KickstartHandlers):
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Partition requires a size specification")
if pd.start != 0 and pd.disk == "":
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Partition command with start cylinder requires a drive specification")
- if pd.disk != "" and pd.disk not in isys.hardDriveDict().keys():
+ hds = isys.hardDriveDict()
+ if not hds.has_key(pd.disk) and hds.has_key('mapper/'+pd.disk):
+ pd.disk = 'mapper/' + pd.disk
+ if pd.disk != "" and pd.disk not in hds.keys():
raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified disk in partition command which does not exist")
request = partRequests.PartitionSpec(filesystem,