[Pkg-privacy-commits] [tails-installer] 06/34: For partitions, store the partition size in the size attribute instead of the size of the parent drive.

anonym anonym-tails-guest at moszumanska.debian.org
Mon Jan 22 14:05:31 UTC 2018


This is an automated email from the git hooks/post-receive script.

anonym-tails-guest pushed a commit to branch tails/master
in repository tails-installer.

commit 473a4638d0a2375751f33afaf841b4bedc9543c2
Author: intrigeri <intrigeri at boum.org>
Date:   Sat Jan 20 10:29:47 2018 +0000

    For partitions, store the partition size in the size attribute instead of the size of the parent drive.
    
    Otherwise, there's no way we can make decisions based on the size of an existing
    Tails system partition we are considering upgrading.
    
    I think this bug was introduced in
    commit dc25779c2f45af885a25f6157def0568176db7a4.
---
 tails_installer/creator.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/tails_installer/creator.py b/tails_installer/creator.py
index 05c2618..7bc8e52 100755
--- a/tails_installer/creator.py
+++ b/tails_installer/creator.py
@@ -618,7 +618,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
                 'parent': None,
                 'parent_udi': None,
                 'parent_size': None,
-                'size': drive.props.size,
+                'size': block.props.size,
                 'mounted_partitions': set(),
                 'is_device_big_enough_for_installation': True,
                 'removable': drive.props.removable,
@@ -660,9 +660,13 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
             # Check for devices that are too small. Note that we still
             # allow devices that can be upgraded for supporting legacy
             # installations.
-            if not self.is_device_big_enough_for_installation(data['size']) and \
-               not self.device_can_be_upgraded(data):
-                self.log.warning('Skipping too small device: %s' % data['device'])
+            if not self.is_device_big_enough_for_installation(
+                    data['parent_size']
+                    if data['parent_size']
+                    else data['size']) \
+               and not self.device_can_be_upgraded(data):
+                self.log.warning(
+                    'Skipping too small device: %s' % data['device'])
                 data['is_device_big_enough_for_installation'] = False
 
             mount = data['mount']
@@ -865,7 +869,7 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
         try:
             partition_table.call_create_partition_sync(
                     arg_offset=0,
-                    arg_size=self.system_partition_size(self.drive['size']),
+                    arg_size=self.system_partition_size(self.drive['parent_size']),
                     arg_type=ESP_GUID,
                     arg_name=self.label,
                     arg_options=GLib.Variant('a{sv}', None),

-- 
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