[rhel5-branch][PATCH] Store and write out 'noauto' fstab lines (#873644)

Vratislav Podzimek vpodzime at redhat.com
Mon May 20 10:05:31 UTC 2013


These lines should be ignored by the installer when mounting, but should be
preserved on upgrades. And since they are no mounted automatically, there's no
need to comment them out.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 fsset.py | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/fsset.py b/fsset.py
index 48715c0..3d25416 100644
--- a/fsset.py
+++ b/fsset.py
@@ -1317,6 +1317,7 @@ class FileSystemSet:
         self.volumesCreated = 0
         self.anaconda = anaconda
         self.unknownFSlines = list()
+        self.noautoLines = list()
 
     def isActive(self):
         return self.mountcount != 0
@@ -1432,7 +1433,10 @@ class FileSystemSet:
         new = FileSystemSet(self.anaconda)
         for entry in self.entries:
             new.add (entry)
+
+        new.noautoLines = self.noautoLines[:]
         new.unknownFSlines = self.unknownFSlines[:]
+
         return new
 
     def extend (self, fsset):
@@ -1445,6 +1449,7 @@ class FileSystemSet:
         for entry in fsset.entries:
             self.add(entry)
 
+        self.noautoLines.extend(fsset.noautoLines)
         self.unknownFSlines.extend(fsset.unknownFSlines)
 
     def fstab (self):
@@ -1475,6 +1480,10 @@ class FileSystemSet:
                                           options, entry.fsck,
                                           entry.order)
 
+        # append the lines with 'noauto' option (should not cause any harm during boot)
+        for line in self.noautoLines:
+            fstab += line
+
         # append commented out lines with unknown (not supported) filesystems
         for line in self.unknownFSlines:
             fstab += "#" + line
@@ -2971,7 +2980,10 @@ def readFstab (anaconda):
             fields.append(0)                        
         elif len(fields) > 6:
             continue
-	if string.find(fields[3], "noauto") != -1: continue
+
+	if string.find(fields[3], "noauto") != -1:
+            fsset.noautoLines.append(line)
+            continue
 
         # shenanigans to handle ext3,ext2 format in fstab
         fstotry = fields[2]
-- 
1.7.11.7



More information about the anaconda-patches mailing list