summaryrefslogtreecommitdiffstats
path: root/booty
diff options
context:
space:
mode:
authorRadek Vykydal <rvykydal@redhat.com>2009-10-16 14:41:29 +0200
committerRadek Vykydal <rvykydal@redhat.com>2009-10-29 14:26:00 +0100
commit558abca4d3f6740eadba96ead716839440112759 (patch)
tree7001c9ac85550739e2a9807d99f7bb073718687f /booty
parentdcea0bf06200230fabd7830ef46f67e193ccb544 (diff)
downloadanaconda-558abca4d3f6740eadba96ead716839440112759.tar.gz
anaconda-558abca4d3f6740eadba96ead716839440112759.tar.xz
anaconda-558abca4d3f6740eadba96ead716839440112759.zip
Remove another code duplication in grub upgrade code.
This is one of follow-up commits for commit 358a9a34f496fdd2b032edf12274a146b606d1a4, dealing with upgrade.
Diffstat (limited to 'booty')
-rw-r--r--booty/x86.py25
1 files changed, 4 insertions, 21 deletions
diff --git a/booty/x86.py b/booty/x86.py
index ce446d29d..9106bb09f 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -495,30 +495,13 @@ class x86BootloaderInfo(efiBootloaderInfo):
if justConfigFile:
return ""
- theDev = None
- for (fn, stanza) in [ ("/etc/sysconfig/grub", "boot="),
- ("/boot/grub/grub.conf", "#boot=") ]:
- try:
- f = open(instRoot + fn, "r")
- except:
- continue
-
- # the following bits of code are straight from checkbootloader.py
- lines = f.readlines()
- f.close()
- for line in lines:
- if line.startswith(stanza):
- theDev = checkbootloader.getBootDevString(line)
- break
- if theDev is not None:
- break
+ grubTarget = bl.getDevice()
- if theDev is None:
- # we could find the dev before, but can't now... cry about it
+ if grubTarget is None:
return ""
# migrate info to /etc/sysconfig/grub
- self.writeSysconfig(instRoot, theDev)
+ self.writeSysconfig(instRoot, grubTarget)
# update device.map
self.updateDeviceMap(instRoot)
@@ -535,7 +518,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
grubPath = "/boot/grub"
cfPath = "/boot/"
- return self.installGrub(instRoot, bootDev, theDev, grubPath, cfPath)
+ return self.installGrub(instRoot, bootDev, grubTarget, grubPath, cfPath)
def writeSysconfig(self, instRoot, installDev):
sysconf = '/etc/sysconfig/grub'