[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 2/2] Comment out the fstab lines with unknown filesystem rather then ignoring them



When doing upgrade, there is no need to ignore the fstab lines with filesystem
Anaconda does not support. We can leave the lines as they are and just comment
them out to prevent mounting problems during the next boot.

Resolves: rhbz#754213
---
 fsset.py |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/fsset.py b/fsset.py
index 9636003..64d948d 100644
--- a/fsset.py
+++ b/fsset.py
@@ -1297,6 +1297,20 @@ class AutoFileSystem(PsudoFileSystem):
 
 fileSystemTypeRegister(AutoFileSystem())
 
+class unknownFileSystem(FileSystemType):
+    def __init__(self, fstype):
+        FileSystemType.__init__(self)
+        self.partedFileSystemType = None
+        self.formattable = 0
+        self.checked = 0
+        self.linuxnativefs = 0
+        self.supported = 0
+
+        self.name = fstype
+
+    def formatDevice(self, entry, progress, chroot='/'):
+        pass
+
 class BindFileSystem(PsudoFileSystem):
     def __init__(self):
         PsudoFileSystem.__init__(self, "bind")
@@ -1456,6 +1470,10 @@ class FileSystemSet:
                 options = entry.getOptions()
                 if entry.mountpoint == "/" and options is not None:
                     options = options.replace(",_netdev", ",_rnetdev")
+
+                # comment out lines with unknown filesystem
+                if isinstance(entry.fsystem, unknownFileSystem):
+                    device = "#" + device
                 fstab = fstab + format % (device, entry.mountpoint,
                                           entry.fsystem.getName(),
                                           options, entry.fsck,
@@ -2969,8 +2987,8 @@ def readFstab (anaconda):
             break
         # "none" is valid as an fs type for bind mounts (#151458)
         if fsystem is None and (string.find(fields[3], "bind") == -1):
-            continue
-        
+            fsystem = unknownFileSystem(fstotry[0])
+
         label = None
 	if fields[0] == "none":
             device = Device()
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]