aboutsummaryrefslogtreecommitdiffstats
path: root/lib/raw_format.py
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2019-09-07 16:54:02 +0200
committerPapoteur <papoteur@mageia.org>2019-09-07 16:54:02 +0200
commit1a039ea07ae7687e8d83ad12af57b98bde9ee4d2 (patch)
tree6583c79423b0428194ed7e53af9c130ff98cfd32 /lib/raw_format.py
parent0910c539f06f5d92a3bc613ea9a7e7fc1f76fcf3 (diff)
downloadisodumper-1a039ea07ae7687e8d83ad12af57b98bde9ee4d2.tar
isodumper-1a039ea07ae7687e8d83ad12af57b98bde9ee4d2.tar.gz
isodumper-1a039ea07ae7687e8d83ad12af57b98bde9ee4d2.tar.bz2
isodumper-1a039ea07ae7687e8d83ad12af57b98bde9ee4d2.tar.xz
isodumper-1a039ea07ae7687e8d83ad12af57b98bde9ee4d2.zip
Add exfat format
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"):