diff options
author | David Lehman <dlehman@redhat.com> | 2009-02-23 12:21:24 -0600 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-02-23 12:21:24 -0600 |
commit | e1a7fe9887886044b07587b3ec2caa2ff53ebfb2 (patch) | |
tree | 447c0c31e503a74f9247d36c2947d8a483f68836 /bootloader.py | |
parent | 715e529c7ae2742ff57f7b9eba055e92e8077d82 (diff) | |
download | anaconda-e1a7fe9887886044b07587b3ec2caa2ff53ebfb2.tar.gz anaconda-e1a7fe9887886044b07587b3ec2caa2ff53ebfb2.tar.xz anaconda-e1a7fe9887886044b07587b3ec2caa2ff53ebfb2.zip |
Updates to make existing code use the new storage module.
Diffstat (limited to 'bootloader.py')
-rw-r--r-- | bootloader.py | 51 |
1 files changed, 18 insertions, 33 deletions
diff --git a/bootloader.py b/bootloader.py index b78cfd701..7ad11b4d5 100644 --- a/bootloader.py +++ b/bootloader.py @@ -60,49 +60,36 @@ def bootloaderSetupChoices(anaconda): anaconda.id.bootloader.updateDriveList(pref) if iutil.isEfi() and not anaconda.id.bootloader.device: - drives = anaconda.id.diskset.disks.keys() - drives.sort() bootPart = None - for drive in drives: - disk = anaconda.id.diskset.disks[drive] - for part in disk.partitions: - if part.active and partedUtils.isEfiSystemPartition(part): - bootPart = part.getDeviceNodeName() + partitions = anaconda.id.storage.partitions + for part in partitions: + if part.partedPartition.active and \ + partedUtils.isEfiSystemPartition(part.partedPartition): + bootPart = part.name break - if bootPart: - break if bootPart: anaconda.id.bootloader.setDevice(bootPart) - dev = Device() - dev.device = bootPart - anaconda.id.fsset.add(FileSystemSetEntry(dev, None, fileSystemTypeGet("efi"))) # iSeries bootloader on upgrades if iutil.getPPCMachine() == "iSeries" and not anaconda.id.bootloader.device: - drives = anaconda.id.diskset.disks.keys() - drives.sort() bootPart = None - for drive in drives: - disk = anaconda.id.diskset.disks[drive] - for part in disk.partitions: - if part.active and part.getFlag(parted.PARTITION_PREP): - bootPart = part.getDeviceNodeName() - break - if bootPart: + partitions = anaconda.id.storage.partitions + for part in partitions: + if part.partedPartition.active and \ + part.partedPartition.getFlag(parted.PARTITION_PREP): + bootPart = part.name break if bootPart: anaconda.id.bootloader.setDevice(bootPart) - dev = Device() - dev.device = bootPart - anaconda.id.fsset.add(FileSystemSetEntry(dev, None, fileSystemTypeGet("PPC PReP Boot"))) - choices = anaconda.id.fsset.bootloaderChoices(anaconda.id.diskset, anaconda.id.bootloader) + choices = anaconda.id.storage.fsset.bootloaderChoices(anaconda.id.bootloader) if not choices and iutil.getPPCMachine() != "iSeries": anaconda.dispatch.skipStep("instbootloader") else: anaconda.dispatch.skipStep("instbootloader", skip = 0) - anaconda.id.bootloader.images.setup(anaconda.id.diskset, anaconda.id.fsset) + # FIXME: ... + anaconda.id.bootloader.images.setup(anaconda.id.storage) if anaconda.id.bootloader.defaultDevice != None and choices: keys = choices.keys() @@ -150,11 +137,7 @@ def writeBootloader(anaconda): kernelList = [] otherList = [] - root = anaconda.id.fsset.getEntryByMountPoint('/') - if root: - rootDev = root.device.getDevice() - else: - rootDev = None + rootDev = getattr(anaconda.id.rootDevice, "path", None) defaultDev = anaconda.id.bootloader.images.getDefault() kernelLabel = None @@ -204,8 +187,10 @@ def writeBootloader(anaconda): dosync() try: - anaconda.id.bootloader.write(anaconda.rootPath, anaconda.id.fsset, anaconda.id.bootloader, - anaconda.id.instLanguage, kernelList, otherList, defaultDev, + anaconda.id.bootloader.write(anaconda.rootPath, anaconda.id.storage, + anaconda.id.bootloader, + anaconda.id.instLanguage, + kernelList, otherList, defaultDev, justConfigFile, anaconda.intf) if not justConfigFile: w.pop() |