diff options
authorTails developers <>2014-06-15 16:27:38 +0000
committerTails developers <>2014-06-15 16:31:27 +0000
commitac299ea4bc11ead4d8861ffb70666ca168eddc03 (patch)
parentc566b7ef68f6f5b32f9f5596639b05a1511f201f (diff)
Always reset the target drive's MBR, without asking for confirmation, after installing or upgrading.
The MBR used to upgrade the target drive's one is the mbr.bin (which is really syslinux' gptmbr.bin) found in utils/mbr/ on the target drive, once the up-to-date files have been extracted there. This ensures that the syslinux MBR installed on that drive matches both the version of syslinux (from utils/linux/syslinux) used to update ldlinux.sys, and the version of syslinux from which the installed COM32R modules were taken. We already did that previously (though earlier in the installation process) for initial installations. On upgrades, we used to ask for a confirmation. This had two problems: * The displayed message was using technical terms that most users don't understand. So, they were facing a blocking decision they had no means to make in a well-informed way. Either they chose not to update the MBR, and then their Tails device may not boot anymore on some hardware. Or, they chose to update it, possibly losing their own custom MBR. * It added a dimension to the matrix of existing Tails USB devices, which may imply users facing problems we've never thought of, and could not understand nor reproduce. So, let's make things simpler, and ensure that *all* boot devices installed with Tails Installer, that run a given version of Tails, have a MBR coming from the version of syslinux shipped in that version of Tails. Now, not asking for confirmation means that we can possibly destroy up to 440 bytes of valuable data a user might have stored in their MBR. On initial installation, we are anyway resetting the MBR and partition table, so this is not relevant. On upgrades, we're already working with the assumption that a device created with Tails Installer is dedicated to Tails: that's the only supported, and documented, way to create a device that upgrades will work on. So, it seems reasonable to assume that users did not store anything valuable, after creating their Tails boot device with Tails Installer, in place of the syslinux MBR we've put there. Previously, we did this reset MBR thing *before* installing. We don't anymore, for two reasons: * It's harder to do, as the source file we need has not been extracted to the target drive yet. Granted, we could possibly extract just this file from the ISO filesystem or source device, but it complicates things. * It's actually not necessary: on initial installation, we're clearing the MBR and partition table shortly after by calling clear_all_partition_tables anyway; and, on upgrades, I don't see how touching the MBR at this or that time makes a difference, since we're not modifying the partition table anyway.
1 files changed, 6 insertions, 27 deletions
diff --git a/liveusb/ b/liveusb/
index 180f0b6..d2f89f8 100755
--- a/liveusb/
+++ b/liveusb/
@@ -238,9 +238,8 @@ class LiveUSBThread(QtCore.QThread):
- if self.parent.opts.partition:
- else:
+ if not self.parent.opts.partition:
@@ -359,7 +358,6 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
self.confirmed = False
self.delete_existing_liveos_confirmed = False
- self.mbr_reset_confirmed = False
# Intercept all liveusb INFO log messages, and display them in the gui
self.handler = LiveUSBLogHandler(lambda x: self.textEdit.append(x))
@@ -645,29 +643,10 @@ class LiveUSBDialog(QtGui.QDialog, LiveUSBInterface):
for signal_match in self.signals_connected:
- # Unmount the device and check the MBR
- if
- if self.opts.partition:
- self.mbr_reset_confirmed = True
- if not self.mbr_reset_confirmed:
- self.status(_("The Master Boot Record on your device is blank. "
- "Pressing 'Install Tails' again will reset the "
- "MBR on this device."))
- self.mbr_reset_confirmed = True
- self.enable_widgets(True)
- return
- if['mount']:
- =['mount']
- elif not
- if self.opts.reset_mbr:
- else:
-"Warning: The Master Boot Record on your device "
- "does not match your system's syslinux MBR. If you "
- "have trouble booting this stick, try running the "
- "liveusb-creator with the --reset-mbr option."))
+ # Unmount the device if needed
+ if['mount']:
+ =['mount']
if not self.opts.partition: