[Pkg-privacy-commits] [tails-installer] 01/04: Import bugfix/14809-partition-type-and-flags-with-recent-udisks at commit d9b284a as quilt patches (refs: #14809).

Ulrike Uhlig ulrike at moszumanska.debian.org
Mon Nov 20 14:56:17 UTC 2017


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

ulrike pushed a commit to annotated tag tails/5.0.1+dfsg-0tails1+bugfix.14809+feature.9005_1.gbpb0c2be
in repository tails-installer.

commit 64627f32dd88f02e38248858e9b0f2cdcaea58bc
Author: intrigeri <intrigeri at boum.org>
Date:   Sun Oct 8 08:07:23 2017 +0000

    Import bugfix/14809-partition-type-and-flags-with-recent-udisks at commit d9b284a as quilt patches (refs: #14809).
---
 ...de-that-breaks-UEFI-boot-on-sticks-instal.patch | 63 ++++++++++++++++++++++
 ...n-type-again-after-settings-its-flags-ref.patch | 44 +++++++++++++++
 debian/patches/series                              |  2 +
 3 files changed, 109 insertions(+)

diff --git a/debian/patches/Drop-obsolete-code-that-breaks-UEFI-boot-on-sticks-instal.patch b/debian/patches/Drop-obsolete-code-that-breaks-UEFI-boot-on-sticks-instal.patch
new file mode 100644
index 0000000..0bbe3c0
--- /dev/null
+++ b/debian/patches/Drop-obsolete-code-that-breaks-UEFI-boot-on-sticks-instal.patch
@@ -0,0 +1,63 @@
+From: intrigeri <intrigeri at boum.org>
+Date: Sat, 7 Oct 2017 15:21:46 +0000
+Subject: Drop obsolete code that breaks UEFI boot on sticks installed with
+ recent Debian testing/sid (refs: #14809).
+
+By now all existing Tails system partitions should have been converted
+to ESP.
+
+This avoids calling _set_partition_flags, which resets the type of the partition
+with udisks2 2.7.3-4.
+---
+ tails_installer/creator.py | 17 -----------------
+ tails_installer/gui.py     |  2 --
+ 2 files changed, 19 deletions(-)
+
+diff --git a/tails_installer/creator.py b/tails_installer/creator.py
+index 60a8ce8..0188e2c 100755
+--- a/tails_installer/creator.py
++++ b/tails_installer/creator.py
+@@ -226,12 +226,6 @@ class TailsInstallerCreator(object):
+         """ Partition device listed at self.drive """
+         raise NotImplementedError
+ 
+-    def update_system_partition_properties(self):
+-        cmd = (  [ '/sbin/sgdisk' ]
+-               + [ '--typecode=1:%s' % ESP_GUID ]
+-               + [ self.drive['parent'] ])
+-        self.popen(cmd, shell=False)
+-
+     def system_partition_size(self, device_size_in_bytes):
+         """ Return the optimal system partition size (in bytes) for
+         a device_size_in_bytes bytes large destination device: 4 GiB on devices
+@@ -916,17 +910,6 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
+         # _set_drive, that fails with "Cannot find device /dev/sda1".
+         self.rescan_block_device(self._get_object().props.block)
+ 
+-    def update_system_partition_properties(self):
+-        self.log.info(_('Updating properties of system partition %(system_partition)s') % {
+-            'system_partition': self.drive['device']
+-        })
+-
+-        system_partition = self._get_object().props.partition
+-        system_partition.call_set_type_sync(ESP_GUID, GLib.Variant('a{sv}', None))
+-        system_partition.call_set_name_sync(self.label, GLib.Variant('a{sv}', None))
+-
+-        self._set_partition_flags(system_partition, SYSTEM_PARTITION_FLAGS)
+-
+     def is_partition_GPT(self, drive=None):
+         # Check if the partition scheme is GPT
+         if drive:
+diff --git a/tails_installer/gui.py b/tails_installer/gui.py
+index df918c3..0f199fc 100755
+--- a/tails_installer/gui.py
++++ b/tails_installer/gui.py
+@@ -232,8 +232,6 @@ class TailsInstallerThread(threading.Thread):
+             self.live.create_persistent_overlay()
+             self.live.update_configs()
+ 
+-            if not self.parent.opts.partition and self.live.is_partition_GPT():
+-                self.live.update_system_partition_properties()
+             self.live.install_bootloader()
+             # self.live.bootable_partition()
+ 
diff --git a/debian/patches/Set-the-partition-type-again-after-settings-its-flags-ref.patch b/debian/patches/Set-the-partition-type-again-after-settings-its-flags-ref.patch
new file mode 100644
index 0000000..56ff714
--- /dev/null
+++ b/debian/patches/Set-the-partition-type-again-after-settings-its-flags-ref.patch
@@ -0,0 +1,44 @@
+From: intrigeri <intrigeri at boum.org>
+Date: Sun, 8 Oct 2017 07:48:16 +0000
+Subject: Set the partition type again after settings its flags (refs: #14809).
+
+This workarounds the fact that calling _set_partition_flags resets the type of
+the partition with udisks2 2.7.3-4, which breaks UEFI boot.
+---
+ tails_installer/creator.py | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/tails_installer/creator.py b/tails_installer/creator.py
+index 0188e2c..2e8b859 100755
+--- a/tails_installer/creator.py
++++ b/tails_installer/creator.py
+@@ -886,13 +886,6 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
+         self.rescan_block_device(self._get_object().props.block)
+         system_partition = self.first_partition(self.drive['udi'])
+ 
+-        # Sets the partition type that is not set by call_create_partition_sync...
+-        # because it is not implemented in UDisks as of version 2.1.5 (see
+-        # http://cgit.freedesktop.org/udisks/tree/src/udiskslinuxpartitiontable.c?id=a66691c3#n630)
+-        #
+-        # XXX: sometimes fails (https://labs.riseup.net/code/issues/10987)
+-        system_partition.call_set_type_sync(ESP_GUID, GLib.Variant('a{sv}', None))
+-
+         # Get a fresh system_partition object, otherwise
+         # _set_partition_flags sometimes fails with
+         # "GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No
+@@ -901,9 +894,15 @@ class LinuxTailsInstallerCreator(TailsInstallerCreator):
+         self.rescan_block_device(self._get_object().props.block)
+         system_partition = self.first_partition(self.drive['udi'])
+ 
++        # XXX: This resets the partition type for some reason.
+         # XXX: sometimes fails (https://labs.riseup.net/code/issues/10987)
+         self._set_partition_flags(system_partition, SYSTEM_PARTITION_FLAGS)
+ 
++        # _set_partition_flags resets the partition type with udisks2 2.7.3-4,
++        # so let's set the right one again
++        # XXX: sometimes fails (https://labs.riseup.net/code/issues/10987)
++        system_partition.call_set_type_sync(ESP_GUID, GLib.Variant('a{sv}', None))
++
+         # Give the system some more time to recognize the updated
+         # partition, otherwise sometimes later on, when
+         # switch_drive_to_system_partition is called, it calls
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8ab109a
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+Drop-obsolete-code-that-breaks-UEFI-boot-on-sticks-instal.patch
+Set-the-partition-type-again-after-settings-its-flags-ref.patch

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