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

Vratislav Podzimek vpodzime at redhat.com
Tue Jan 6 07:27:14 UTC 2015


On Mon, 2015-01-05 at 10:09 -0800, Brian C. Lane wrote:
> 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
ACK.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list