[Pkg-privacy-commits] [tails-installer] 09/12: Apply awful hack to fix #14755.
Ulrike Uhlig
ulrike at moszumanska.debian.org
Mon Nov 20 14:55:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
ulrike pushed a commit to annotated tag tails-installer_5.0.2
in repository tails-installer.
commit baf190c03cc2c82e5397929921daf54bf4b31290
Author: anonym <anonym at riseup.net>
Date: Thu Nov 9 20:15:01 2017 +0100
Apply awful hack to fix #14755.
So the #14755 error occurs because we try to do a fresh install
(incl. writing a partition table) to a partition (e.g. /dev/sda1), not
a device (e.g. /dev/sda). There are *two* different mechanisms where
we attempt to target the parent device instead of its partitions, one
triggered by force_reinstall in TailsInstallerThread's run(), one
triggered by live.force_reinstall in LinuxTailsInstallerCreator's
detect_supported_drives(). We need one of these to trigger, and the
reason they don't is because in on_target_changed(), for the
non-upgrade case, we set neither of these triggering variables.
Due to #14720 I'm not able to understand the "model", so my changes
probably doesn't exactly help the murky semantics of
force_reinstall. I've basically overloaded it with "if set, we should
install to the target's parent, if it exists", which solves #14755
since force_reinstall is True iff we are not upgrading, and that is
the only time we don't want this re-targeting.
Refs: #14720
Will-fix: #14755
---
tails_installer/gui.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index 0f199fc..d8f7a5b 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -196,8 +196,10 @@ class TailsInstallerThread(threading.Thread):
if self.parent.force_reinstall:
parent = _to_unicode(self.live.drive['parent'])
self.rescan_devices(force_partitions=False)
- self.live.drive = self.live.drives[parent]['device']
- self.live.save_full_drive()
+ if parent in self.live.drives and \
+ 'device' in self.live.drives[parent]:
+ self.live.drive = self.live.drives[parent]['device']
+ self.live.save_full_drive()
self.live.partition_device()
self.rescan_devices(force_partitions=True)
self.live.switch_drive_to_system_partition()
@@ -453,6 +455,8 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
self.__button_force_reinstall.set_visible(True)
else:
self.opts.partition = True
+ self.force_reinstall = True
+ self.live.force_reinstall = False
self.__button_start.set_label(_('Install'))
self.__button_force_reinstall.set_visible(False)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/tails-installer.git
More information about the Pkg-privacy-commits
mailing list