diff options
author | Hans de Goede <hdegoede@redhat.com> | 2009-08-04 12:34:08 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2009-08-05 11:36:40 +0200 |
commit | 829c4fdfcdca1207f5bb40fbdf1a67a7e0859064 (patch) | |
tree | a62c5ef73129a9d2deba57a34bff762fec229c42 | |
parent | 81cc86e56a897fc3778e1ee806600bfce2af4311 (diff) | |
download | anaconda-829c4fdfcdca1207f5bb40fbdf1a67a7e0859064.tar.gz anaconda-829c4fdfcdca1207f5bb40fbdf1a67a7e0859064.tar.xz anaconda-829c4fdfcdca1207f5bb40fbdf1a67a7e0859064.zip |
Pass InstalltData to booty __init__ as it needs access to many of its members
Currently we are passing storage and network to booty's __init__, for
writing the necessary kernel cmdline parameters for dracut for international
consoles / keyboards booty will also need access to keyboard and language,
instead of passing these all in seperately just pass InstalltData to booty's
__init__. This is a preparation patch for writing out the dracut kernel
cmdline commands for i18n support.
-rw-r--r-- | booty/__init__.py | 16 | ||||
-rw-r--r-- | booty/alpha.py | 4 | ||||
-rw-r--r-- | booty/bootloaderInfo.py | 23 | ||||
-rw-r--r-- | booty/ia64.py | 4 | ||||
-rw-r--r-- | booty/ppc.py | 4 | ||||
-rw-r--r-- | booty/s390.py | 4 | ||||
-rw-r--r-- | booty/sparc.py | 4 | ||||
-rw-r--r-- | booty/x86.py | 6 | ||||
-rw-r--r-- | instdata.py | 2 |
9 files changed, 33 insertions, 34 deletions
diff --git a/booty/__init__.py b/booty/__init__.py index 8f2d6a794..f0b571d39 100644 --- a/booty/__init__.py +++ b/booty/__init__.py @@ -28,25 +28,25 @@ class BootyNoKernelWarning: return self.value # return instance of the appropriate bootloader for our arch -def getBootloader(storage, network): +def getBootloader(instData): """Get the bootloader info object for your architecture""" if iutil.isX86(): import x86 - return x86.x86BootloaderInfo(storage, network) + return x86.x86BootloaderInfo(instData) elif iutil.isIA64(): import ia64 - return ia64.ia64BootloaderInfo(storage, network) + return ia64.ia64BootloaderInfo(instData) elif iutil.isS390(): import s390 - return s390.s390BootloaderInfo(storage, network) + return s390.s390BootloaderInfo(instData) elif iutil.isAlpha(): import alpha - return alpha.alphaBootloaderInfo(storage, network) + return alpha.alphaBootloaderInfo(instData) elif iutil.isPPC(): import ppc - return ppc.ppcBootloaderInfo(storage, network) + return ppc.ppcBootloaderInfo(instData) elif iutil.isSparc(): import sparc - return sparc.sparcBootloaderInfo(storage, network) + return sparc.sparcBootloaderInfo(instData) else: - return bootloaderInfo(storage, network) + return bootloaderInfo(instData) diff --git a/booty/alpha.py b/booty/alpha.py index 9f7c7cf77..8384162b2 100644 --- a/booty/alpha.py +++ b/booty/alpha.py @@ -142,8 +142,8 @@ class alphaBootloaderInfo(bootloaderInfo): return self.writeAboot(instRoot, bl, kernelList, chainList, defaultDev, justConfig) - def __init__(self, storage, network): - bootloaderInfo.__init__(self, storage, network) + def __init__(self, instData): + bootloaderInfo.__init__(self, instData) self.useGrubVal = 0 self.configfile = "/etc/aboot.conf" # self.kernelLocation is already set to what we need. diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py index 7f226c360..817a00021 100644 --- a/booty/bootloaderInfo.py +++ b/booty/bootloaderInfo.py @@ -88,8 +88,8 @@ class KernelArguments: def get(self): args = self.args - root = self.storage.fsset.rootDevice - for d in self.storage.devices: + root = self.id.storage.fsset.rootDevice + for d in self.id.storage.devices: if root.dependsOn(d): dracutSetupString = d.dracutSetupString() if len(dracutSetupString): @@ -97,7 +97,7 @@ class KernelArguments: import storage if isinstance(d, storage.devices.NetworkStorageDevice): args += " " - args += self.network.dracutSetupString(d.host_address) + args += self.id.network.dracutSetupString(d.host_address) return args @@ -119,7 +119,7 @@ class KernelArguments: self.args = self.args + "%s" % (args,) - def __init__(self, storage, network): + def __init__(self, instData): newArgs = [] cfgFilename = "/tmp/install.cfg" @@ -156,8 +156,7 @@ class KernelArguments: newArgs.append(arg) self.args = " ".join(newArgs) - self.storage = storage - self.network = network + self.id = instData class BootImages: @@ -481,8 +480,8 @@ class bootloaderInfo: self._drivelist = val drivelist = property(_getDriveList, _setDriveList) - def __init__(self, storage, network): - self.args = KernelArguments(storage, network) + def __init__(self, instData): + self.args = KernelArguments(instData) self.images = BootImages() self.device = None self.defaultDevice = None # XXX hack, used by kickstart @@ -494,7 +493,7 @@ class bootloaderInfo: self.pure = None self.above1024 = 0 self.timeout = None - self.storage = storage + self.storage = instData.storage # this has somewhat strange semantics. if 0, act like a normal # "install" case. if 1, update lilo.conf (since grubby won't do that) @@ -619,11 +618,11 @@ class efiBootloaderInfo(bootloaderInfo): return rc return self.addNewEfiEntry(instRoot) - def __init__(self, storage, network, initialize = True): + def __init__(self, instData, initialize = True): if initialize: - bootloaderInfo.__init__(self, storage, network) + bootloaderInfo.__init__(self, instData) else: - self.storage = storage + self.storage = instData.storage if iutil.isEfi(): self._configdir = "/boot/efi/EFI/redhat" diff --git a/booty/ia64.py b/booty/ia64.py index c5bd42e3c..bf2689fd2 100644 --- a/booty/ia64.py +++ b/booty/ia64.py @@ -36,7 +36,7 @@ class ia64BootloaderInfo(efiBootloaderInfo): def makeInitrd(self, kernelTag): return "/boot/efi/EFI/redhat/initrd%s.img" % kernelTag - def __init__(self, storage, network): - efiBootloaderInfo.__init__(self, storage, network) + def __init__(self, instData): + efiBootloaderInfo.__init__(self, instData) self._configname = "elilo.conf" self._bootloader = "elilo.efi" diff --git a/booty/ppc.py b/booty/ppc.py index 2143c14c8..5b96be74f 100644 --- a/booty/ppc.py +++ b/booty/ppc.py @@ -174,8 +174,8 @@ class ppcBootloaderInfo(bootloaderInfo): return 0 - def __init__(self, storage, network): - bootloaderInfo.__init__(self, storage, network) + def __init__(self, instData): + bootloaderInfo.__init__(self, instData) self.useYabootVal = 1 self.kernelLocation = "/boot" self.configfile = "/etc/yaboot.conf" diff --git a/booty/s390.py b/booty/s390.py index 8e46fab13..e8659317c 100644 --- a/booty/s390.py +++ b/booty/s390.py @@ -171,8 +171,8 @@ class s390BootloaderInfo(bootloaderInfo): return self.writeChandevConf(bl, instRoot) - def __init__(self, storage, network): - bootloaderInfo.__init__(self, storage, network) + def __init__(self, instData): + bootloaderInfo.__init__(self, instData) self.useZiplVal = 1 # only used on s390 self.kernelLocation = "/boot/" self.configfile = "/etc/zipl.conf" diff --git a/booty/sparc.py b/booty/sparc.py index 9154ac3c0..5b379b90c 100644 --- a/booty/sparc.py +++ b/booty/sparc.py @@ -121,8 +121,8 @@ class sparcBootloaderInfo(bootloaderInfo): else: raise BootyNoKernelWarning - def __init__(self, storage, network): - bootloaderInfo.__init__(self, storage, network) + def __init__(self, instData): + bootloaderInfo.__init__(self, instData) self.useSiloVal = 1 self.kernelLocation = "/boot" self._configdir = "/etc" diff --git a/booty/x86.py b/booty/x86.py index 97354fc72..d9bebcb4c 100644 --- a/booty/x86.py +++ b/booty/x86.py @@ -578,15 +578,15 @@ class x86BootloaderInfo(efiBootloaderInfo): return args - def __init__(self, storage, network): - bootloaderInfo.__init__(self, storage, network) + def __init__(self, instData): + bootloaderInfo.__init__(self, instData) # these have to be set /before/ efiBootloaderInfo.__init__(), or # they'll be overwritten. self._configdir = "/boot/grub" self._configname = "grub.conf" - efiBootloaderInfo.__init__(self, storage, network, initialize=False) + efiBootloaderInfo.__init__(self, instData, initialize=False) # XXX use checkbootloader to determine what to default to self.useGrubVal = 1 diff --git a/instdata.py b/instdata.py index b3497b329..fdb1a32e4 100644 --- a/instdata.py +++ b/instdata.py @@ -74,7 +74,7 @@ class InstallData: if flags.cmdline.has_key("preupgrade"): self.upgrade = True self.storage = storage.Storage(self.anaconda) - self.bootloader = booty.getBootloader(self.storage, self.network) + self.bootloader = booty.getBootloader(self) self.upgradeRoot = None self.rootParts = None self.upgradeSwapInfo = None |