[rhel7-cherry-pick] Allow adding prepboot to a blank disk in custom (#1176829)

Brian C. Lane bcl at redhat.com
Mon Jan 5 18:09:12 UTC 2015


On systems where the stage1 device can only be a partition (PPC for
example) the self.data.bootloader.bootDrive isn't setup until you add a
prepboot partition. If you start with a totally blank disk and added a
prepboot partition first the accordion wouldn't be populated, resulting
in a traceback.

This changes custom to allow biosboot and prepboot to be added when
self.data.bootloader.bootDrive hasn't been setup yet.

This would also happen on UEFI when adding biosboot or prepboot as the
first partition to a blank disk.

(cherry picked from commit 007ed7454afb2beeba0670ab7f5009cb4ff6d8a5)

Resolves: rhbz#1176829
---
 pyanaconda/ui/gui/spokes/custom.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 35507f2..77ca0f2 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -951,8 +951,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
             if device.format.type not in format_types:
                 continue
 
-            disk_names = [d.name for d in device.disks]
-            if self.data.bootloader.bootDrive in disk_names:
+            disk_names = (d.name for d in device.disks)
+            # bootDrive may not be setup because it IS one of these.
+            if not self.data.bootloader.bootDrive or \
+               self.data.bootloader.bootDrive in disk_names:
                 devices.append(device)
 
         return devices
-- 
1.9.3



More information about the anaconda-patches mailing list