[PATCH] allow ext3->ext4 upgrades

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

 



I have not been able to test this because each time I try, I get
"Multiple devices on your system are labelled /." [Exit Installer]
even though really, truly, and honestly only one device is labeled
"/"

If this looks reasonably safe, maybe it can get tossed into the mix
and I'll try the upgrade another day....

All it does is mark it with the "test_fs" flag (which won't be needed
when ext4 goes "live") and then as long as the ext3 fs is mounted as
ext4 during install, every file which is created/updated/installed
will be in the new extents format.

Thanks,

-Eric

Index: anaconda-11.4.0.33/fsset.py
===================================================================
--- anaconda-11.4.0.33.orig/fsset.py
+++ anaconda-11.4.0.33/fsset.py
@@ -703,11 +703,31 @@ class ext3FileSystem(extFileSystem):
         self.name = "ext3"
         self.extraFormatArgs = [ "-j" ]
         self.partedFileSystemType = parted.file_system_type_get("ext3")
+        if flags.cmdline.has_key("iamanext4developer"):
+            self.migratetofs = ['ext4dev']
 
     def formatDevice(self, entry, progress, chroot='/'):
         extFileSystem.formatDevice(self, entry, progress, chroot)
         extFileSystem.setExt3Options(self, entry, progress, chroot)
 
+    def migrateFileSystem(self, entry, message, chroot='/'):
+        devicePath = entry.device.setupDevice(chroot)
+
+        if not entry.fsystem or not entry.origfsystem:
+            raise RuntimeError, ("Trying to migrate fs w/o fsystem or "
+                                 "origfsystem set")
+        if entry.fsystem.getName() != "ext3":
+            raise RuntimeError, ("Trying to migrate ext3 to something other "
+                                 "than ext4")
+
+	# This is only needed as long as ext4 is actually "ext4dev"
+        rc = iutil.execWithRedirect("tune2fs",
+                                    ["-E", "test_fs", devicePath ],
+                                    stdout = "/dev/tty5",
+                                    stderr = "/dev/tty5", searchPath = 1)
+        if rc:
+            raise SystemError
+
 fileSystemTypeRegister(ext3FileSystem())
 
 class ext4FileSystem(extFileSystem):

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux