diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-02-04 20:52:55 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-02-04 20:52:55 +0000 |
commit | 5ec22af9647c9e27cefbfab58ca6825a7c4e4739 (patch) | |
tree | e2116e31af4248e51402564ac19f5b202451550d /kickstart.py | |
parent | aa8c034fc6e04c02452c3a96ae9d1ffedf8a64b8 (diff) | |
download | anaconda-5ec22af9647c9e27cefbfab58ca6825a7c4e4739.tar.gz anaconda-5ec22af9647c9e27cefbfab58ca6825a7c4e4739.tar.xz anaconda-5ec22af9647c9e27cefbfab58ca6825a7c4e4739.zip |
really fix kickstart raid (#59270)
Diffstat (limited to 'kickstart.py')
-rw-r--r-- | kickstart.py | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/kickstart.py b/kickstart.py index ecbce053f..24de479f0 100644 --- a/kickstart.py +++ b/kickstart.py @@ -639,7 +639,12 @@ class KickstartBase(BaseInstallClass): mountpoint = extra[0] - raidmems = extra[1:] + raidmems = [] + # get the unique ids of each of the raid members + for member in extra[1:]: + if member not in self.ksRaidMapping.keys(): + raise RuntimeError, "Tried to use an undefined partition in RAID specification" + raidmems.append(self.ksRaidMapping[member]) # XXX this shouldn't have to happen =\ if isRaid0(level): @@ -676,6 +681,7 @@ class KickstartBase(BaseInstallClass): fstype = None mountpoint = None uniqueID = None + thisRaidID = None start = None end = None badblocks = None @@ -739,14 +745,13 @@ class KickstartBase(BaseInstallClass): elif extra[0][:5] == "raid.": filesystem = fileSystemTypeGet("software RAID") - # cheap hack. unique id needs to be an int - theID = "" - for char in extra[0][5:]: - if char not in string.digits: - continue - theID = theID + char - if len(theID) > 0: - uniqueID = int(theID) + if self.ksRaidMapping.has_key(extra[0]): + raise RuntimeError, "Defined RAID partition %s multiple times" % (extra[0],) + + # XXX use the hackish raid unique ID + thisRaidID = self.raidID + self.ksRaidMapping[extra[0]] = thisRaidID + self.raidID = self.raidID + 1 elif extra[0:9] == "/boot/efi": filesystem = fileSystemTypeGet("vfat") mountpoint = extra[0] @@ -784,6 +789,8 @@ class KickstartBase(BaseInstallClass): request.format = 0 if id: request.uniqueID = uniqueID + if thisRaidID: + request.uniqueID = thisRaidID if badblocks: request.badblocks = badblocks if onPart: @@ -881,6 +888,9 @@ class KickstartBase(BaseInstallClass): self.file = file self.skipSteps = [] self.interactive = 0 + self.ksRaidMapping = {} + # XXX hack to give us a starting point for RAID unique IDs. ugh. + self.raidID = 100000 BaseInstallClass.__init__(self, 0) def Kickstart(file, serial): |