From: "Brian C. Lane" bcl@redhat.com
--- blivet/devicefactory.py | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py index 090157a..b643736 100644 --- a/blivet/devicefactory.py +++ b/blivet/devicefactory.py @@ -24,6 +24,7 @@ from storage_log import log_method_call from errors import * from devices import LUKSDevice from formats import getFormat +from devicelibs import crypto from devicelibs.mdraid import get_member_space from devicelibs.mdraid import get_raid_min_members from devicelibs.mdraid import raidLevelString @@ -1170,6 +1171,10 @@ class LVMFactory(DeviceFactory): # (it was originally one per disk but that wasn't enough for raid5) size += LVM_PE_SIZE * len(self.disks) * 5
+ if self.container_encrypted: + # Add space for LUKS metadata, each parent will be encrypted + size += LVM_PE_SIZE * len(self.disks) + return size
#
From: "Brian C. Lane" bcl@redhat.com
This resulted in it creating more luks containers on top of the lvm. Also disable the device's encrypt checkbox when a container is already encrypted, preventing the user from manually ending up with more luks containers.
Related: rhbz#1038969 --- pyanaconda/ui/gui/spokes/custom.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index ac6cab6..d392b32 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1738,7 +1738,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._encryptCheckbox.set_sensitive(self._reformatCheckbox.get_active()) ancestors = use_dev.ancestors ancestors.remove(use_dev) - if any(a.format.type == "luks" and a.format.exists for a in ancestors): + if any(a.format.type == "luks" for a in ancestors): # The encryption checkbutton should not be sensitive if there is # existing encryption below the leaf layer. self._encryptCheckbox.set_sensitive(False) @@ -2036,6 +2036,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): "container_size": getattr(container, "size_policy", container.size)}
+ # The container is already encrypted + if container.encrypted and encrypted: + encrypted = False + try: self.__storage.factoryDevice(device_type, size=size,
On Tue, 2013-12-10 at 14:07 -0800, Brian C. Lane wrote:
From: "Brian C. Lane" bcl@redhat.com
This resulted in it creating more luks containers on top of the lvm. Also disable the device's encrypt checkbox when a container is already encrypted, preventing the user from manually ending up with more luks containers.
Related: rhbz#1038969
pyanaconda/ui/gui/spokes/custom.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index ac6cab6..d392b32 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1738,7 +1738,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._encryptCheckbox.set_sensitive(self._reformatCheckbox.get_active()) ancestors = use_dev.ancestors ancestors.remove(use_dev)
if any(a.format.type == "luks" and a.format.exists for a in ancestors):
if any(a.format.type == "luks" for a in ancestors): # The encryption checkbutton should not be sensitive if there is # existing encryption below the leaf layer. self._encryptCheckbox.set_sensitive(False)
@@ -2036,6 +2036,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): "container_size": getattr(container, "size_policy", container.size)}
# The container is already encrypted
if container.encrypted and encrypted:
encrypted = False
I believe you can drop 'and encrypted' from the condition. Otherwise ACK.
On Tue, 2013-12-10 at 14:07 -0800, Brian C. Lane wrote:
From: "Brian C. Lane" bcl@redhat.com
blivet/devicefactory.py | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py index 090157a..b643736 100644 --- a/blivet/devicefactory.py +++ b/blivet/devicefactory.py @@ -24,6 +24,7 @@ from storage_log import log_method_call from errors import * from devices import LUKSDevice from formats import getFormat +from devicelibs import crypto
You don't need this import unless you wanted to use LUKS_METADATA_SIZE instead of LVM_PE_SIZE. Both should work I guess, so ACK.
On Wed, Dec 11, 2013 at 08:33:06AM +0100, Vratislav Podzimek wrote:
On Tue, 2013-12-10 at 14:07 -0800, Brian C. Lane wrote:
From: "Brian C. Lane" bcl@redhat.com
blivet/devicefactory.py | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py index 090157a..b643736 100644 --- a/blivet/devicefactory.py +++ b/blivet/devicefactory.py @@ -24,6 +24,7 @@ from storage_log import log_method_call from errors import * from devices import LUKSDevice from formats import getFormat +from devicelibs import crypto
You don't need this import unless you wanted to use LUKS_METADATA_SIZE instead of LVM_PE_SIZE. Both should work I guess, so ACK.
Oops, right, that was leftover from a previous attempt. Also, other comment is true. Doesn't really matter if encrypted is set if you're going to set it to False anyway.
anaconda-patches@lists.fedorahosted.org