FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 06-11-2010, 09:58 AM
Ales Kozumplik
 
Default fix: do not check root devices from hasWindows (#592860).

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
--
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 06-11-2010, 10:13 AM
Hans de Goede
 
Default fix: do not check root devices from hasWindows (#592860).

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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 05:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org