Re: [master] fix: do not check root devices from hasWindows (#592860).

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

 



Ack.

On 06/11/2010 11:58 AM, Ales Kozumplik wrote:
otherwise it tracebacks because hasWindows can be called early, before
partitioning. also we don't care about the root device for the
hasWindows()'s purpose.
---
  booty/bootloaderInfo.py  |   15 ++++++++-------
  pyanaconda/bootloader.py |    3 ++-
  2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index a0a7b4d..f0b5983 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -256,7 +256,8 @@ class BootImages:
      # Return a list of (storage.Device, string) tuples that are bootable
      # devices.  The string is the type of the device, which is just a string
      # like "vfat" or "swap" or "lvm".
-    def availableBootDevices(self, storage):
+    # Appends information about the root device when addRoot is true.
+    def availableBootDevices(self, storage, addRoot=True):
          import parted
          retval = []
          foundDos = False
@@ -283,13 +284,13 @@ class BootImages:
                  # questionable for same reason as above, but on mac this time
                  retval.append((part, type))

-        rootDevice = storage.rootDevice
+        if addRoot:
+            rootDevice = storage.rootDevice
+            if not rootDevice or not rootDevice.format:
+                raise ValueError, ("Trying to pick boot devices but do not have a "
+                                   "sane root partition.  Aborting install.")
+            retval.append((rootDevice, rootDevice.format.type))

-        if not rootDevice or not rootDevice.format:
-            raise ValueError, ("Trying to pick boot devices but do not have a "
-                               "sane root partition.  Aborting install.")
-
-        retval.append((rootDevice, rootDevice.format.type))
          retval.sort()
          return retval

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 37490ea..3748d7f 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -236,7 +236,8 @@ def hasWindows(bl):
          return False

      foundWindows = False
-    for (dev, type) in bl.images.availableBootDevices(bl.storage):
+    # no point looking at the root device which won't be a dos type anyway
+    for (dev, type) in bl.images.availableBootDevices(bl.storage, addRoot=False):
          if type in booty.dosFilesystems:
              foundWindows = True
              break

_______________________________________________
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