diff options
Diffstat (limited to 'backend/raw_write.py')
| -rwxr-xr-x | backend/raw_write.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/backend/raw_write.py b/backend/raw_write.py index fe21046..7a7ae18 100755 --- a/backend/raw_write.py +++ b/backend/raw_write.py @@ -198,7 +198,7 @@ class Dumper(object): return False return True - def _do_persistence(self, target, label, key, fs_type): + def _do_format(self, target, label, key, fs_type, order=3): logging.debug("Start doing persistence partition") p = Popen(["fdisk", target], stdin=PIPE, stderr=PIPE) # commands: @@ -208,7 +208,7 @@ class Dumper(object): # default first sector # default last sector # w : write and quit - outs, errs = p.communicate(input=b"n\np\n3\n\n\nw\n") + outs, errs = p.communicate(input=b"n\np\n" + bytes(order) + b"\n\n\nw\n") working = True while working: time.sleep(0.5) @@ -266,7 +266,7 @@ class Dumper(object): if key == "": # example mkfs.ext4 -L mgalive-persist /dev/sdf3 self.return_message = _("Additional partition added. Formatting...") - path = target + "3" + path = target + str(order) # Format partition according to the fs_type specified fs_type = fs_type.lower() if fs_type == "fat32": @@ -314,9 +314,9 @@ class Dumper(object): else: # example cryptsetup luksFormat /dev/sdb3 self.return_message = _("Persistent partition added. Encrypting...") - base_target = os.path.basename(target) + "3" + base_target = os.path.basename(target) + str(order) process = Popen( - ["cryptsetup", "luksFormat", "-q", target + "3", "-d", "-"], + ["cryptsetup", "luksFormat", "-q", target + str(order), "-d", "-"], stdin=PIPE, stderr=PIPE, ) @@ -349,7 +349,7 @@ class Dumper(object): [ "cryptsetup", "luksOpen", - target + "3", + target + str(order), "crypt_" + base_target, "-d", "-", |
