[PATCH] Initialize disks with no partitions (#864360)

David Lehman dlehman at redhat.com
Mon Oct 15 15:00:21 UTC 2012


On Fri, 2012-10-12 at 17:00 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
> 
> Treat a disk with a disklabel but no partitions the same as an
> uninitialized disk.
> ---
>  pyanaconda/storage/__init__.py | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
> index 8df216e..4316e1b 100644
> --- a/pyanaconda/storage/__init__.py
> +++ b/pyanaconda/storage/__init__.py
> @@ -694,6 +694,10 @@ class Storage(object):
>          return None
>  
>      def shouldClear(self, device, **kwargs):
> +        def empty_disk():
> +            return bool(device.format.type is None or \
> +                    len(self.devicetree.getChildren(device)) == 0)
> +

You'll probably want to consider mac and sun diskabels, which always
have their magic partition. There's other code around that does this.
Look for isMagic.




More information about the anaconda-patches mailing list