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

patch for 223215



Hi list:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=223215
I saw that anaconda was adding the journaling to the ext2 filesystem but was not changing the fstab file to make the changes valid. Created a function inside the ext2FileSystem that changes the fstab file that is chrooted at /mnt/sysimage/etc/fstab. I'm working with anaconda-11.1.2.36. Is this the version that I should be using to work with rhel5 ???
The diffs for the bugs are attached.
diff -ubB anaconda-11.1.2.36/fsset.py anaconda-11.1.2.36-JG/fsset.py
--- anaconda-11.1.2.36/fsset.py	2007-01-26 22:49:59.000000000 +0100
+++ anaconda-11.1.2.36-JG/fsset.py	2007-04-02 19:50:22.000000000 +0200
@@ -639,6 +639,23 @@
         self.partedFileSystemType = parted.file_system_type_get("ext2")
         self.migratetofs = ['ext3']
 
+    def changeFstab(self, chroot, devicePath, location="/etc/fstab"):
+        #This only changes ext2 to ext3 #223215
+        fd = open(chroot+location, 'ro')
+        ftlines = fd.readlines()
+        fd.close()
+        outputfs = []
+        for line in ftlines:
+            if devicePath in line:
+                line = line.replace("ext2", "ext3")
+                outputfs.append(line)
+            else:
+                outputfs.append(line)
+        fd = open(chroot+location, 'w')
+        fd.writelines(outputfs)
+        fd.close()
+
+
     def migrateFileSystem(self, entry, message, chroot='/'):
         devicePath = entry.device.setupDevice(chroot)
 
@@ -652,6 +669,8 @@
         # if journal already exists skip
         if isys.ext2HasJournal(devicePath, makeDevNode = 0):
             log.info("Skipping migration of %s, has a journal already.\n" % devicePath)
+            # we still need to change the fstab if this happens, right?
+            self.changeFstab(chroot, devicePath)
             return
 
         rc = iutil.execWithRedirect("/usr/sbin/tune2fs",
@@ -681,6 +700,9 @@
         else:
             extFileSystem.setExt3Options(self, entry, message, chroot)
 
+        # After all the hard work, lets change the fstab for the user.
+        self.changeFstab(chroot, devicePath)
+
 
 fileSystemTypeRegister(ext2FileSystem())
 

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