diff options
authorTails developers <>2015-01-11 17:29:22 +0000
committerTails developers <>2015-01-14 20:00:40 +0000
commit242ef1cedbc55ee847c4946723105c4acb9b3e07 (patch)
parentef36cf0d62de5180f7fd4735dbd9d046b42c6603 (diff)
Remove racy call to rescan_devices() after unmounting target device (Closes: #6092).bugfix/6092-drop-racy-code
As demonstrated in #6092, this call sometimes fails. It's a pile of nested DBus calls, and I'm not surprised to see it's racy when called after sync'ing that many changes on the target device. We could debug it to make it work at that stage, but it would be painful, and this function was actually not meant to support this usecase in the first place. Note that actually, we don't really need to rescan all devices at that point: we just need to have the parent ("full") device in the drives list. However, when we need this, for some reason (probably the hybrid MBR and switch to partition hacks), the drives list only contains the target system partition, so: * let's store, in the _full_drive attribute, not only the parent device name, but all the information we need about it; * let's save this information early enough, when it's still in the drives list; * in switch_back_to_full_drive, we add that information to the drives list.
2 files changed, 11 insertions, 7 deletions
diff --git a/liveusb/ b/liveusb/
index 20981d6..82721c3 100755
--- a/liveusb/
+++ b/liveusb/
@@ -907,24 +907,28 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
return False
+ def save_full_drive(self):
+ self._full_drive = self.drives[self._drive]
def switch_drive_to_system_partition(self):
- self._full_drive = self._drive
+ full_drive_name = self._full_drive['device']
append = False
- if self._full_drive.startswith('/dev/sd'):
+ if full_drive_name.startswith('/dev/sd'):
append = '1'
- elif self._full_drive.startswith('/dev/mmcblk'):
+ elif full_drive_name.startswith('/dev/mmcblk'):
append = 'p1'
if not append:
_("Unsupported device '%(device)s', please report a bug." %
- {'device': self._full_drive})
+ {'device': full_drive_name})
)'Trying to continue anyway.'))
append = '1'
- = '%s%s' % (self._full_drive, append)
+ = '%s%s' % (full_drive_name, append)
def switch_back_to_full_drive(self):
- = self._full_drive
+ self.drives[self._full_drive['device']] = self._full_drive
+ = self._full_drive['device']
def verify_filesystem(self):"Verifying filesystem..."))
diff --git a/liveusb/ b/liveusb/
index f6e82cc..6ac7ce0 100755
--- a/liveusb/
+++ b/liveusb/
@@ -193,6 +193,7 @@ class LiveUSBThread(QtCore.QThread):
self.handler = LiveUSBLogHandler(self.status) =
if self.parent.opts.partition:
@@ -256,7 +257,6 @@ class LiveUSBThread(QtCore.QThread):
if self.parent.opts.partition:
- self.rescan_devices()