[PATCH 02/11] Include a BIOS boot partition in X86 autopart on GPT.

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

 



---
 pyanaconda/iw/lvm_dialog_gui.py    |    4 ++--
 pyanaconda/iw/raid_dialog_gui.py   |    2 +-
 pyanaconda/platform.py             |   17 +++++++++++++++++
 pyanaconda/storage/devices.py      |    4 ++++
 pyanaconda/storage/partitioning.py |   17 ++++++++++++++++-
 5 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/iw/lvm_dialog_gui.py b/pyanaconda/iw/lvm_dialog_gui.py
index 9a96d89..1391524 100644
--- a/pyanaconda/iw/lvm_dialog_gui.py
+++ b/pyanaconda/iw/lvm_dialog_gui.py
@@ -446,7 +446,7 @@ class VolumeGroupEditor:
             # File system type lables & combo
             newfstypelabel = createAlignedLabel(_("_File System Type:"))
             newfstypeCombo = createFSTypeMenu(format, fstypechangeCB,mountCombo,
-                    ignorefs = ["mdmember", "lvmpv", "efi", "prepboot", "appleboot"])
+                    ignorefs = ["mdmember", "lvmpv", "efi", "prepboot", "appleboot", "biosboot"])
             newfstypelabel.set_mnemonic_widget(newfstypeCombo)
 
             # Logical Volume name label & entry
@@ -503,7 +503,7 @@ class VolumeGroupEditor:
             # it latter with two arguments, row and mainttable.
             cpefsos = lambda table, row: createPreExistFSOptionSection(templv,
                     maintable, row, mountCombo, self.storage,
-                    ignorefs = ["software RAID", "physical volume (LVM)", "vfat"],
+                    ignorefs = ["software RAID", "physical volume (LVM)", "vfat", "biosboot"],
                     luksdev=templuks)
 
 
diff --git a/pyanaconda/iw/raid_dialog_gui.py b/pyanaconda/iw/raid_dialog_gui.py
index 35f23f9..429b05f 100644
--- a/pyanaconda/iw/raid_dialog_gui.py
+++ b/pyanaconda/iw/raid_dialog_gui.py
@@ -463,7 +463,7 @@ class RaidEditor:
             self.fstypeCombo = createFSTypeMenu(format,
                                                 fstypechangeCB,
                                                 self.mountCombo,
-                                                ignorefs = ["mdmember", "efi", "prepboot", "appleboot"])
+                                                ignorefs = ["mdmember", "efi", "prepboot", "appleboot", "biosboot"])
 	    lbl.set_mnemonic_widget(self.fstypeCombo)
             maintable.attach(self.fstypeCombo, 1, 2, row, row + 1)
             row += 1
diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index 6a57b34..c839735 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -187,6 +187,23 @@ class Platform(object):
 class X86(Platform):
     _bootloaderClass = bootloader.GRUB2
 
+    def setDefaultPartitioning(self):
+        """Return the default platform-specific partitioning information."""
+        from storage.partspec import PartSpec
+        ret = Platform.setDefaultPartitioning(self)
+        ret.append(PartSpec(fstype="biosboot", size=1,
+                            weight=self.weight(fstype="biosboot")))
+        return ret
+
+    def weight(self, fstype=None, mountpoint=None):
+        score = Platform.weight(self, fstype=fstype, mountpoint=mountpoint)
+        if score:
+            return score
+        elif fstype == "biosboot":
+            return 5000
+        else:
+            return 0
+
 class EFI(Platform):
     _bootloaderClass = bootloader.EFIGRUB
 
diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index e39c11f..581b849 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -1145,6 +1145,10 @@ class PartitionDevice(StorageDevice):
                 # the only way to identify a PPC PReP Boot partition is to
                 # check the partition type/flags, so do it here.
                 self.format = getFormat("prepboot", device=self.path, exists=True)
+            elif self.getFlag(parted.PARTITION_BIOS_GRUB):
+                # the only way to identify a BIOS Boot partition is to
+                # check the partition type/flags, so do it here.
+                self.format = getFormat("biosboot", device=self.path, exists=True)
         else:
             # XXX It might be worthwhile to create a shit-simple
             #     PartitionRequest class and pass one to this constructor
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index bddca32..a5279d8 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -94,10 +94,25 @@ def _schedulePartitions(storage, disks):
         if request.fstype is None:
             request.fstype = storage.defaultFSType
         elif request.fstype in ("prepboot", "efi") and \
-                storage.platform.bootDevice:
+                storage.platform.bootLoaderDevice:
             # there should never be a need for more than one of these
             # partitions, so skip them.
+            log.info("skipping unneeded stage1 request")
             continue
+        elif request.fstype == "biosboot":
+            boot_disk = storage.platform.bootloader.stage1_drive
+            if boot_disk and boot_disk.format.labelType != "gpt":
+                # biosboot is only needed for gpt disklabels on non-efi x86
+                log.info("skipping bios boot request for msdos disklabel")
+                continue
+
+            gpt_check = getattr(storage.platform.bootloader,
+                                "_gpt_disk_has_bios_boot",
+                                None)
+            if gpt_check and gpt_check(boot_disk):
+                # there's already a bios boot partition on the gpt boot disk
+                log.info("skipping bios boot request since boot disk has one")
+                continue
 
         # This is a little unfortunate but let the backend dictate the rootfstype
         # so that things like live installs can do the right thing
-- 
1.7.3.4

_______________________________________________
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