[f21-branch][PATCH] Search for a valid stage1 device on disks with stage1 mount points (#1168118)

Vratislav Podzimek vpodzime at redhat.com
Fri Nov 28 10:49:09 UTC 2014


From: Adam Williamson <awilliam at redhat.com>

Otherwise we try the first disk which may not contain a valid stage1 device and
then give up (because the first disk is used to boot from, right?).

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/kickstart.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 72d77f3..d44b349 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -379,9 +379,20 @@ class Bootloader(commands.bootloader.F21_Bootloader):
         if self.timeout is not None:
             storage.bootloader.timeout = self.timeout
 
+        # try to reduce the set of possible 'boot disks' to the disks containing
+        # a valid stage1 mount point, if there are any, because those disks
+        # should be searched for a stage1_valid device
+        disks = storage.disks
+        if platform.bootStage1ConstraintDict["mountpoints"]:
+            disks = [p.disk for p in storage.devices if getattr(p.format, "mountpoint", None) in platform.bootStage1ConstraintDict["mountpoints"]]
+            if not disks:
+                # but if not, just go ahead and use the set of all disks or
+                # else we'll error out later
+                disks = storage.disks
+
         # Throw out drives specified that don't exist or cannot be used (iSCSI
         # device on an s390 machine)
-        disk_names = [d.name for d in storage.disks
+        disk_names = [d.name for d in disks
                       if not d.format.hidden and not d.protected and
                       (not blivet.arch.isS390() or not isinstance(d, blivet.devices.iScsiDiskDevice))]
         diskSet = set(disk_names)
-- 
1.9.3



More information about the anaconda-patches mailing list