summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2017-11-09 20:15:01 +0100
committeranonym <anonym@riseup.net>2017-11-10 12:22:59 +0100
commitbaf190c03cc2c82e5397929921daf54bf4b31290 (patch)
tree79375b40ad582af5d88fcb962363524683ce2daa
parent2ece721b4684528ef469a119515a839b34d960b0 (diff)
Apply awful hack to fix #14755.bugfix/14755-consistent-drive-plugging-state
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
-rwxr-xr-xtails_installer/gui.py8
1 files 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)