These two patches cherry-picked/ported from master fix the issues with reusing
encrypted devices from a previous installation for a new installation.
Vratislav Podzimek (2):
Make the Encrypt checkbox insensitive for encrypted non-BTRFS devices
Set both .format's and .originalFormat's passphrase on unlock
(#1255679)
pyanaconda/ui/gui/spokes/custom.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
--
2.1.0
New subject: [PATCH 1/2] Make the Encrypt checkbox insensitive for encrypted non-BTRFS devices
If any of the ancestors of the chosen device is encrypted (typically an
encrypted container like LVM on top of LUKS), we don't want to let user play
with the Encrypt checkbox even if the device is not BTRFS.
Related: rhbz#1255679
(port of the commit 05f7de0f4529b0e375419d27b4150d68205e7479 from master)
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/spokes/custom.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 11ab9b0..592247b 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2306,7 +2306,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
def on_reformat_toggled(self, widget):
active = widget.get_active()
- fancy_set_sensitive(self._encryptCheckbox, active)
+ encrypt_sensitive = active
if self._current_selector:
device = self._current_selector.device.raw_device
@@ -2315,14 +2315,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
if any(a.format.type == "luks" and a.format.exists for a in
ancestors):
# The encryption checkbutton should not be sensitive if there is
# existing encryption below the leaf layer.
- fancy_set_sensitive(self._encryptCheckbox, False)
+ encrypt_sensitive = False
# you can't encrypt a btrfs subvolume -- only the volume/container
device_type = self._get_current_device_type()
if device_type == DEVICE_TYPE_BTRFS:
self._encryptCheckbox.set_active(False)
- fancy_set_sensitive(self._encryptCheckbox, device_type != DEVICE_TYPE_BTRFS)
+ fancy_set_sensitive(self._encryptCheckbox, encrypt_sensitive and device_type !=
DEVICE_TYPE_BTRFS)
fancy_set_sensitive(self._fsCombo, active)
def on_fs_type_changed(self, combo):
--
2.1.0
New subject: [PATCH 2/2] Set both .format's and .originalFormat's passphrase on unlock (#1255679)
If the device is reused for the installation, blivet uses the originalFormat
object to setup the device. Thus we need to set the passphrase in both places.
(cherry-picked commit cb851ed7b5e2d6ca83904c4d8ffe44325a9a7230)
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/ui/gui/spokes/custom.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 592247b..fb4e92c 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2585,6 +2585,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
"<a href=\"\">Click for
details.</a>"))
return
+ # set the passphrase also to the originalFormat of the device (a
+ # different object than '.format', but the same contents)
+ device.originalFormat.passphrase = passphrase
log.info("unlocked %s, now going to populate devicetree...",
device.name)
with ui_storage_logger():
luks_dev = LUKSDevice(device.format.mapName,
--
2.1.0