[PATCH] Bootloader checking should work in terms of self.stage1/2_ attrs (#880319).

Chris Lumens clumens at redhat.com
Tue Nov 27 21:18:10 UTC 2012


---
 pyanaconda/bootloader.py | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index f2c302c..fd68571 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1568,27 +1568,27 @@ class GRUB2(GRUB):
         self.errors = []
         self.warnings = []
 
-        for (stage1dev, stage2dev) in self.install_targets:
-            if stage1dev == stage2dev:
-                continue
+        if self.stage1_device == self.stage2_device:
+            return ret
 
-            # These are small enough to fit
-            if stage2dev.format.type in ("ext2", "ext3", "ext4") \
-               and stage2dev.type == "partition":
-                continue
+        # These are small enough to fit
+        if self.stage2_device.format.type in ("ext2", "ext3", "ext4") \
+           and self.stage2_device.type == "partition":
+            return ret
+
+        # If the first partition starts too low show an error.
+        parts = self.stage1_disk.format.partedDisk.partitions
+        for p in parts:
+            start = p.geometry.start * p.disk.device.sectorSize
+            if not p.getFlag(PARTITION_BIOS_GRUB) and start < 1024*512:
+                msg = _("%s may not have enough space for grub2 to embed "
+                        "core.img when using the %s filesystem on %s") \
+                        % (self.stage1_device.name, self.stage2_device.format.type, self.stage2_device.type)
+                log.error(msg)
+                self.errors.append(msg)
+                ret = False
+                break
 
-            # If the first partition starts too low show an error.
-            parts = stage1dev.format.partedDisk.partitions
-            for p in parts:
-                start = p.geometry.start * p.disk.device.sectorSize
-                if not p.getFlag(PARTITION_BIOS_GRUB) and start < 1024*512:
-                    msg = _("%s may not have enough space for grub2 to embed "
-                            "core.img when using the %s filesystem on %s") \
-                            % (stage1dev.name, stage2dev.format.type, stage2dev.type)
-                    log.error(msg)
-                    self.errors.append(msg)
-                    ret = False
-                    break
         return ret
 
 class EFIGRUB(GRUB2):
-- 
1.7.11.2



More information about the anaconda-patches mailing list