summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <tails@boum.org>2014-12-11 20:06:16 +0100
committerTails developers <tails@boum.org>2014-12-23 17:08:12 +0000
commit50ba51cc40eb1c5bc67875f7f206ac821b60d7aa (patch)
treef4cb12b0f5d44092936c08672a0cdba270868599
parent1ec57b4682d33894ebfe6cf9a94276583a756cc8 (diff)
bugfix/6538-Tails-Installer-tries-to-install-to-too-small-devicesbugfix/6538-Tails-Installer-tries-to-install-to-too-small-devices
-rw-r--r--liveusb/config.py1
-rwxr-xr-xliveusb/creator.py5
2 files changed, 6 insertions, 0 deletions
diff --git a/liveusb/config.py b/liveusb/config.py
index e3e1b40..8854acf 100644
--- a/liveusb/config.py
+++ b/liveusb/config.py
@@ -9,6 +9,7 @@ config_files = [ os.path.join('/', 'etc', 'liveusb-creator', f )
# XXX: move defaults to a proper defaults.ini file?
default_config = {
+ 'min_device_size': 4.0,
'main_liveos_dir': 'live',
'running_liveos_mountpoint': '/lib/live/mount/medium',
'liveos_toplevel_files': [ 'autorun.bat', 'autorun.inf', 'boot', '.disk',
diff --git a/liveusb/creator.py b/liveusb/creator.py
index 20981d6..c9c0c34 100755
--- a/liveusb/creator.py
+++ b/liveusb/creator.py
@@ -674,6 +674,11 @@ class LinuxLiveUSBCreator(LiveUSBCreator):
self.log.debug('Skipping device without size: %s' % device)
continue
+ # Skip devices that are too small
+ if (data['size']/10.0**9) < config['min_device_size']:
+ self.log.warning('Skipping too small device: %s' % device)
+ continue
+
parent = dev.Get(device, 'PartitionSlave')
if parent and parent != '/':
data['parent'] = str(dbus.Interface(self._get_device(parent),