diff options
author | Chris Lumens <clumens@redhat.com> | 2009-02-27 13:39:00 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-03-04 15:37:04 -0500 |
commit | 1e2313dec51238148b10e2e817b11cc7cbd86b81 (patch) | |
tree | 72c7f4f82acbf8b6ee0836c5e95f62d6e07c42d2 /booty | |
parent | 8bed1806f592a600366353908e24e3c0435c268b (diff) | |
download | anaconda-1e2313dec51238148b10e2e817b11cc7cbd86b81.tar.gz anaconda-1e2313dec51238148b10e2e817b11cc7cbd86b81.tar.xz anaconda-1e2313dec51238148b10e2e817b11cc7cbd86b81.zip |
Remove all uses of fsset.getEntryByMountPoint.
Diffstat (limited to 'booty')
-rw-r--r-- | booty/alpha.py | 24 | ||||
-rw-r--r-- | booty/bootloaderInfo.py | 70 | ||||
-rw-r--r-- | booty/ia64.py | 14 | ||||
-rw-r--r-- | booty/ppc.py | 43 | ||||
-rw-r--r-- | booty/s390.py | 22 | ||||
-rw-r--r-- | booty/sparc.py | 26 | ||||
-rw-r--r-- | booty/x86.py | 68 |
7 files changed, 133 insertions, 134 deletions
diff --git a/booty/alpha.py b/booty/alpha.py index d56c4cadd..8dfb005ca 100644 --- a/booty/alpha.py +++ b/booty/alpha.py @@ -15,14 +15,14 @@ class alphaBootloaderInfo(bootloaderInfo): (foo, partitionNumber) = getDiskPart(path) return partitionNumber + 1 - def writeAboot(self, instRoot, fsset, bl, kernelList, + def writeAboot(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig): - # Get bootDevice and rootDevice - rootDevice = fsset.getEntryByMountPoint("/").device.getDevice() - if fsset.getEntryByMountPoint("/boot"): - bootDevice = fsset.getEntryByMountPoint("/boot").device.getDevice() - else: + rootDevice = storage.fsset.mountpoints["/"] + try: + bootDevice = storage.fsset.mountpoints["/boot"] + except KeyError: bootDevice = rootDevice + bootnotroot = bootDevice != rootDevice # If /etc/aboot.conf already exists we rename it @@ -66,7 +66,7 @@ class alphaBootloaderInfo(bootloaderInfo): f.write ("# all kernel paths are relative to /boot/\n") # bpn is the boot partition number. - bpn = self.partitionNum(bootDevice) + bpn = self.partitionNum(bootDevice.path) lines = 0 # We write entries line using the following format: @@ -84,7 +84,7 @@ class alphaBootloaderInfo(bootloaderInfo): if os.path.isfile(instRoot + initrd): f.write(" initrd=%sinitrd%s.img" %(kernelPath, kernelTag)) - realroot = getRootDevName(initrd, fsset, rootDevice, instRoot) + realroot = getRootDevName(instRoot+initrd, rootDevice.path) f.write(" root=%s" %(realroot,)) args = self.args.get() @@ -102,8 +102,8 @@ class alphaBootloaderInfo(bootloaderInfo): # Now we're ready to write the relevant boot information. wbd # is the whole boot device, bdpn is the boot device partition # number. - wbd = self.wholeDevice (bootDevice) - bdpn = self.partitionNum (bootDevice) + wbd = self.wholeDevice (bootDevice.path) + bdpn = self.partitionNum (bootDevice.path) # Calling swriteboot. The first argument is the disk to write # to and the second argument is a path to the bootstrap loader @@ -126,12 +126,12 @@ class alphaBootloaderInfo(bootloaderInfo): stderr = "/dev/tty5") - def write(self, instRoot, fsset, bl, kernelList, chainList, + def write(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig, intf): if len(kernelList) < 1: self.noKernelsWarn(intf) - self.writeAboot(instRoot, fsset, bl, kernelList, + self.writeAboot(instRoot, bl, kernelList, chainList, defaultDev, justConfig) def __init__(self): diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py index b44219310..ee9a31ca8 100644 --- a/booty/bootloaderInfo.py +++ b/booty/bootloaderInfo.py @@ -84,19 +84,19 @@ def rootIsDevice(dev): # hackery to determine if we should do root=LABEL=/ or whatnot # as usual, knows too much about anaconda -def getRootDevName(initrd, fsset, rootDev, instRoot): - if not os.access(instRoot + initrd, os.R_OK): - return "/dev/%s" % (rootDev,) +def getRootDevName(initrd, rootDevice): + if not os.access(initrd, os.R_OK): + return rootDevice.path try: - rootEntry = fsset.getEntryByMountPoint("/") - if rootEntry.getUuid() is not None: - return "UUID=%s" %(rootEntry.getUuid(),) - elif rootEntry.getLabel() is not None and rootEntry.device.doLabel is not None: - return "LABEL=%s" %(rootEntry.getLabel(),) - return "/dev/%s" %(rootDev,) + if rootDevice.uuid: + return "UUID=%s" % rootDevice.uuid + elif rootDevice.label: + return "LABEL=%s" % rootDevice.label + + return rootDevice.path except: - return "/dev/%s" %(rootDev,) + return rootDevice.path class BootyNoKernelWarning: def __init__ (self, value=""): @@ -221,8 +221,8 @@ class BootImages: if not self.images.has_key(self.default): - entry = fsset.getEntryByMountPoint('/') - self.default = entry.device.getDevice() + device = storage.fsset.mountpoints["/"] + self.default = device (label, longlabel, type) = self.images[self.default] if not label: self.images[self.default] = ("linux", productName, type) @@ -255,18 +255,19 @@ class BootImages: devs.append((dev, type)) break - slash = fsset.getEntryByMountPoint('/') - if not slash or not slash.device or not slash.fsystem: + try: + rootDevice = storage.fsset.mountpoints["/"] + except KeyError: + rootDevice = None + + if not rootDevice or not rootDevice.format.bootable: raise ValueError, ("Trying to pick boot devices but do not have a " "sane root partition. Aborting install.") - devs.append((slash.device.getDevice(), slash.fsystem.getName())) + devs.append((rootDevice, rootDevice.format.type)) devs.sort() - return devs - - class bootloaderInfo: def getConfigFileName(self): if not self._configname: @@ -317,12 +318,7 @@ class bootloaderInfo: def makeInitrd(self, kernelTag): return "/boot/initrd%s.img" % kernelTag - # XXX need to abstract out the requirement for a fsset to be able - # to get it "on the fly" on a running system as well as being able - # to get it how we do now from anaconda. probably by having the - # first thing in the chain create a "fsset" object that has the - # dictionary of mounted filesystems since that's what we care about - def getBootloaderConfig(self, instRoot, fsset, bl, kernelList, + def getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev): images = bl.images.getImages() @@ -352,8 +348,9 @@ class bootloaderInfo: lilo.addEntry("prompt", replace = 0) lilo.addEntry("timeout", self.timeout or "20", replace = 0) - rootDev = fsset.getEntryByMountPoint("/").device.getDevice() - if not rootDev: + try: + rootDev = storage.fsset.mountpoints["/"] + except KeyError: raise RuntimeError, "Installing lilo, but there is no root device" if rootDev == defaultDev: @@ -382,9 +379,9 @@ class bootloaderInfo: sl.addEntry("read-only") append = "%s" %(self.args.get(),) - realroot = getRootDevName(initrd, fsset, rootDev, instRoot) + realroot = getRootDevName(instRoot+initrd, rootDev.path) if rootIsDevice(realroot): - sl.addEntry("root", '/dev/' + rootDev) + sl.addEntry("root", rootDev.path) else: if len(append) > 0: append = "%s root=%s" %(append,realroot) @@ -440,10 +437,10 @@ class bootloaderInfo: return lilo - def write(self, instRoot, fsset, bl, kernelList, chainList, + def write(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig, intf = None): if len(kernelList) >= 1: - config = self.getBootloaderConfig(instRoot, fsset, bl, + config = self.getBootloaderConfig(instRoot, bl, kernelList, chainList, defaultDev) config.write(instRoot + self.configfile, perms = self.perms) @@ -610,10 +607,11 @@ class efiBootloaderInfo(bootloaderInfo): root = instRoot, stdout="/dev/tty5", stderr="/dev/tty5") - def addNewEfiEntry(self, instRoot, fsset): - bootdev = fsset.getEntryByMountPoint("/boot/efi").device.getDevice() - if not bootdev: - bootdev = fsset.getEntryByDeviceName("sda1").device.getDevice() + def addNewEfiEntry(self, instRoot): + try: + bootdev = storage.fsset.mountpoints["/boot/efi"] + except KeyError: + bootdev = storage.devicetree.getDeviceByName("sda1") link = "%s%s/%s" % (instRoot, "/etc/", self.configname) if not os.access(link, os.R_OK): @@ -639,12 +637,12 @@ class efiBootloaderInfo(bootloaderInfo): stdout = "/dev/tty5", stderr = "/dev/tty5") - def installGrub(self, instRoot, bootDevs, grubTarget, grubPath, fsset, + def installGrub(self, instRoot, bootDevs, grubTarget, grubPath, target, cfPath): if not iutil.isEfi(): raise EnvironmentError self.removeOldEfiEntries(instRoot) - self.addNewEfiEntry(instRoot, fsset) + self.addNewEfiEntry(instRoot) def __init__(self, initialize = True): if initialize: diff --git a/booty/ia64.py b/booty/ia64.py index 3f1e88393..174c696d5 100644 --- a/booty/ia64.py +++ b/booty/ia64.py @@ -1,9 +1,9 @@ from bootloaderInfo import * class ia64BootloaderInfo(efiBootloaderInfo): - def getBootloaderConfig(self, instRoot, fsset, bl, kernelList, + def getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev): - config = bootloaderInfo.getBootloaderConfig(self, instRoot, fsset, + config = bootloaderInfo.getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev) # altix boxes need relocatable (#120851) @@ -11,24 +11,24 @@ class ia64BootloaderInfo(efiBootloaderInfo): return config - def writeLilo(self, instRoot, fsset, bl, kernelList, + def writeLilo(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig): - config = self.getBootloaderConfig(instRoot, fsset, bl, + config = self.getBootloaderConfig(instRoot, bl, kernelList, chainList, defaultDev) config.write(instRoot + self.configfile, perms = 0755) return "" - def write(self, instRoot, fsset, bl, kernelList, chainList, + def write(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig, intf): if len(kernelList) >= 1: - out = self.writeLilo(instRoot, fsset, bl, kernelList, + out = self.writeLilo(instRoot, bl, kernelList, chainList, defaultDev, justConfig) else: self.noKernelsWarn(intf) self.removeOldEfiEntries(instRoot) - self.addNewEfiEntry(instRoot, fsset) + self.addNewEfiEntry(instRoot) def makeInitrd(self, kernelTag): return "/boot/efi/EFI/redhat/initrd%s.img" % kernelTag diff --git a/booty/ppc.py b/booty/ppc.py index 24a5df8fa..bf92e71e3 100644 --- a/booty/ppc.py +++ b/booty/ppc.py @@ -27,40 +27,43 @@ class ppcBootloaderInfo(bootloaderInfo): if len(devs) == 0: # Try to get a boot device; bplan OF understands ext3 if machine == 'Pegasos' or machine == 'Efika': - entry = fs.getEntryByMountPoint('/boot') - # Try / if we don't have this we're not going to work - if not entry: - entry = fs.getEntryByMountPoint('/') - if entry: - dev = "/dev/%s" % (entry.device.getDevice(asBoot=1),) - devs.append(dev) + try: + device = storage.fsset.mountpoints["/boot"] + except KeyError: + try: + # Try / if we don't have this we're not going to work + device = storage.fsset.mountpoints["/"] + except KeyError: + return devs + + devs.append(device.path) else: if bl.getDevice(): devs.append("/dev/%s" % bl.getDevice()) return devs - def writeYaboot(self, instRoot, fsset, bl, kernelList, + def writeYaboot(self, instRoot, bl, kernelList, chainList, defaultDev, justConfigFile): - yabootTarget = string.join(self.getBootDevs(fsset, bl)) + yabootTarget = string.join(self.getBootDevs(bl)) + + try: + bootDev = storage.fsset.mountpoints["/boot"] - bootDev = fsset.getEntryByMountPoint("/boot") - if bootDev: cf = "/boot/etc/yaboot.conf" cfPath = "" if not os.path.isdir(instRoot + "/boot/etc"): os.mkdir(instRoot + "/boot/etc") - else: - bootDev = fsset.getEntryByMountPoint("/") + except KeyError: + bootDev = storage.fsset.mountpoints["/"] + cfPath = "/boot" cf = "/etc/yaboot.conf" - bootDev = bootDev.device.getDevice(asBoot = 1) f = open(instRoot + cf, "w+") f.write("# yaboot.conf generated by anaconda\n\n") - f.write("boot=%s\n" %(yabootTarget,)) f.write("init-message=\"Welcome to %s!\\nHit <TAB> for boot options\"\n\n" % productName) @@ -105,8 +108,8 @@ class ppcBootloaderInfo(bootloaderInfo): f.write("restricted\n") f.write("\n") - - rootDev = fsset.getEntryByMountPoint("/").device.getDevice() + + rootDev = storage.fsset.mountpoints["/"] for (label, longlabel, version) in kernelList: kernelTag = "-" + version @@ -122,7 +125,7 @@ class ppcBootloaderInfo(bootloaderInfo): append = "%s" %(self.args.get(),) - realroot = getRootDevName(initrd, fsset, rootDev, instRoot) + realroot = getRootDevName(instRoot+initrd, rootDev.path) if rootIsDevice(realroot): f.write("\troot=%s\n" %(realroot,)) else: @@ -165,10 +168,10 @@ class ppcBootloaderInfo(bootloaderInfo): # or not self.password = val - def write(self, instRoot, fsset, bl, kernelList, chainList, + def write(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig, intf): if len(kernelList) >= 1: - out = self.writeYaboot(instRoot, fsset, bl, kernelList, + out = self.writeYaboot(instRoot, bl, kernelList, chainList, defaultDev, justConfig) else: self.noKernelsWarn(intf) diff --git a/booty/s390.py b/booty/s390.py index a1857363c..92f640d9d 100644 --- a/booty/s390.py +++ b/booty/s390.py @@ -1,11 +1,10 @@ import os from bootloaderInfo import * -import fsset import iutil class s390BootloaderInfo(bootloaderInfo): - def getBootloaderConfig(self, instRoot, fsset, bl, kernelList, + def getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev): images = bl.images.getImages() @@ -27,8 +26,9 @@ class s390BootloaderInfo(bootloaderInfo): if not os.access(instRoot + sl.getPath(), os.R_OK): lilo.delImage(label) - rootDev = fsset.getEntryByMountPoint("/").device.getDevice() - if not rootDev: + try: + rootDev = storage.fsset.mountpoints["/"] + except KeyError: raise RuntimeError, "Installing zipl, but there is no root device" if rootDev == defaultDev: @@ -55,8 +55,8 @@ class s390BootloaderInfo(bootloaderInfo): "%sinitrd%s.img" %(self.kernelLocation, kernelTag)) sl.addEntry("read-only") - sl.addEntry("root", '/dev/' + rootDev) - sl.addEntry("ipldevice", '/dev/' + rootDev[:-1]) + sl.addEntry("root", rootDev.path) + sl.addEntry("ipldevice", rootDev.path[:-1]) if self.args.get(): sl.addEntry('append', '"%s"' % self.args.get()) @@ -120,10 +120,10 @@ class s390BootloaderInfo(bootloaderInfo): return "" - def writeZipl(self, instRoot, fsset, bl, kernelList, chainList, + def writeZipl(self, instRoot, bl, kernelList, chainList, defaultDev, justConfigFile): images = bl.images.getImages() - rootDev = fsset.getEntryByMountPoint("/").device.getDevice() + rootDev = storage.fsset.mountpoints["/"] cf = '/etc/zipl.conf' self.perms = 0600 @@ -149,7 +149,7 @@ class s390BootloaderInfo(bootloaderInfo): if os.access (instRoot + initrd, os.R_OK): f.write('\tramdisk=%sinitrd%s.img\n' %(self.kernelLocation, kernelTag)) - realroot = getRootDevName(initrd, fsset, rootDev, instRoot) + realroot = getRootDevName(instRoot+initrd, rootDev.path) f.write('\tparameters="root=%s' %(realroot,)) if bl.args.get(): f.write(' %s' % (bl.args.get())) @@ -165,9 +165,9 @@ class s390BootloaderInfo(bootloaderInfo): return "" - def write(self, instRoot, fsset, bl, kernelList, chainList, + def write(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig, intf): - out = self.writeZipl(instRoot, fsset, bl, kernelList, + out = self.writeZipl(instRoot, bl, kernelList, chainList, defaultDev, justConfig | (not self.useZiplVal)) out = self.writeChandevConf(bl, instRoot) diff --git a/booty/sparc.py b/booty/sparc.py index a9cfaf83f..1de44927d 100644 --- a/booty/sparc.py +++ b/booty/sparc.py @@ -1,26 +1,26 @@ import os from bootloaderInfo import * -import fsset class sparcBootloaderInfo(bootloaderInfo): - def writeSilo(self, instRoot, fsset, bl, kernelList, + def writeSilo(self, instRoot, bl, kernelList, chainList, defaultDev, justConfigFile): - bootDev = fsset.getEntryByMountPoint("/boot") - mf = '/silo.message' - if bootDev: + try: + bootDev = storage.fsset.mountpoints["/boot"] + + mf = '/silo.message' cf = "/boot/silo.conf" mfdir = '/boot' cfPath = "" if not os.path.isdir(instRoot + "/boot"): os.mkdir(instRoot + "/boot") - else: - bootDev = fsset.getEntryByMountPoint("/") + except KeyError: + bootDev = storage.fsset.mountpoints["/"] + cf = "/etc/silo.conf" mfdir = '/etc' cfPath = "/boot" - bootDev = bootDev.device.getDevice(asBoot = 1) f = open(instRoot + mfdir + mf, "w+") f.write("Welcome to %s!\nHit <TAB> for boot options\n\n" % productName) @@ -30,7 +30,7 @@ class sparcBootloaderInfo(bootloaderInfo): f = open(instRoot + cf, "w+") f.write("# silo.conf generated by anaconda\n\n") - f.write("#boot=%s\n" % (bootDev,)) + f.write("#boot=%s\n" % (bootDev.path,)) f.write("message=%s\n" % (mf,)) f.write("timeout=%s\n" % (self.timeout or 50)) @@ -45,7 +45,7 @@ class sparcBootloaderInfo(bootloaderInfo): f.write("default=%s\n" % (kernelList[0][0],)) f.write("\n") - rootDev = fsset.getEntryByMountPoint("/").device.getDevice() + rootDev = storage.fsset.mountpoints["/"] for (label, longlabel, version) in kernelList: kernelTag = "-" + version @@ -61,7 +61,7 @@ class sparcBootloaderInfo(bootloaderInfo): append = "%s" % (self.args.get(),) - realroot = getRootDevName(initrd, fsset, rootDev, instRoot) + realroot = getRootDevName(instRoot+initrd, rootDev.path) if rootIsDevice(realroot): f.write("\troot=%s\n" % (realroot,)) else: @@ -110,10 +110,10 @@ class sparcBootloaderInfo(bootloaderInfo): # silo just handles the password unencrypted self.password = val - def write(self, instRoot, fsset, bl, kernelList, chainList, + def write(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig, intf): if len(kernelList) >= 1: - self.writeSilo(instRoot, fsset, bl, kernelList, chainList, + self.writeSilo(instRoot, bl, kernelList, chainList, defaultDev, justConfig) else: self.noKernelsWarn(intf) diff --git a/booty/x86.py b/booty/x86.py index 0ce86053c..3046cf7e5 100644 --- a/booty/x86.py +++ b/booty/x86.py @@ -98,11 +98,11 @@ class x86BootloaderInfo(efiBootloaderInfo): root = instRoot) os.close(p[0]) - def installGrub(self, instRoot, bootDevs, grubTarget, grubPath, fsset, + def installGrub(self, instRoot, bootDevs, grubTarget, grubPath, target, cfPath): if iutil.isEfi(): efiBootloaderInfo.installGrub(self, instRoot, bootDevs, grubTarget, - grubPath, fsset, target, cfPath) + grubPath, target, cfPath) return args = "--stage2=/boot/grub/stage2 " @@ -126,11 +126,11 @@ class x86BootloaderInfo(efiBootloaderInfo): self.runGrubInstall(instRoot, bootDev, cmds, cfPath) - def writeGrub(self, instRoot, fsset, bl, kernelList, chainList, + def writeGrub(self, instRoot, bl, kernelList, chainList, defaultDev, justConfigFile): images = bl.images.getImages() - rootDev = fsset.getEntryByMountPoint("/").device.getDevice() + rootDev = storage.fsset.mountpoints["/"] # XXX old config file should be read here for upgrade @@ -160,29 +160,27 @@ class x86BootloaderInfo(efiBootloaderInfo): f.write("# Note that you do not have to rerun grub " "after making changes to this file\n") - bootDev = fsset.getEntryByMountPoint("/boot") - grubPath = "/grub" - cfPath = "/" - if not bootDev: - bootDev = fsset.getEntryByMountPoint("/") + try: + bootDev = storage.fsset.mountpoints["/boot"] + grubPath = "/grub" + cfPath = "/" + f.write("# NOTICE: You have a /boot partition. This means " + "that\n") + f.write("# all kernel and initrd paths are relative " + "to /boot/, eg.\n") + except KeyError: + bootDev = storage.fsset.mountpoints["/"] grubPath = "/boot/grub" cfPath = "/boot/" f.write("# NOTICE: You do not have a /boot partition. " "This means that\n") f.write("# all kernel and initrd paths are relative " "to /, eg.\n") - else: - f.write("# NOTICE: You have a /boot partition. This means " - "that\n") - f.write("# all kernel and initrd paths are relative " - "to /boot/, eg.\n") - bootDevs = self.getPhysicalDevices(bootDev.device.getDevice()) - bootDev = bootDev.device.getDevice() + bootDevs = self.getPhysicalDevices(bootDev) f.write('# root %s\n' % self.grubbyPartitionName(bootDevs[0])) - f.write("# kernel %svmlinuz-version ro " - "root=/dev/%s\n" % (cfPath, rootDev)) + f.write("# kernel %svmlinuz-version ro root=%s\n" % (cfPath, rootDev.path)) f.write("# initrd %sinitrd-version.img\n" % (cfPath)) f.write("#boot=/dev/%s\n" % (grubTarget)) @@ -241,7 +239,7 @@ class x86BootloaderInfo(efiBootloaderInfo): f.write('title %s (%s)\n' % (longlabel, version)) f.write('\troot %s\n' % self.grubbyPartitionName(bootDevs[0])) - realroot = getRootDevName(initrd, fsset, rootDev, instRoot) + realroot = getRootDevName(instRoot+initrd, rootDev.path) realroot = " root=%s" %(realroot,) if version.endswith("xen0") or (version.endswith("xen") and not os.path.exists("/proc/xen")): @@ -358,7 +356,7 @@ class x86BootloaderInfo(efiBootloaderInfo): f.close() if not justConfigFile: - self.installGrub(instRoot, bootDevs, grubTarget, grubPath, fsset, \ + self.installGrub(instRoot, bootDevs, grubTarget, grubPath, \ target, cfPath) return "" @@ -383,9 +381,9 @@ class x86BootloaderInfo(efiBootloaderInfo): return "(%s)" %(self.grubbyDiskName(name)) - def getBootloaderConfig(self, instRoot, fsset, bl, kernelList, + def getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev): - config = bootloaderInfo.getBootloaderConfig(self, instRoot, fsset, + config = bootloaderInfo.getBootloaderConfig(self, instRoot, bl, kernelList, chainList, defaultDev) @@ -422,7 +420,7 @@ class x86BootloaderInfo(efiBootloaderInfo): # this is a hackish function that depends on the way anaconda writes # out the grub.conf with a #boot= comment # XXX this falls into the category of self.doUpgradeOnly - def upgradeGrub(self, instRoot, fsset, bl, kernelList, chainList, + def upgradeGrub(self, instRoot, bl, kernelList, chainList, defaultDev, justConfigFile): if justConfigFile: return "" @@ -455,21 +453,22 @@ class x86BootloaderInfo(efiBootloaderInfo): # more suckage. grub-install can't work without a valid /etc/mtab # so we have to do shenanigans to get updated grub installed... # steal some more code above - bootDev = fsset.getEntryByMountPoint("/boot") - grubPath = "/grub" - cfPath = "/" - if not bootDev: - bootDev = fsset.getEntryByMountPoint("/") + try: + bootDev = storage.fsset.mountpoints["/boot"] + grubPath = "/grub" + cfPath = "/" + except KeyError: + bootDev = storage.fsset.mountpoints["/"] grubPath = "/boot/grub" cfPath = "/boot/" - masterBootDev = bootDev.device.getDevice(asBoot = 0) + masterBootDev = bootDev if masterBootDev[0:2] == 'md': rootDevs = checkbootloader.getRaidDisks(masterBootDev, raidLevel=1, stripPart = 0) else: rootDevs = [masterBootDev] - + if theDev[5:7] == 'md': stage1Devs = checkbootloader.getRaidDisks(theDev[5:], raidLevel=1) else: @@ -501,8 +500,7 @@ class x86BootloaderInfo(efiBootloaderInfo): cmds.append(cmd) if not justConfigFile: - self.runGrubInstall(instRoot, bootDev.device.setupDevice(), - cmds, cfPath) + self.runGrubInstall(instRoot, bootDev cmds, cfPath) return "" @@ -518,7 +516,7 @@ class x86BootloaderInfo(efiBootloaderInfo): f.write("forcelba=0\n") f.close() - def write(self, instRoot, fsset, bl, kernelList, chainList, + def write(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig, intf): if self.timeout is None and chainList: self.timeout = 5 @@ -526,14 +524,14 @@ class x86BootloaderInfo(efiBootloaderInfo): # XXX HACK ALERT - see declaration above if self.doUpgradeOnly: if self.useGrubVal: - self.upgradeGrub(instRoot, fsset, bl, kernelList, + self.upgradeGrub(instRoot, bl, kernelList, chainList, defaultDev, justConfig) return if len(kernelList) < 1: self.noKernelsWarn(intf) - out = self.writeGrub(instRoot, fsset, bl, kernelList, + out = self.writeGrub(instRoot, bl, kernelList, chainList, defaultDev, justConfig | (not self.useGrubVal)) |