aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageialinux-online.org>2015-10-09 18:41:05 +0200
committerPapoteur <papoteur@mageialinux-online.org>2015-10-09 18:41:05 +0200
commit755cb6c801aa89cf0462634d5876d59e2b513b28 (patch)
treef90b032787364d523832a7f2fe8b74766ca614b5
parentd52548539cfb3a1408c249a40db30c021fbb71ef (diff)
downloadisodumper-755cb6c801aa89cf0462634d5876d59e2b513b28.tar
isodumper-755cb6c801aa89cf0462634d5876d59e2b513b28.tar.gz
isodumper-755cb6c801aa89cf0462634d5876d59e2b513b28.tar.bz2
isodumper-755cb6c801aa89cf0462634d5876d59e2b513b28.tar.xz
isodumper-755cb6c801aa89cf0462634d5876d59e2b513b28.zip
Security upadte sync with Minstick
-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 00b1f97..2d240a0 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)