[PATCH 01/11] Fix test for whether to create biosboot during autopart. (#853628)

David Lehman dlehman at redhat.com
Tue Sep 25 20:33:26 UTC 2012


---
 pyanaconda/storage/partitioning.py |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index 936d9ed..000a6c0 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -131,7 +131,7 @@ def _schedulePartitions(storage, disks):
         if request.requiredSpace and request.requiredSpace > free:
             continue
 
-        elif request.fstype in ("prepboot", "efi", "biosboot", "hfs+") and \
+        elif request.fstype in ("prepboot", "efi", "hfs+") and \
              stage1_device:
             # there should never be a need for more than one of these
             # partitions, so skip them.
@@ -144,6 +144,21 @@ def _schedulePartitions(storage, disks):
 
             log.debug(stage1_device)
             continue
+        elif request.fstype == "biosboot":
+            is_gpt = (stage1_device and
+                      getattr(stage1_device.format, "labelType", None) == "gpt")
+            has_bios_boot = (stage1_device and
+                             any([p.format.type == "biosboot"
+                                    for p in storage.partitions
+                                        if p.disk == stage1_device]))
+            if not (stage1_device and stage1_device.isDisk and
+                    is_gpt and not has_bios_boot):
+                # there should never be a need for more than one of these
+                # partitions, so skip them.
+                log.info("skipping unneeded stage1 %s request" % request.fstype)
+                log.debug(request)
+                log.debug(stage1_device)
+                continue
 
         if request.encrypted and storage.encryptedAutoPart:
             fmt_type = "luks"
-- 
1.7.7.6



More information about the anaconda-patches mailing list