From 12e34b26a99ada6c22fcee5abaac5a90fb2b8cf3 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Tue, 6 Oct 2015 07:45:53 +0200 Subject: =?UTF-8?q?S=C3=A9curity=20update,=20sync=20with=20Mintstick?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/raw_format.py | 9 +++++---- 1 file 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) -- cgit v1.2.1