summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2005-06-21 20:55:43 +0000
committerChris Lumens <clumens@redhat.com>2005-06-21 20:55:43 +0000
commitff58ec71b9f734e86368dd04950b2fd02209e03a (patch)
tree16de8c0028d79d3a2138e6f2a9d502c4ad47c947
parent9e79df0fc7c943653dff3a5f9f8023ddf9d8c451 (diff)
downloadanaconda-ff58ec71b9f734e86368dd04950b2fd02209e03a.tar.gz
anaconda-ff58ec71b9f734e86368dd04950b2fd02209e03a.tar.xz
anaconda-ff58ec71b9f734e86368dd04950b2fd02209e03a.zip
Add mount and umount methods so entries in /etc/fstab marked as "auto" can
still be mounted on upgrade (#160986).
-rw-r--r--ChangeLog4
-rw-r--r--fsset.py23
-rw-r--r--upgrade.py1
3 files changed, 25 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 8515f2845..0f808498e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,11 @@
2005-06-21 Chris Lumens <clumens@redhat.com>
+ * fsset.py (AutoFileSystem): Add mount and umount methods so entries
+ in /etc/fstab marked as "auto" can still be mounted on upgrade
+ (#160986).
* language.py (Language.setDefault): Canonicalize default language
(#160923).
+ * upgrade.py: Remove the comment that's no longer correct.
2005-06-20 Bill Nottingham <notting@redhat.com>
diff --git a/fsset.py b/fsset.py
index cca175cc2..af62036d2 100644
--- a/fsset.py
+++ b/fsset.py
@@ -309,7 +309,7 @@ class FileSystemType:
if not FileSystemType.kernelFilesystems:
self.readProcFilesystems()
- return FileSystemType.kernelFilesystems.has_key(self.getName())
+ return FileSystemType.kernelFilesystems.has_key(self.getName()) or self.getName() == "auto"
def isSupported(self):
if self.supported == -1:
@@ -991,9 +991,28 @@ class AutoFileSystem(PsudoFileSystem):
def __init__(self):
PsudoFileSystem.__init__(self, "auto")
+ def mount(self, device, mountpoint, readOnly=0, bindMount=0):
+ if not self.isMountable():
+ return
+ iutil.mkdirChain(mountpoint)
+ for fs in getFStoTry (device):
+ try:
+ isys.mount (device, mountpoint, fstype = fs, readOnly =
+ readOnly, bindMount = bindMount)
+ return
+ except SystemError, (num, msg):
+ errNum = num
+ errMsg = msg
+ continue
+
+ raise SystemError (errNum, errMsg)
+
+ def umount(self, device, path):
+ isys.umount(path, removeDir = 0)
+
fileSystemTypeRegister(AutoFileSystem())
-class BindFileSystem(AutoFileSystem):
+class BindFileSystem(PsudoFileSystem):
def __init__(self):
PsudoFileSystem.__init__(self, "bind")
diff --git a/upgrade.py b/upgrade.py
index 511e98c17..1b5abe679 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -145,7 +145,6 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0,
if flags.setupFilesystems:
oldfsset.mountFilesystems(instPath, readOnly = readOnly)
- # XXX we should properly support 'auto' at some point
if (not oldfsset.getEntryByMountPoint("/") or
not oldfsset.getEntryByMountPoint("/").fsystem or
not oldfsset.getEntryByMountPoint("/").fsystem.isMountable()):