[PATCH 3/5] Move selection of default boot drive into bootloader.

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

 



Related: rhbz#739408
---
 pyanaconda/bootloader.py        |    7 ++++---
 pyanaconda/iw/cleardisks_gui.py |   10 +++++-----
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index f3c9cf8..e7effc9 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -232,6 +232,7 @@ class BootLoader(object):
                 log.debug("using stage2 device as stage1")
                 self.stage1_device = self.stage2_device
             else:
+                log.debug("stage1_drive is %s" % self.stage1_drive)
                 devices = self.stage1_devices
                 if self.stage1_drive:
                     devices = [d for d in devices if
@@ -274,7 +275,8 @@ class BootLoader(object):
 
     def _sort_drives(self, drives):
         """Sort drives based on the drive order."""
-        _drives = drives[:]
+        _drives = sorted(drives,
+                         cmp=self.storage.compareDisks, key=lambda d: d.name)
         for name in reversed(self._drive_order):
             try:
                 idx = [d.name for d in _drives].index(name)
@@ -298,8 +300,7 @@ class BootLoader(object):
             # only generate the list if it is empty
             return self._drives
 
-        # XXX requiring partitioned may break clearpart
-        drives = [d for d in self.storage.disks if d.partitioned]
+        drives = [d for d in self.storage.disks if not d.format.hidden]
         self._drives = self._sort_drives(drives)
 
         # set "boot drive"
diff --git a/pyanaconda/iw/cleardisks_gui.py b/pyanaconda/iw/cleardisks_gui.py
index 36453a4..9b84474 100644
--- a/pyanaconda/iw/cleardisks_gui.py
+++ b/pyanaconda/iw/cleardisks_gui.py
@@ -148,10 +148,11 @@ class ClearDisksWindow (InstallWindow):
         self.rightDS.addColumn(_("Capacity"), 7)
         self.rightDS.addColumn(_("Identifier"), 9)
 
-        # Store the first disk (according to our detected BIOS order) for
+        # Store the first disk (according to bootloader ordering) for
         # auto boot device selection
-        names = map(lambda d: d.name, disks)
-        self.bootDisk = sorted(names, self.anaconda.storage.compareDisks)[0]
+        self.bootDisk = getattr(self.anaconda.bootloader.stage1_drive,
+                                "name",
+                                self.anaconda.bootloader.drives[0].name)
 
         # The device filtering UI set up exclusiveDisks as a list of the names
         # of all the disks we should use later on.  Now we need to go get those,
@@ -159,8 +160,7 @@ class ClearDisksWindow (InstallWindow):
         # selector.
         for d in disks:
             rightVisible = d.name in self.anaconda.storage.config.clearPartDisks
-            rightActive = rightVisible and \
-                          d == self.anaconda.bootloader.drives[0]
+            rightActive = rightVisible and d.name == self.bootDisk
             leftVisible = not rightVisible
 
             if hasattr(d, "wwid"):
-- 
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