diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-05-07 00:14:42 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-05-07 00:14:42 +0000 |
commit | b5c7e1307f40563a6f78a47d3af29d4407e5ea3d (patch) | |
tree | 7da70c11f7fd4ab4bc0747bbd1329338c7eb9dc7 | |
parent | bea3a58a0c1325334861303210ab6da73cd9f4c5 (diff) | |
download | anaconda-b5c7e1307f40563a6f78a47d3af29d4407e5ea3d.tar.gz anaconda-b5c7e1307f40563a6f78a47d3af29d4407e5ea3d.tar.xz anaconda-b5c7e1307f40563a6f78a47d3af29d4407e5ea3d.zip |
make the bootloader choices thing actually use the bootloader device order
so that we can do things like avoid saying the mbr is on a removable device.
abstract out part of the fsset.bootloaderChoices logic so that it can
be used without the bootloader object as needed
-rw-r--r-- | bootloader.py | 2 | ||||
-rw-r--r-- | fsset.py | 21 | ||||
-rw-r--r-- | iw/bootloader_gui.py | 2 | ||||
-rw-r--r-- | textw/bootloader_text.py | 2 |
4 files changed, 16 insertions, 11 deletions
diff --git a/bootloader.py b/bootloader.py index 8cd6cba22..750d30fd1 100644 --- a/bootloader.py +++ b/bootloader.py @@ -44,7 +44,7 @@ def bootloaderSetupChoices(dispatch, bl, fsset, diskSet, dir): dispatch.skipStep("instbootloader") return - choices = fsset.bootloaderChoices(diskSet) + choices = fsset.bootloaderChoices(diskSet, bl) if not choices: dispatch.skipStep("instbootloader") else: @@ -906,10 +906,9 @@ class FileSystemSet: return 1 return 0 - def bootloaderChoices(self, diskSet): + # return the "boot" devicce + def getBootDev(self): mntDict = {} - ret = {} - for entry in self.entries: mntDict[entry.mountpoint] = entry.device @@ -919,6 +918,12 @@ class FileSystemSet: bootDev = mntDict['/boot'] else: bootDev = mntDict['/'] + + return bootDev + + def bootloaderChoices(self, diskSet, bl): + ret = {} + bootDev = self.getBootDev() if bootDev.getName() == "LoopbackDevice": return ret @@ -927,18 +932,18 @@ class FileSystemSet: return ret ret['boot'] = (bootDev.device, N_("First sector of boot partition")) - ret['mbr'] = (bootDev.device, N_("Master Boot Record (MBR)")) + ret['mbr'] = (bl.drivelist[0], N_("Master Boot Record (MBR)")) return ret # set active partition on disks # if an active partition is set, leave it alone; if none set # set either our boot partition or the first partition on the drive active def setActive(self, diskset): - choices = self.bootloaderChoices(diskset) - if not choices: - bootDev = None + dev = self.getBootDev() + if dev.getName() != "LoopbackDevice": + bootDev = dev.device else: - bootDev = choices['boot'][0] + bootDev = None # stupid itanium if iutil.getArch() == "ia64": diff --git a/iw/bootloader_gui.py b/iw/bootloader_gui.py index 5c149a5c2..eb61793ac 100644 --- a/iw/bootloader_gui.py +++ b/iw/bootloader_gui.py @@ -831,7 +831,7 @@ class AdvancedBootloaderWindow (InstallWindow): # XXX switch over to real and not debug crap # choices = { 'mbr': ("hda", "MBR"), 'boot': ("hda2", "/boot") } - choices = fsset.bootloaderChoices(diskSet) + choices = fsset.bootloaderChoices(diskSet, self.bl) self.bootDevices = {} if choices: diff --git a/textw/bootloader_text.py b/textw/bootloader_text.py index c4a483d7f..d1f47dd21 100644 --- a/textw/bootloader_text.py +++ b/textw/bootloader_text.py @@ -153,7 +153,7 @@ class BootloaderLocationWindow: def __call__(self, screen, dispatch, bl, fsset, diskSet): if dispatch.stepInSkipList("instbootloader"): return INSTALL_NOOP - choices = fsset.bootloaderChoices(diskSet) + choices = fsset.bootloaderChoices(diskSet, bl) if len(choices.keys()) == 1: bl.setDevice(choices[choices.keys()[0]][0]) return INSTALL_NOOP |