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

[PATCH 3/3] Require BIOS boot partition for GPT bootdisk on BIOS systems.

Changes the warning to an error and also fixes two other bugs.

First, it fixes an unbound recursion issue introduced by
commit e8ae9031f203b15. The check for stage2 device being the
stage1 device doesn't make sense in _gpt_disk_has_bios_boot.
If the stage1 device is not a disk that method will not
require a bios boot partition anyway.

Second, the bios boot check was being run regardless of
whether the platform requires it. Checking the weight is the
only method I know of to determine this.

It also simplifies the error message so fewer people get
confused by all the acronyms.
 pyanaconda/bootloader.py |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index e8c9ff1..9a3e6ff 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1474,9 +1474,8 @@ class GRUB2(GRUB):
         if device is None:
             return ret
-        if self.stage1_device == self.stage2_device:
-            # if we're booting from the stage2 device there's probably no
-            # need for a BIOS boot partition
+        if not self.platform.weight(fstype="biosboot"):
+            # this platform does not need bios boot
             return ret
         # check that a bios boot partition is present if the stage1 device
@@ -1491,10 +1490,8 @@ class GRUB2(GRUB):
             if not ret:
-                self.warnings.append(_("You are using a GPT bootdisk on a BIOS "
-                                   "system without a BIOS boot partition. This "
-                                   "may not work, depending on your BIOS's "
-                                   "support for booting from GPT disks."))
+                self.errors.append(_("You are using a GPT bootdisk on a BIOS "
+                                     "system without a BIOS boot partition."))
         log.debug("_gpt_disk_has_bios_boot(%s) returning %s" % (device.name,
@@ -1502,8 +1499,7 @@ class GRUB2(GRUB):
     def is_valid_stage1_device(self, device):
         ret = super(GRUB2, self).is_valid_stage1_device(device)
-        if ret:
-            ignored = self._gpt_disk_has_bios_boot(device)
+        ret = ret and self._gpt_disk_has_bios_boot(device)
         log.debug("is_valid_stage1_device(%s) returning %s" % (device.name,

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