aboutsummaryrefslogtreecommitdiffstats
path: root/lib/raw_format.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/raw_format.py')
-rwxr-xr-xlib/raw_format.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/raw_format.py b/lib/raw_format.py
index 0cce0e9..54e7bcb 100755
--- a/lib/raw_format.py
+++ b/lib/raw_format.py
@@ -97,7 +97,10 @@ def raw_format(device_path, fstype, volume_label, uid, gid):
sys.exit(5)
# fstype
- fs = parted.FileSystem(type=fstype, geometry=geometry)
+ _fstype = fstype
+ if _fstype == "exfat":
+ _fstype = "ntfs"
+ fs = parted.FileSystem(type=_fstype, geometry=geometry)
# Create partition
partition = parted.Partition(disk=disk, type=parted.PARTITION_NORMAL, geometry=geometry, fs=fs)
@@ -108,7 +111,9 @@ def raw_format(device_path, fstype, volume_label, uid, gid):
# Format partition according to the fstype specified
if fstype == "fat32":
call(["mkdosfs", "-F", "32", "-n", volume_label, partition.path])
- if fstype == "ntfs":
+ elif fstype == "exfat":
+ call(["mkfs.exfat", "-n", volume_label, partition.path])
+ elif fstype == "ntfs":
call(["mkntfs", "-f", "-L", volume_label, partition.path])
elif fstype == "ext4":
call(["mkfs.ext4", "-E", "root_owner=%s:%s" % (uid, gid), "-L", volume_label, partition.path])
@@ -140,8 +145,8 @@ def main():
elif o in ("-d"):
device = a
elif o in ("-f"):
- if a not in [ "fat32", "ntfs", "ext4" ]:
- print("Specify fat32, ntfs or ext4")
+ if a not in [ "fat32","exfat", "ntfs", "ext4" ]:
+ print("Specify fat32, exfat, ntfs or ext4")
sys.exit(3)
fstype = a
elif o in ("-l"):