diff options
author | Chris Lumens <clumens@redhat.com> | 2009-02-27 16:19:51 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2009-03-04 15:37:03 -0500 |
commit | 165e4a1777862509ebd1785f789c1f3ec1ce496c (patch) | |
tree | 20b2b245bcab737c133bf93467799c2f0051f4cf /booty/checkbootloader.py | |
parent | 9276f6795674a776f29ccbaa4ebb0ed2b5b2e25f (diff) | |
download | anaconda-165e4a1777862509ebd1785f789c1f3ec1ce496c.tar.gz anaconda-165e4a1777862509ebd1785f789c1f3ec1ce496c.tar.xz anaconda-165e4a1777862509ebd1785f789c1f3ec1ce496c.zip |
Remove functions in booty that are duplicated in anaconda.
Diffstat (limited to 'booty/checkbootloader.py')
-rw-r--r-- | booty/checkbootloader.py | 56 |
1 files changed, 4 insertions, 52 deletions
diff --git a/booty/checkbootloader.py b/booty/checkbootloader.py index 38cb8255d..aa0ccd0ba 100644 --- a/booty/checkbootloader.py +++ b/booty/checkbootloader.py @@ -19,46 +19,14 @@ import os import string import rhpl +from fsset import getDiskPart +import iutil + grubConfigFile = "/etc/grub.conf" liloConfigFile = "/etc/lilo.conf" yabootConfigFile = "/etc/yaboot.conf" siloConfigFile = "/etc/silo.conf" - -# XXX: this is cut and pasted directly from booty/bootloaderInfo.py -# should eventually just go from there -def getDiskPart(dev): - """Return (disk, partition number) tuple for dev""" - cut = len(dev) - if (dev[:3] == "rd/" or dev[:4] == "ida/" or - dev[:6] == "cciss/"): - if dev[-2] == 'p': - cut = -1 - elif dev[-3] == 'p': - cut = -2 - else: - if dev[-2] in string.digits: - cut = -2 - elif dev[-1] in string.digits: - cut = -1 - - name = dev[:cut] - - # hack off the trailing 'p' from /dev/cciss/*, for example - if name[-1] == 'p': - for letter in name: - if letter not in string.letters and letter != "/": - name = name[:-1] - break - - if cut < 0: - partNum = int(dev[cut:]) - 1 - else: - partNum = None - - return (name, partNum) - - def getRaidDisks(raidDevice, raidLevel=None, stripPart=1): rc = [] if raidLevel is not None: @@ -140,22 +108,6 @@ def getBootDevList(line): rets.append(dev) return string.join(rets) -efi = None -## Determine if the hardware supports EFI. -# @return True if so, False otherwise. -def isEfi(): - global efi - if efi is not None: - return efi - - efi = False - if rhpl.getArch() in ("ia64", "i386", "x86_64"): - # XXX need to make sure efivars is loaded... - if os.path.exists("/sys/firmware/efi"): - efi = True - - return efi - def getBootloaderTypeAndBoot(instRoot = "/"): haveGrubConf = 1 haveLiloConf = 1 @@ -194,7 +146,7 @@ def getBootloaderTypeAndBoot(instRoot = "/"): if bootDev is not None: break - if isEfi(): + if iutil.isEfi(): return ("GRUB", bootDev) if bootDev is not None: |