summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2006-05-26 17:20:14 +0000
committerChris Lumens <clumens@redhat.com>2006-05-26 17:20:14 +0000
commit4a9f8bf457e5dc799671dfda4b0c6125917b714d (patch)
tree496c191f0c121888ced7304b6aba7db7fd2284b9
parentdf43bd85d5940ae14fbd7517787b2c46a955e447 (diff)
downloadanaconda-4a9f8bf457e5dc799671dfda4b0c6125917b714d.tar.gz
anaconda-4a9f8bf457e5dc799671dfda4b0c6125917b714d.tar.xz
anaconda-4a9f8bf457e5dc799671dfda4b0c6125917b714d.zip
Don't try to mount protected partitions again, as this will cause an error
since they are already mounted as the installation source.
-rw-r--r--ChangeLog10
-rw-r--r--fsset.py13
-rw-r--r--packages.py2
-rw-r--r--rescue.py3
-rw-r--r--upgrade.py22
5 files changed, 32 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index e1df890cf..ba6126aba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-05-26 Chris Lumens <clumens@redhat.com>
+
+ * fsset.py (FileSystemSet.mountFilesystems): Don't try to mount any
+ protected partitions since they are already mounted as the
+ installation source, and trying again will cause an error.
+
+ * packages.py (turnOnFilesystems): Use anaconda class.
+ * rescue.py (runRescue): Likewise.
+ * upgrade.py (mountRootPartition): Likewise.
+
2006-05-26 David Cantrell <dcantrell@redhat.com>
* isys/Makefile: Remove getipaddr.o reference.
diff --git a/fsset.py b/fsset.py
index 886830175..d26fe2df5 100644
--- a/fsset.py
+++ b/fsset.py
@@ -1698,13 +1698,18 @@ MAILADDR root
self.migratedfs = 1
- def mountFilesystems(self, instPath = '/', raiseErrors = 0, readOnly = 0):
+ def mountFilesystems(self, anaconda, raiseErrors = 0, readOnly = 0):
+ protected = anaconda.method.protectedPartitions()
+
for entry in self.entries:
- if not entry.fsystem.isMountable():
+ # Don't try to mount a protected partition, since it will already
+ # have been mounted as the installation source.
+ if not entry.fsystem.isMountable() or (protected and entry.device.getDevice() in protected):
continue
+
try:
log.info("trying to mount %s on %s" %(entry.device.getDevice(), entry.mountpoint))
- entry.mount(instPath, readOnly = readOnly)
+ entry.mount(anaconda.rootPath, readOnly = readOnly)
self.mountcount = self.mountcount + 1
except OSError, (num, msg):
if self.messageWindow:
@@ -1742,7 +1747,7 @@ MAILADDR root
entry.mountpoint, msg))
sys.exit(0)
- self.makeLVMNodes(instPath)
+ self.makeLVMNodes(anaconda.rootPath)
def makeLVMNodes(self, instPath, trylvm1 = 0):
# XXX hack to make the device node exist for the root fs if
diff --git a/packages.py b/packages.py
index 6b0173601..d8469c600 100644
--- a/packages.py
+++ b/packages.py
@@ -143,7 +143,7 @@ def turnOnFilesystems(anaconda):
anaconda.id.fsset.formatSwap(anaconda.rootPath)
anaconda.id.fsset.turnOnSwap(anaconda.rootPath)
anaconda.id.fsset.makeFilesystems (anaconda.rootPath)
- anaconda.id.fsset.mountFilesystems (anaconda.rootPath)
+ anaconda.id.fsset.mountFilesystems (anaconda)
def setupTimezone(anaconda):
# we don't need this on an upgrade or going backwards
diff --git a/rescue.py b/rescue.py
index fe29df013..620f87fa7 100644
--- a/rescue.py
+++ b/rescue.py
@@ -332,8 +332,7 @@ def runRescue(anaconda):
# only pass first two parts of tuple for root, since third
# element is a comment we dont want
- rc = upgrade.mountRootPartition(anaconda.intf, root[:2],
- fs, anaconda.rootPath,
+ rc = upgrade.mountRootPartition(anaconda, root[:2], fs,
allowDirty = 1, warnDirty = 1,
readOnly = readOnly)
diff --git a/upgrade.py b/upgrade.py
index 6dbd91730..c332d66cb 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -118,7 +118,7 @@ def getDirtyDevString(dirtyDevs):
ret = "%s\n" % (dev,)
return ret
-def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
+def mountRootPartition(anaconda, rootInfo, oldfsset, allowDirty = 0,
raiseErrors = 0, warnDirty = 0, readOnly = 0):
(root, rootFs) = rootInfo
@@ -128,21 +128,21 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
lvm.vgscan()
lvm.vgactivate()
- log.info("going to mount %s on %s as %s" %(root, instPath, rootFs))
- isys.mount(root, instPath, rootFs)
+ log.info("going to mount %s on %s as %s" %(root, anaconda.rootPath, rootFs))
+ isys.mount(root, anaconda.rootPath, rootFs)
oldfsset.reset()
- newfsset = fsset.readFstab(instPath + '/etc/fstab', intf)
+ newfsset = fsset.readFstab(anaconda.rootPath + '/etc/fstab', anaconda.intf)
for entry in newfsset.entries:
oldfsset.add(entry)
- isys.umount(instPath)
+ isys.umount(anaconda.rootPath)
- dirtyDevs = oldfsset.hasDirtyFilesystems(instPath)
+ dirtyDevs = oldfsset.hasDirtyFilesystems(anaconda.rootPath)
if not allowDirty and dirtyDevs != []:
diskset.stopAllRaid()
lvm.vgdeactivate()
- intf.messageWindow(_("Dirty File Systems"),
+ anaconda.intf.messageWindow(_("Dirty File Systems"),
_("The following file systems for your Linux system "
"were not unmounted cleanly. Please boot your "
"Linux installation, let the file systems be "
@@ -150,7 +150,7 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
"%s" %(getDirtyDevString(dirtyDevs),)))
sys.exit(0)
elif warnDirty and dirtyDevs != []:
- rc = intf.messageWindow(_("Dirty File Systems"),
+ rc = anaconda.intf.messageWindow(_("Dirty File Systems"),
_("The following file systems for your Linux "
"system were not unmounted cleanly. Would "
"you like to mount them anyway?\n"
@@ -160,7 +160,7 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
return -1
if flags.setupFilesystems:
- oldfsset.mountFilesystems(instPath, readOnly = readOnly)
+ oldfsset.mountFilesystems(anaconda, readOnly = readOnly)
if (not oldfsset.getEntryByMountPoint("/") or
not oldfsset.getEntryByMountPoint("/").fsystem or
@@ -285,8 +285,8 @@ def upgradeMountFilesystems(anaconda):
if flags.setupFilesystems:
try:
- mountRootPartition(anaconda.intf, anaconda.id.upgradeRoot[0], anaconda.id.fsset,
- anaconda.rootPath, allowDirty = 0)
+ mountRootPartition(anaconda, anaconda.id.upgradeRoot[0], anaconda.id.fsset,
+ allowDirty = 0)
except SystemError, msg:
anaconda.intf.messageWindow(_("Mount failed"),
_("One or more of the file systems listed in the "