aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbackend/raw_write.py15
-rwxr-xr-xlib/isodumper.py5
2 files changed, 13 insertions, 7 deletions
diff --git a/backend/raw_write.py b/backend/raw_write.py
index 8338a07..0ea3bcc 100755
--- a/backend/raw_write.py
+++ b/backend/raw_write.py
@@ -246,16 +246,17 @@ class Dumper(object):
if rc != 0:
self.return_state = False
self.return_message = _("Error while doing persistent partition: ") + errs.decode('utf-8')
+ logging.error(self.return_message)
return
logging.debug("New partition created")
- self._progress = 33
+ self._progress = 25
# Wait for propagation of the info of new partition table
if not self.udev_wait("creating a new partition table"):
return
- self._progress = 50
if key == "":
# example mkfs.ext4 -L mgalive-persist /dev/sdf3
+ self.return_message = _("Persistent partition added. Formatting...")
process = Popen(['mkfs.ext4', "-q",'-F','-L', label, target+"3"],stderr=PIPE)
outs, errs = process.communicate()
working=True
@@ -282,7 +283,7 @@ class Dumper(object):
return
else:
# example cryptsetup luksFormat /dev/sdb3
- print("Crypt key provided",file=sys.stderr)
+ self.return_message = _("Persistent partition added. Encrypting...")
base_target = os.path.basename(target) + "3"
process = Popen(['cryptsetup','luksFormat','-q', target+"3", '-d', '-'],stdin=PIPE, stderr=PIPE)
outs, errs = process.communicate(input=key.encode('utf-8'))
@@ -302,7 +303,8 @@ class Dumper(object):
logging.error(self.return_message)
self.finished.set()
return
- self._progress = 75
+ self._progress = 50
+ self.return_message = _("Persistent partition encrypted. Opening...")
# cryptsetup open /dev/sdb3 crypt_sdb3
if not self.udev_wait("creating encrypted partition"):
return
@@ -328,6 +330,8 @@ class Dumper(object):
if not self.udev_wait(_("opening encrypted partition")):
return
+ self._progress = 60
+ self.return_message = _("Persistent partition opened: formatting...")
# mkfs.ext4 -L mgalive-persist /dev/mapper/crypt_sdb3
process = Popen(['mkfs.ext4','-q','-F','-L', label, '/dev/mapper/crypt_' + base_target],stderr=PIPE)
outs, errs = process.communicate()
@@ -347,6 +351,7 @@ class Dumper(object):
logging.error(self.return_message)
self.finished.set()
return
+ self._progress = 90
# cryptsetup close crypt_sdb3
if not self.udev_wait(_("formatting encrypted partition")):
@@ -370,7 +375,7 @@ class Dumper(object):
else:
self.return_state = True
self.return_message = _("Persistent partition done")
- logging.info("Persistent partition done")
+ logging.info(self.return_message)
if not self.udev_wait(_("closing encrypted partition")):
return
self._progress = 100
diff --git a/lib/isodumper.py b/lib/isodumper.py
index 32f311c..51e85ff 100755
--- a/lib/isodumper.py
+++ b/lib/isodumper.py
@@ -403,8 +403,6 @@ class IsoDumper(object):
time.sleep(.5)
success, message = iface.end()
self.progress.setEnabled()
- self.progress.setValue(100)
- self.dialog.pollEvent()
self.logger(message)
# Add persistent partition if asked
if self.persistencecb.isChecked():
@@ -419,6 +417,7 @@ class IsoDumper(object):
while not iface.done:
progress = iface.progress
self.progress.setValue(progress)
+ self.progress.setLabel(iface.message)
self.dialog.pollEvent()
time.sleep(.5)
if iface.state:
@@ -434,6 +433,8 @@ class IsoDumper(object):
time.sleep(.5)
self.logger(_("Added persistent partition"))
# Unmount if partitions are automatically mounted and then eject
+ self.progress.setValue(100)
+ self.dialog.pollEvent()
success, message = self.u.do_unmount(target)
self.udev_wait(_("unmounting"))
if success: