btrfs, xfs, ext4 tested - filesystem is made correctly. Note that filesystem
shrinking is still extN specific.
---
 imgcreate/fs.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index e3be9a8..37ff9d8 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -453,11 +453,16 @@ class ExtDiskMount(DiskMount):
 
     def __format_filesystem(self):
         logging.info("Formating %s filesystem on %s" % (self.fstype, 
self.disk.device))
-        rc = call(["/sbin/mkfs." + self.fstype,
-                   "-F", "-L", self.fslabel,
-                   "-m", "1", "-b", str(self.blocksize),
-                   self.disk.device])
-        #          str(self.disk.size / self.blocksize)])
+        args = [ "/sbin/mkfs." + self.fstype ]
+        if self.fstype.startswith("ext"):
+            args = args + [ "-F", "-L", self.fslabel, "-m", "1", "-b", 
str(self.blocksize) ]
+        elif self.fstype == "xfs":
+            args = args + [ "-L", self.fslabel[0:10], "-b", "size=%s" % 
str(self.blocksize) ]
+        elif self.fstype == "btrfs":
+            args = args + [ "-L", self.fslabel ]
+        args = args + [self.disk.device]
+        print args
+        rc = call(args)
 
         if rc != 0:
             raise MountError("Error creating %s filesystem" % (self.fstype,))
-- 
1.8.4.2

--
livecd mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/livecd

Reply via email to