aboutsummaryrefslogtreecommitdiffstats
path: root/lib/raw_format.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/raw_format.py')
-rwxr-xr-xlib/raw_format.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/raw_format.py b/lib/raw_format.py
index 84ca8c7..b634470 100755
--- a/lib/raw_format.py
+++ b/lib/raw_format.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
#
# imported from project Mintstick, by Clement Lefebvre
+# https://github.com/linuxmint/mintstick/
#
# Copyright (C) 2013 THE isodumper'S COPYRIGHT HOLDER
# This file is distributed under the same license as the isodumper package.
@@ -63,7 +64,7 @@ def raw_format(device_path, fstype, volume_label, uid, gid):
do_umount(device_path)
# First erase MBR and partition table , if any
- os.system ("dd if=/dev/zero of=%s bs=512 count=1 >/dev/null 2>&1" % device_path)
+ call(["dd", "if=/dev/zero", "of=%s" % device_path, "bs=512", "count=1"])
device = parted.getDevice(device_path)
@@ -106,11 +107,11 @@ def raw_format(device_path, fstype, volume_label, uid, gid):
# Format partition according to the fstype specified
if fstype == "fat32":
- os.system("mkdosfs -F 32 -n \"%s\" %s >/dev/null 2>&1" % (volume_label, partition.path))
+ call(["mkdosfs", "-F", "32", "-n", volume_label, partition.path])
if fstype == "ntfs":
- os.system("mkntfs -f -L \"%s\" %s >/dev/null 2>&1" % (volume_label, partition.path))
+ call(["mkntfs", "-f", "-L", volume_label, partition.path])
elif fstype == "ext4":
- os.system("mkfs.ext4 -E root_owner=%s:%s -L \"%s\" %s >/dev/null 2>&1" % (uid, gid, volume_label, partition.path))
+ call(["mkfs.ext4", "-E", "root_owner=%s:%s" % (uid, gid), "-L", volume_label, partition.path])
sys.exit(0)