summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>1999-12-29 15:59:47 +0000
committerMatt Wilson <msw@redhat.com>1999-12-29 15:59:47 +0000
commit87a1d45e2ce6fc489ea621735f00dbf12c1a2b90 (patch)
treee2a6f9d4694e84c728c9e8317a69ad23a53beed5
parente44eb12840c9a86aeb804f14c09490f57bb607a9 (diff)
downloadanaconda-87a1d45e2ce6fc489ea621735f00dbf12c1a2b90.tar.gz
anaconda-87a1d45e2ce6fc489ea621735f00dbf12c1a2b90.tar.xz
anaconda-87a1d45e2ce6fc489ea621735f00dbf12c1a2b90.zip
various fixes for raid upgrades (which seem to work now)
-rw-r--r--fstab.py26
-rw-r--r--raid.py10
-rw-r--r--text.py2
-rw-r--r--todo.py4
4 files changed, 36 insertions, 6 deletions
diff --git a/fstab.py b/fstab.py
index 26049a49e..c82fbf495 100644
--- a/fstab.py
+++ b/fstab.py
@@ -18,6 +18,7 @@ import isys
import iutil
import os
import string
+import raid
def _(str):
return str
@@ -75,7 +76,7 @@ class Fstab:
fsystem = "swap"
else:
fsystem = "ext2"
- self.addRaidDevice(mntPoint, raidDev, fsystem, level, devices)
+ self.addNewRaidDevice(mntPoint, raidDev, fsystem, level, devices)
def rescanPartitions(self):
if self.ddruid:
@@ -181,10 +182,14 @@ class Fstab:
os.unlink(file)
- def addRaidDevice(self, mountPoint, raidDevice, fileSystem,
+ def addNewRaidDevice(self, mountPoint, raidDevice, fileSystem,
raidLevel, deviceList):
self.supplementalRaid.append((mountPoint, raidDevice, fileSystem,
raidLevel, deviceList))
+
+ def addExistingRaidDevice(self, raidDevice, fileSystem, deviceList):
+ # these are added to the fstab separately!!!
+ self.existingRaid.append(raidDevice, fileSystem, deviceList)
def raidList(self):
(devices, raid) = self.ddruid.partitionList()
@@ -244,6 +249,8 @@ class Fstab:
self.messageWindow(_("Error"),
_("Error unmounting %s: %s") % (device, msg))
+ for (raidDevice, fileSystem, deviceList) in self.existingRaid:
+ isys.raidstop(raidDevice)
def makeFilesystems(self):
# let's make the RAID devices first -- the fstab will then proceed
@@ -320,6 +327,9 @@ class Fstab:
def mountFilesystems(self, instPath):
if (not self.setupFilesystems): return
+ for (raidDevice, fileSystem, deviceList) in self.existingRaid:
+ isys.raidstart(raidDevice, deviceList[0])
+
for (mntpoint, device, fsystem, doFormat, size) in self.mountList():
if fsystem == "swap":
continue
@@ -475,6 +485,7 @@ class Fstab:
self.messageWindow = messageWindow
self.badBlockCheck = 0
self.extraFilesystems = []
+ self.existingRaid = []
self.ddruid = self.createDruid()
# I intentionally don't initialize this, as all install paths should
# initialize this automatically
@@ -520,6 +531,13 @@ def readFstab (path, fstab):
f = open (path, "r")
lines = f.readlines ()
f.close
+
+ drives = fstab.driveList()
+ raidList = raid.scanForRaid(drives)
+ raidByDev = {}
+ for (mdDev, devList) in raidList:
+ raidByDev[mdDev] = devList
+
for line in lines:
fields = string.split (line)
# skip comments
@@ -537,4 +555,8 @@ def readFstab (path, fstab):
fields[0][0:8] != "/dev/rd/" and
fields[0][0:9] != "/dev/ida/"): continue
+ if fields[0][0:7] == "/dev/md":
+ fstab.addExistingRaidDevice(fields[0][5:], fields[1],
+ raidByDev[mdDev])
+
fstab.addMount(fields[0][5:], fields[1], fields[2])
diff --git a/raid.py b/raid.py
index 98c90e0a3..a74bc6fde 100644
--- a/raid.py
+++ b/raid.py
@@ -7,7 +7,11 @@ import os
def scanForRaid(drives):
for d in drives:
isys.makeDevInode(d, "/tmp/" + d)
- parts = _balkan.readTable('/tmp/' + d)
+ try:
+ parts = _balkan.readTable('/tmp/' + d)
+ except SystemError, msg:
+ parts = []
+
os.remove("/tmp/" + d)
raidSets = {}
raidDevices = {}
@@ -50,11 +54,11 @@ def scanForRaid(drives):
def startAllRaid(driveList):
mdList = []
- for (mdDevice, deviceList) in scanForRaid(['sda']):
+ for (mdDevice, deviceList) in scanForRaid(driveList):
devName = "md%d" % (mdDevice,)
isys.raidstart(devName, deviceList[0])
mdList.append(devName)
- return mdList
+ return mdList
def stopAllRaid(mdList):
for dev in mdList:
diff --git a/text.py b/text.py
index 762efa9c1..2b7ca4e03 100644
--- a/text.py
+++ b/text.py
@@ -1051,7 +1051,7 @@ class InstallInterface:
"bootdisk" ],
[_("Upgrade System"), InstallWindow, (self.screen, todo)],
[_("Boot Disk"), BootdiskWindow, (self.screen, todo), "bootdisk"],
- [_("Upgrade Complete"), FinishedWindow, (self.screen,)]
+ [_("Upgrade Complete"), FinishedWindow, (self.screen, todo)]
]
self.steps = self.commonSteps
diff --git a/todo.py b/todo.py
index 590ea2dff..607cd8e4b 100644
--- a/todo.py
+++ b/todo.py
@@ -827,6 +827,8 @@ class ToDo:
rootparts.append (dev)
isys.umount('/mnt/sysimage')
os.remove ('/tmp/' + dev)
+
+ raid.stopAllRaid(mdList)
for drive in drives:
isys.makeDevInode(drive, '/tmp/' + drive)
@@ -875,9 +877,11 @@ class ToDo:
self.getHeaderList ()
if self.setupFilesystems:
isys.makeDevInode(root, '/tmp/' + root)
+ mdList = raid.startAllRaid(self.fstab.driveList())
isys.mount('/tmp/' + root, '/mnt/sysimage')
fstab.readFstab('/mnt/sysimage/etc/fstab', self.fstab)
isys.umount('/mnt/sysimage')
+ raid.stopAllRaid(mdList)
self.fstab.mountFilesystems (self.instPath)
packages = rpm.findUpgradeSet (self.hdList.hdlist, self.instPath)
self.fstab.umountFilesystems (self.instPath)