[Pkg-privacy-commits] [tails-installer] 04/34: Skip devices too small for cloning, but inform the user (refs: #14622)

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 ebcdeb85485d8ec71038e97b4cb5b4ca38160602
Author: intrigeri <intrigeri at boum.org>
Date:   Sat Jan 20 07:43:43 2018 +0000

    Skip devices too small for cloning, but inform the user (refs: #14622)
    
    Since #12705 was implemented we support (and create) multiple system partition
    sizes. So if the source system partition is larger than the target one, and
    enough automatic upgrades have been installed on the source system partition,
    then it's possible that the files we should clone to the target device don't fit
    in there.
    
    We already have a check for available free space but it's done after we've
    deleted all the known Tails system files on the target system partition, which
    would result in making the target device non-bootable in the problematic cloning
    situation described above. So we need another check that's performed
    before we delete anything.
    
    Note that what this commit implements is what has been called the "superficial"
    check on the ticket: we check the size of the block device and assume that
    there's only Tails system files on the target filesystem, which will be deleted
    before copying the new ones from the source. A more accurate check would require
    either using fatcat (recursively, parsing its output many times) or mounting the
    filesystem. We might do this but it'll be for another iteration.
---
 tails_installer/gui.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/tails_installer/gui.py b/tails_installer/gui.py
index 2919ba9..9e2df6f 100755
--- a/tails_installer/gui.py
+++ b/tails_installer/gui.py
@@ -571,6 +571,27 @@ class TailsInstallerWindow(Gtk.ApplicationWindow):
                                }
                     self.status(message)
                     continue
+                # Skip devices too small for cloning, but inform the user
+                # Note: we add a 5% margin because info['size']
+                # is the block device size, which does not take into account
+                # space used by filesystem structures, reserved space etc.
+                # To be more accurate we would need to mount the candidate
+                # device, which causes UX problems down the road.
+                # XXX: move business logic to creator.py and set
+                # info['is_device_big_enough_for_upgrade'] there
+                if self.opts.clone \
+                   and self.source_available \
+                   and hasattr(self.live, 'source') \
+                   and self.live.source is not None \
+                   and info['size'] < self.live.source.size * 1.05:
+                    message = _('To upgrade device "%(pretty_name)s"'
+                                ' from this Tails, you need to use '
+                                ' a downloaded Tails ISO image:'
+                                ' https://tails.boum.org/install/download') % {
+                                    'pretty_name': pretty_name,
+                                }
+                    self.status(message)
+                    continue
                 target_list.append([pretty_name, device])
             if len(target_list):
                 for target in target_list:

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