summaryrefslogtreecommitdiffstats
path: root/booty
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2009-06-30 15:58:08 -0400
committerJeremy Katz <katzj@redhat.com>2009-07-01 10:21:37 -0400
commit730ced61e467e10ed620c2a6ee18c7695837a6b8 (patch)
tree269cebf5a97eea963d083ce99284848df69a99eb /booty
parentd688d02f8482492df54f703c658569fe2e1cad15 (diff)
downloadanaconda-730ced61e467e10ed620c2a6ee18c7695837a6b8.tar.gz
anaconda-730ced61e467e10ed620c2a6ee18c7695837a6b8.tar.xz
anaconda-730ced61e467e10ed620c2a6ee18c7695837a6b8.zip
Use iutil arch specifiers rather than rhpl
Switch to using iutil.isFoo() methods rather than checking the value of rhpl.getArch()
Diffstat (limited to 'booty')
-rw-r--r--booty/__init__.py17
-rw-r--r--booty/bootloaderInfo.py13
-rw-r--r--booty/checkbootloader.py1
-rw-r--r--booty/ppc.py7
-rw-r--r--booty/x86.py3
5 files changed, 17 insertions, 24 deletions
diff --git a/booty/__init__.py b/booty/__init__.py
index fc34a56e3..9ee639864 100644
--- a/booty/__init__.py
+++ b/booty/__init__.py
@@ -16,7 +16,7 @@
#
"""Module for manipulation and creation of boot loader configurations"""
-import rhpl
+import iutil
from bootloaderInfo import *
from bootloader import *
@@ -30,25 +30,22 @@ class BootyNoKernelWarning:
# return instance of the appropriate bootloader for our arch
def getBootloader(storage):
"""Get the bootloader info object for your architecture"""
- if rhpl.getArch() == 'i386':
+ if iutil.isX86():
import x86
return x86.x86BootloaderInfo(storage)
- elif rhpl.getArch() == 'ia64':
+ elif iutil.isIA64():
import ia64
return ia64.ia64BootloaderInfo(storage)
- elif rhpl.getArch() == 's390' or rhpl.getArch() == "s390x":
+ elif iutil.isS390():
import s390
return s390.s390BootloaderInfo(storage)
- elif rhpl.getArch() == "alpha":
+ elif iutil.isAlpha():
import alpha
return alpha.alphaBootloaderInfo(storage)
- elif rhpl.getArch() == "x86_64":
- import x86
- return x86.x86BootloaderInfo(storage)
- elif rhpl.getArch() == "ppc":
+ elif iutil.isPPC():
import ppc
return ppc.ppcBootloaderInfo(storage)
- elif rhpl.getArch() == "sparc":
+ elif iutil.isSparc():
import sparc
return sparc.sparcBootloaderInfo(storage)
else:
diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py
index 0cee1f6dc..bdfb1d90a 100644
--- a/booty/bootloaderInfo.py
+++ b/booty/bootloaderInfo.py
@@ -29,7 +29,6 @@ _ = lambda x: gettext.ldgettext("anaconda", x)
N_ = lambda x: x
from lilo import LiloConfigFile
-import rhpl
from flags import flags
import iutil
@@ -40,13 +39,13 @@ import booty
import checkbootloader
from util import getDiskPart
-if rhpl.getArch() not in ("s390", "s390x"):
+if not iutil.isS390():
import block
dosFilesystems = ('FAT', 'fat16', 'fat32', 'ntfs', 'hpfs')
def doesDualBoot():
- if rhpl.getArch() == "i386" or rhpl.getArch() == "x86_64":
+ if iutil.isX86():
return 1
return 0
@@ -112,7 +111,7 @@ class KernelArguments:
newArgs = []
cfgFilename = "/tmp/install.cfg"
- if rhpl.getArch() == "s390":
+ if iutil.isS390():
self.cargs = []
f = open(cfgFilename)
for line in f:
@@ -189,7 +188,7 @@ class BootImages:
if not self.images.has_key(dev.name):
if type in dosFilesystems and doesDualBoot():
self.images[dev.name] = ("Other", "Other", type)
- elif type in ("hfs", "hfs+") and rhpl.getPPCMachine() == "PMac":
+ elif type in ("hfs", "hfs+") and iutil.getPPCMachine() == "PMac":
self.images[dev.name] = ("Other", "Other", type)
else:
self.images[dev.name] = (None, None, type)
@@ -228,7 +227,7 @@ class BootImages:
# maybe questionable, but the first ntfs or fat is likely to
# be the correct one to boot with XP using ntfs
foundDos = True
- elif type == "appleboot" and rhpl.getPPCMachine() == "PMac" and part.bootable:
+ elif type == "appleboot" and iutil.getPPCMachine() == "PMac" and part.bootable:
foundAppleBootstrap = True
elif type in ["hfs", "hfs+"] and foundAppleBootstrap:
# questionable for same reason as above, but on mac this time
@@ -505,7 +504,7 @@ class bootloaderInfo:
else:
device = console
- if not device and rhpl.getArch() != "ia64":
+ if not device and iutil.isIA64():
self.serialDevice = "ttyS0"
self.serialOptions = ""
else:
diff --git a/booty/checkbootloader.py b/booty/checkbootloader.py
index 9508e14a6..1b1ca1d1b 100644
--- a/booty/checkbootloader.py
+++ b/booty/checkbootloader.py
@@ -17,7 +17,6 @@
import os
import string
-import rhpl
from util import getDiskPart
import iutil
diff --git a/booty/ppc.py b/booty/ppc.py
index 8cd427532..e5320c343 100644
--- a/booty/ppc.py
+++ b/booty/ppc.py
@@ -5,14 +5,13 @@ from booty import BootyNoKernelWarning
from util import getDiskPart
from bootloaderInfo import *
import iutil
-import rhpl
class ppcBootloaderInfo(bootloaderInfo):
def getBootDevs(self, bl):
import parted
retval = []
- machine = rhpl.getPPCMachine()
+ machine = iutil.getPPCMachine()
if machine == 'pSeries':
for dev in self.storage.fsset.devices:
@@ -74,7 +73,7 @@ class ppcBootloaderInfo(bootloaderInfo):
f.write("enablenetboot\n")
yabootProg = "/sbin/mkofboot"
- if rhpl.getPPCMachine() == "PMac":
+ if iutil.getPPCMachine() == "PMac":
# write out the first hfs/hfs+ partition as being macosx
for (label, longlabel, device) in chainList:
if ((not label) or (label == "")):
@@ -84,7 +83,7 @@ class ppcBootloaderInfo(bootloaderInfo):
f.write("magicboot=/usr/lib/yaboot/ofboot\n")
- elif rhpl.getPPCMachine() == "pSeries":
+ elif iutil.getPPCMachine() == "pSeries":
f.write("nonvram\n")
f.write("fstype=raw\n")
diff --git a/booty/x86.py b/booty/x86.py
index d0972c825..3890e698d 100644
--- a/booty/x86.py
+++ b/booty/x86.py
@@ -7,7 +7,6 @@ from bootloaderInfo import *
from flags import flags
import checkbootloader
import iutil
-import rhpl
class x86BootloaderInfo(efiBootloaderInfo):
def setPassword(self, val, isCrypted = 1):
@@ -413,7 +412,7 @@ class x86BootloaderInfo(efiBootloaderInfo):
config.addEntry("message", message, replace = 0)
if not config.testEntry('lba32'):
- if bl.above1024 and rhpl.getArch() != "x86_64":
+ if bl.above1024 and not iutil.isX86(bits=32):
config.addEntry("lba32", replace = 0)
return config