aboutsummaryrefslogtreecommitdiffstats
path: root/backend
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2020-11-18 22:30:01 +0100
committerPapoteur <papoteur@mageia.org>2020-11-18 22:30:01 +0100
commit513b313a4db10c4fba28023a5fa5657ad826b042 (patch)
tree865b3c3876a307e5516b0ea27dcebed60b3f936c /backend
parentdc200cd8a75d489474ac880905757fa52f1f3d98 (diff)
downloadisodumper-513b313a4db10c4fba28023a5fa5657ad826b042.tar
isodumper-513b313a4db10c4fba28023a5fa5657ad826b042.tar.gz
isodumper-513b313a4db10c4fba28023a5fa5657ad826b042.tar.bz2
isodumper-513b313a4db10c4fba28023a5fa5657ad826b042.tar.xz
isodumper-513b313a4db10c4fba28023a5fa5657ad826b042.zip
Add more details about operation
Diffstat (limited to 'backend')
-rwxr-xr-xbackend/raw_write.py15
1 files changed, 10 insertions, 5 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