pyanaconda/storage/deviceaction.py | 2 +- pyanaconda/storage/devices.py | 3 ++- pyanaconda/ui/gui/spokes/custom.py | 8 +++----- pyanaconda/ui/gui/spokes/lib/cart.py | 2 +- pyanaconda/ui/gui/spokes/storage.py | 2 -- 5 files changed, 7 insertions(+), 10 deletions(-)
In case anyone's wondering about the deep copy thing, we do a deep copy of the main storage instance to play with in the custom spoke and those copies of the devices end up replacing the original ones in the main storage instance.
--- pyanaconda/storage/deviceaction.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pyanaconda/storage/deviceaction.py b/pyanaconda/storage/deviceaction.py index 617d8b2..f13740c 100644 --- a/pyanaconda/storage/deviceaction.py +++ b/pyanaconda/storage/deviceaction.py @@ -523,7 +523,7 @@ class ActionDestroyFormat(DeviceAction): obsolete a format destroy action on an existing one """ return (self.device.id == action.device.id and - self.obj == self.obj and + self.obj == action.obj and (self.id > action.id or (self.id == action.id and not self.format.exists)) and not (action.format.exists and not self.format.exists))
There is some argument that grub2 does not do well with non-partition /boot (https://bugzilla.redhat.com/show_bug.cgi?id=737508#c75).
Also, this change brings the defaults in line with our own automatic partitioning. --- pyanaconda/ui/gui/spokes/custom.py | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index c87d039..542dc19 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1766,11 +1766,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): AUTOPART_TYPE_PLAIN: DEVICE_TYPE_PARTITION, AUTOPART_TYPE_BTRFS: DEVICE_TYPE_BTRFS} device_type = device_type_from_autopart[self.data.autopart.type] - if device_type != DEVICE_TYPE_PARTITION and \ - mountpoint == "/boot/efi": - device_type = DEVICE_TYPE_PARTITION - elif device_type != DEVICE_TYPE_PARTITION and \ - fstype in partition_only_format_types: + if (device_type != DEVICE_TYPE_PARTITION and + (mountpoint.startswith("/boot") or + fstype in partition_only_format_types)): device_type = DEVICE_TYPE_PARTITION
# some devices should never be encrypted
A StorageDevice containing a DiskLabel will have both an originalFormat and a format attribute, both of which are DiskLabel instances. They are copied using a shallow copy, so they share _partedDisk and _origPartedDisk attributes. That means you only have to do partition removals from the parted Disk once.
When you make a deep copy of such a StorageDevice, things change. The originalFormat and format no longer share a single _partedDisk or _origPartedDisk. In this case, it is sometimes necessary to remove a partition from both self.disk.format and self.disk.originalFormat. --- pyanaconda/storage/devices.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py index 06baab2..90956f4 100644 --- a/pyanaconda/storage/devices.py +++ b/pyanaconda/storage/devices.py @@ -1540,7 +1540,8 @@ class PartitionDevice(StorageDevice): self.partedPartition = self.disk.originalFormat.partedDisk.getPartitionByPath(self.path) raise
- if self.disk.format.exists: + if self.disk.format.exists and \ + self.disk.format.partedDisk != self.disk.originalFormat.partedDisk: # If the new/current disklabel is the same as the original one, we # have to duplicate the removal on the other copy of the DiskLabel. part = self.disk.format.partedDisk.getPartitionByPath(self.path)
--- pyanaconda/ui/gui/spokes/lib/cart.py | 2 +- pyanaconda/ui/gui/spokes/storage.py | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.py b/pyanaconda/ui/gui/spokes/lib/cart.py index 590acb1..996c577 100644 --- a/pyanaconda/ui/gui/spokes/lib/cart.py +++ b/pyanaconda/ui/gui/spokes/lib/cart.py @@ -179,7 +179,7 @@ class SelectedDisksDialog(GUIObject):
# No device was selected. The user does not want to install # a bootloader. - self.data.bootloader.bootDrive = None + self.data.bootloader.bootDrive = "" self.data.bootloader.location = "none"
def _toggle_button_text(self, row): diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index e5bb10b..0d73867 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -370,8 +370,6 @@ class StorageSpoke(NormalSpoke, StorageChecker): self.storage.bootloader.stage1_disk = None self.storage.bootloader.stage1_device = None
- self.data.bootloader.location = "mbr" - self.data.clearpart.initAll = True self.data.clearpart.type = self.clearPartType self.storage.config.update(self.data)
On Fri, Dec 07, 2012 at 04:45:08PM -0600, David Lehman wrote:
pyanaconda/storage/deviceaction.py | 2 +- pyanaconda/storage/devices.py | 3 ++- pyanaconda/ui/gui/spokes/custom.py | 8 +++----- pyanaconda/ui/gui/spokes/lib/cart.py | 2 +- pyanaconda/ui/gui/spokes/storage.py | 2 -- 5 files changed, 7 insertions(+), 10 deletions(-)
In case anyone's wondering about the deep copy thing, we do a deep copy of the main storage instance to play with in the custom spoke and those copies of the devices end up replacing the original ones in the main storage instance.
Ack.
I'll git am these for a build tonight.
anaconda-patches@lists.fedorahosted.org