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 03-19-2009, 06:01 PM
Chris Lumens
 
Default Fix writing the default= line in grub.conf (#490756).

This was caused by trying to compare an instance of an object with a string,
which of course is never going to work.
---
bootloader.py | 11 ++++++-----
booty/bootloaderInfo.py | 2 +-
booty/s390.py | 2 +-
booty/x86.py | 2 +-
4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/bootloader.py b/bootloader.py
index f920952..08e874c 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -136,17 +136,18 @@ def writeBootloader(anaconda):

kernelList = []
otherList = []
- rootDev = getattr(anaconda.id.storage.fsset.rootDevice, "name", None)
- defaultDev = anaconda.id.bootloader.images.getDefault()
+ # getDefault needs to return a device, but that's too invasive for now.
+ rootDev = anaconda.id.storage.fsset.rootDevice
+ defaultDev = anaconda.id.storage.devicetree.getDeviceByName(ana conda.id.bootloader.images.getDefault())

kernelLabel = None
kernelLongLabel = None

for (dev, (label, longlabel, type)) in anaconda.id.bootloader.images.getImages().items():
- if (dev == rootDev) or (rootDev is None and kernelLabel is None):
+ if (rootDev is None and kernelLabel is None) or (dev == rootDev.name):
kernelLabel = label
kernelLongLabel = longlabel
- elif dev == defaultDev:
+ elif dev == defaultDev.name:
otherList = [(label, longlabel, dev)] + otherList
else:
otherList.append((label, longlabel, dev))
@@ -175,7 +176,7 @@ def writeBootloader(anaconda):
f.write("# UPDATEDEFAULT specifies if new-kernel-pkg should make
"
"# new kernels the default
")
# only update the default if we're setting the default to linux (#156678)
- if rootDev == defaultDev:
+ if rootDev.name == defaultDev.name:
f.write("UPDATEDEFAULT=yes
")
else:
f.write("UPDATEDEFAULT=no
")
diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index 90073e2..8419645 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -333,7 +333,7 @@ class bootloaderInfo:

rootDev = self.storage.fsset.rootDevice

- if rootDev == defaultDev:
+ if rootDev.name == defaultDev.name:
lilo.addEntry("default", kernelList[0][0])
else:
lilo.addEntry("default", chainList[0][0])
diff --git a/booty/s390.py b/booty/s390.py
index 655d028..8cddb05 100644
--- a/booty/s390.py
+++ b/booty/s390.py
@@ -27,7 +27,7 @@ class s390BootloaderInfo(bootloaderInfo):

rootDev = self.storage.fsset.rootDevice

- if rootDev == defaultDev:
+ if rootDev.name == defaultDev.name:
lilo.addEntry("default", kernelList[0][0])
else:
lilo.addEntry("default", chainList[0][0])
diff --git a/booty/x86.py b/booty/x86.py
index 05c9feb..221186a 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -184,7 +184,7 @@ class x86BootloaderInfo(efiBootloaderInfo):

# get the default image to boot... we have to walk and find it
# since grub indexes by where it is in the config file
- if defaultDev == rootDev:
+ if defaultDev.name == rootDev.name:
default = 0
else:
# if the default isn't linux, it's the first thing in the
--
1.6.1.3

_______________________________________________
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 09:41 PM.

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