[PATCH] only allow GPT boot flag on EFI System partition (#746895)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Brian C. Lane" <bcl@xxxxxxxxxx>

When parted sets the boot flag on a GPT labeled disk's partition it
sets the EFI System GUID type. This results in BIOS systems' boot
partition having the wrong GUID type, and EFI systems having multiple
EFI System partitions.
---
 pyanaconda/storage/__init__.py |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 5317c1b..edda836 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -398,9 +398,16 @@ class Storage(object):
                                p.getFlag(parted.PARTITION_BOOT):
                                 skip = True
                                 break
+
+                    # GPT labeled disks should only have bootable set on the
+                    # EFI system partition (parted sets the EFI System GUID on
+                    # GPT partitions with the boot flag)
+                    if dev.disk.format.partedDisk.type == "gpt" and \
+                       dev.disk.format.type != "efi":
+                           skip = True
+
                     if skip:
-                         log.info("not setting boot flag on %s as there is"
-                                  "another active partition" % dev.name)
+                         log.info("not setting boot flag on %s" % dev.name)
                          continue
                     # hfs+ partitions on gpt can't be marked bootable via
                     # parted
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux