From 6bf666a534f5376ba813b0aaf8993691d2925496 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Mon, 20 Jan 2020 09:42:52 +0100 Subject: Add encryption for persistent partition --- lib/isodumper.py | 65 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 47 insertions(+), 18 deletions(-) (limited to 'lib') diff --git a/lib/isodumper.py b/lib/isodumper.py index 785c996..23c506b 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -116,7 +116,7 @@ class Info(object): self.richtext=richtext self.text=text - + class IsoDumper(object): RELEASE="v1.15" @@ -212,12 +212,14 @@ class IsoDumper(object): self.progress.setDisabled() self.refreshbt.setEnabled() self.persistencecb.setDisabled() + self.cryptcb.setDisabled() + self.cryptkey.setDisabled() def onProgress(self, frac): self.logger(_('Wrote: {}% '.format(frac))) self.progress.setValue(frac) self.dialog.pollEvent() - + def raw_format(self, usb_path, fstype, label): self.operation=True if os.geteuid() > 0: @@ -310,7 +312,6 @@ class IsoDumper(object): success, message = iface.do_unmount(target) if success: #Writing step - #Dump mode iface.do_write(source, target, b) iface.get_sum(source) progress = iface.progress @@ -324,8 +325,8 @@ class IsoDumper(object): self.logger(_('Image {source} successfully written to {target}').format( source=source.split('/')[-1], target=target)) self.logger(_('Bytes written: ')+str(b)) self.progress.setLabel(_('Checking ')+target.split('/')[-1]) - self.progress.setValue(0) - self.dialog.pollEvent() + self.progress.setValue(0) + self.dialog.pollEvent() # Checking iface.check_write(target, source) progress = iface.progress @@ -340,13 +341,20 @@ class IsoDumper(object): self.dialog.pollEvent() self.logger(message) # Add persistent partition if asked - if self.persistencecb.value(): + if self.persistencecb.isChecked(): self.logger(_("Adding persistent partition")) - iface.do_persistence(target,"mgalive-persist") - self.logger(_("Added persistent partition")) + if self.cryptcb.isChecked(): + if self.cryptkey.value() == "": + self.logger(_("No key for crypted partition provided. Adding the partition aborted.")) + else: + iface.do_persistence(target,"mgalive-persist",self.cryptkey.value()) + self.logger(_("Added crypted persistent partition")) + else: + iface.do_persistence(target,"mgalive-persist", "") + self.logger(_("Added persistent partition")) #Eject self.u.eject(target) - self.success() + self.success() else: self.emergency(message) else: @@ -401,7 +409,7 @@ class IsoDumper(object): self.backupbt.setDisabled() self.refreshbt.setDisabled() self.persistencecb.setDisabled() - + def close(self): self.write_logfile() self.dialog.destroy() @@ -473,13 +481,13 @@ NTFS or ext. You can specify a volume name and the format in a new dialog box.Papoteur
Pictures : Timothée Giet"), _("A tool for writing ISO images to a device")+"
http://gitweb.mageia.org/software/isodumper", "") dlg.show(); - + def nodevDialog(self): yui.YUI.widgetFactory mgafactory = yui.YMGAWidgetFactory.getYMGAWidgetFactory(yui.YExternalWidgets.externalWidgetFactory("mga")) @@ -685,6 +702,19 @@ NTFS or ext. You can specify a volume name and the format in a new dialog box.