diff options
author | David Cantrell <dcantrell@redhat.com> | 2009-09-01 14:21:04 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2009-09-03 11:30:10 -1000 |
commit | 1ce1ff033efabfc9ad6b731adc51fa6ab06068e4 (patch) | |
tree | 16970c3f9685db2a66d554800708d9b005f2e2db /booty | |
parent | aad14f014b9cf8c2d9e5e3cfb6521740eb29b002 (diff) | |
download | anaconda-1ce1ff033efabfc9ad6b731adc51fa6ab06068e4.tar.gz anaconda-1ce1ff033efabfc9ad6b731adc51fa6ab06068e4.tar.xz anaconda-1ce1ff033efabfc9ad6b731adc51fa6ab06068e4.zip |
Expose common fsset methods and properties in class Storage.
Add the following methods and properties to class Storage which map
through to FSSet methods, modify existing calls to use the method on
class Storage:
turnOnSwap()
mountFilesystems()
umountFilesystems()
parseFSTab()
mkDevRoot()
createSwapFile()
fsFreeSpace()
mtab
mountpoints
migratableDevices
rootDevice
Callers no longer need to pass the Anaconda object to the FSSet methods
directly. The method on Storage takes care of that.
The mtab() method on FSSet is exposed as a property on Storage. The
same is true for fsFreeSpace().
Diffstat (limited to 'booty')
-rw-r--r-- | booty/alpha.py | 4 | ||||
-rw-r--r-- | booty/bootloaderInfo.py | 10 | ||||
-rw-r--r-- | booty/ppc.py | 10 | ||||
-rw-r--r-- | booty/s390.py | 4 | ||||
-rw-r--r-- | booty/sparc.py | 6 | ||||
-rw-r--r-- | booty/x86.py | 10 |
6 files changed, 22 insertions, 22 deletions
diff --git a/booty/alpha.py b/booty/alpha.py index afdb476f6..c4a3360d9 100644 --- a/booty/alpha.py +++ b/booty/alpha.py @@ -18,9 +18,9 @@ class alphaBootloaderInfo(bootloaderInfo): def writeAboot(self, instRoot, bl, kernelList, chainList, defaultDev, justConfig): - rootDevice = self.storage.fsset.rootDevice + rootDevice = self.storage.rootDevice try: - bootDevice = self.storage.fsset.mountpoints["/boot"] + bootDevice = self.storage.mountpoints["/boot"] except KeyError: bootDevice = rootDevice diff --git a/booty/bootloaderInfo.py b/booty/bootloaderInfo.py index e7cd5e3f5..b2725ab31 100644 --- a/booty/bootloaderInfo.py +++ b/booty/bootloaderInfo.py @@ -88,7 +88,7 @@ class KernelArguments: def get(self): args = self.args - root = self.id.storage.fsset.rootDevice + root = self.id.storage.rootDevice for d in self.id.storage.devices: if root.dependsOn(d): dracutSetupString = d.dracutSetupString() @@ -210,7 +210,7 @@ class BootImages: self.images[dev.name] = (None, None, type) if not self.images.has_key(self.default): - self.default = storage.fsset.rootDevice.name + self.default = storage.rootDevice.name (label, longlabel, type) = self.images[self.default] if not label: self.images[self.default] = ("linux", productName, type) @@ -249,7 +249,7 @@ class BootImages: # questionable for same reason as above, but on mac this time retval.append((part, type)) - rootDevice = storage.fsset.rootDevice + rootDevice = storage.rootDevice if not rootDevice or not rootDevice.format: raise ValueError, ("Trying to pick boot devices but do not have a " @@ -343,7 +343,7 @@ class bootloaderInfo: lilo.addEntry("prompt", replace = 0) lilo.addEntry("timeout", self.timeout or "20", replace = 0) - rootDev = self.storage.fsset.rootDevice + rootDev = self.storage.rootDevice if rootDev.name == defaultDev.name: lilo.addEntry("default", kernelList[0][0]) @@ -590,7 +590,7 @@ class efiBootloaderInfo(bootloaderInfo): def addNewEfiEntry(self, instRoot): try: - bootdev = self.storage.fsset.mountpoints["/boot/efi"].name + bootdev = self.storage.mountpoints["/boot/efi"].name except: bootdev = "sda1" diff --git a/booty/ppc.py b/booty/ppc.py index aa4d8dc83..9e4309013 100644 --- a/booty/ppc.py +++ b/booty/ppc.py @@ -26,10 +26,10 @@ class ppcBootloaderInfo(bootloaderInfo): # Try to get a boot device; bplan OF understands ext3 if machine == 'Pegasos' or machine == 'Efika': try: - device = self.storage.fsset.mountpoints["/boot"] + device = self.storage.mountpoints["/boot"] except KeyError: # Try / if we don't have this we're not going to work - device = self.storage.fsset.rootDevice + device = self.storage.rootDevice retval.append(device.path) else: @@ -45,14 +45,14 @@ class ppcBootloaderInfo(bootloaderInfo): yabootTarget = string.join(self.getBootDevs(bl)) try: - bootDev = self.storage.fsset.mountpoints["/boot"] + bootDev = self.storage.mountpoints["/boot"] cf = "/boot/etc/yaboot.conf" cfPath = "" if not os.path.isdir(instRoot + "/boot/etc"): os.mkdir(instRoot + "/boot/etc") except KeyError: - bootDev = self.storage.fsset.rootDevice + bootDev = self.storage.rootDevice cfPath = "/boot" cf = "/etc/yaboot.conf" @@ -101,7 +101,7 @@ class ppcBootloaderInfo(bootloaderInfo): f.write("\n") - rootDev = self.storage.fsset.rootDevice + rootDev = self.storage.rootDevice for (label, longlabel, version) in kernelList: kernelTag = "-" + version diff --git a/booty/s390.py b/booty/s390.py index a60811d09..39a57d406 100644 --- a/booty/s390.py +++ b/booty/s390.py @@ -25,7 +25,7 @@ class s390BootloaderInfo(bootloaderInfo): if not os.access(instRoot + sl.getPath(), os.R_OK): lilo.delImage(label) - rootDev = self.storage.fsset.rootDevice + rootDev = self.storage.rootDevice if rootDev.name == defaultDev.name: lilo.addEntry("default", kernelList[0][0]) @@ -117,7 +117,7 @@ class s390BootloaderInfo(bootloaderInfo): def writeZipl(self, instRoot, bl, kernelList, chainList, defaultDev, justConfigFile): - rootDev = self.storage.fsset.rootDevice + rootDev = self.storage.rootDevice cf = '/etc/zipl.conf' self.perms = 0600 diff --git a/booty/sparc.py b/booty/sparc.py index 45d58c4e1..22c4ab8b7 100644 --- a/booty/sparc.py +++ b/booty/sparc.py @@ -8,7 +8,7 @@ class sparcBootloaderInfo(bootloaderInfo): chainList, defaultDev, justConfigFile): try: - bootDev = self.storage.fsset.mountpoints["/boot"] + bootDev = self.storage.mountpoints["/boot"] mf = '/silo.message' cf = "/boot/silo.conf" @@ -17,7 +17,7 @@ class sparcBootloaderInfo(bootloaderInfo): if not os.path.isdir(instRoot + "/boot"): os.mkdir(instRoot + "/boot") except KeyError: - bootDev = self.storage.fsset.rootDevice + bootDev = self.storage.rootDevice cf = "/etc/silo.conf" mfdir = '/etc' @@ -46,7 +46,7 @@ class sparcBootloaderInfo(bootloaderInfo): f.write("default=%s\n" % (kernelList[0][0],)) f.write("\n") - rootDev = self.storage.fsset.rootDevice + rootDev = self.storage.rootDevice for (label, longlabel, version) in kernelList: kernelTag = "-" + version diff --git a/booty/x86.py b/booty/x86.py index 5e02f3d67..d6a7cc264 100644 --- a/booty/x86.py +++ b/booty/x86.py @@ -134,7 +134,7 @@ class x86BootloaderInfo(efiBootloaderInfo): def writeGrub(self, instRoot, bl, kernelList, chainList, defaultDev, justConfigFile): - rootDev = self.storage.fsset.rootDevice + rootDev = self.storage.rootDevice # XXX old config file should be read here for upgrade @@ -166,7 +166,7 @@ class x86BootloaderInfo(efiBootloaderInfo): "after making changes to this file\n") try: - bootDev = self.storage.fsset.mountpoints["/boot"] + bootDev = self.storage.mountpoints["/boot"] grubPath = "/grub" cfPath = "/" f.write("# NOTICE: You have a /boot partition. This means " @@ -174,7 +174,7 @@ class x86BootloaderInfo(efiBootloaderInfo): f.write("# all kernel and initrd paths are relative " "to /boot/, eg.\n") except KeyError: - bootDev = self.storage.fsset.rootDevice + bootDev = self.storage.rootDevice grubPath = "/boot/grub" cfPath = "/boot/" f.write("# NOTICE: You do not have a /boot partition. " @@ -482,11 +482,11 @@ class x86BootloaderInfo(efiBootloaderInfo): # so we have to do shenanigans to get updated grub installed... # steal some more code above try: - bootDev = self.storage.fsset.mountpoints["/boot"].name + bootDev = self.storage.mountpoints["/boot"].name grubPath = "/grub" cfPath = "/" except KeyError: - bootDev = self.storage.fsset.rootDevice.name + bootDev = self.storage.rootDevice.name grubPath = "/boot/grub" cfPath = "/boot/" |