[anaconda:rhel6] Make sure EFI.bootDevice() satisfies EFI.checkBootRequest() (#1145812)

mulhern amulhern at redhat.com
Mon Nov 3 21:00:56 UTC 2014


Resolves: rhbz#1145812

EFI.checkBootRequest() requires that the partition format has a mountpoint
if isEfi is True.

In the same vein, make sure that EFI.bootDevice() returns a partition with
a mountpoint if isEfi is True.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 platform.py | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/platform.py b/platform.py
index 51e2e3f..a169e28 100644
--- a/platform.py
+++ b/platform.py
@@ -250,12 +250,19 @@ class EFI(Platform):
         available from multiple devices.
         """
         drive = self.anaconda.id.bootloader.drivelist[0]
-        for part in self.anaconda.id.storage.partitions:
-           if part.disk and part.disk.name == drive \
-               and part.format.type == "efi" \
-               and self.validBootPartSize(part.size):
-                return part
-        return None
+
+        def _isBoot(part):
+            return part.disk and \
+               part.disk.name == drive and \
+               part.format.type == "efi" and \
+               self.validBootPartSize(part.size)
+
+        if self.isEfi:
+            isBootDevice = lambda part: _isBoot(part) and part.format.mountpoint
+        else:
+            isBootDevice = _isBoot
+
+        return next((p for p in self.anaconda.id.storage.partitions if isBootDevice(p)), None)
 
     def bootloaderChoices(self, bl):
         bootDev = self.bootDevice()
-- 
1.9.3



More information about the anaconda-patches mailing list