diff options
author | Jeremy Katz <katzj@redhat.com> | 2007-04-17 21:03:10 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2007-04-17 21:03:10 +0000 |
commit | c68dc01f32d4f9aa4913e31c19e90a187680c777 (patch) | |
tree | 891e6b4d25490b44739d6820daa9e8b674400dc0 | |
parent | ff7254b990c90765448bf0bc33eab997e2b026b9 (diff) | |
download | anaconda-c68dc01f32d4f9aa4913e31c19e90a187680c777.tar.gz anaconda-c68dc01f32d4f9aa4913e31c19e90a187680c777.tar.xz anaconda-c68dc01f32d4f9aa4913e31c19e90a187680c777.zip |
2007-04-17 Jeremy Katz <katzj@redhat.com>
* iw/upgrade_bootloader_gui.py
(UpgradeBootloaderWindow._newToLibata): Ensure that we've actually
switched to using libata for something
* textw/upgrade_bootloader_text.py: And do the checks in text-mode too.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | iw/upgrade_bootloader_gui.py | 21 | ||||
-rw-r--r-- | textw/upgrade_bootloader_text.py | 48 |
3 files changed, 61 insertions, 15 deletions
@@ -1,3 +1,10 @@ +2007-04-17 Jeremy Katz <katzj@redhat.com> + + * iw/upgrade_bootloader_gui.py + (UpgradeBootloaderWindow._newToLibata): Ensure that we've actually + switched to using libata for something + * textw/upgrade_bootloader_text.py: And do the checks in text-mode too. + 2007-04-17 David Cantrell <dcantrell@redhat.com> * network.py (Network.write): Do not write out NETWORKING_IPV6 line diff --git a/iw/upgrade_bootloader_gui.py b/iw/upgrade_bootloader_gui.py index ef3a21141..d4a5d8984 100644 --- a/iw/upgrade_bootloader_gui.py +++ b/iw/upgrade_bootloader_gui.py @@ -54,10 +54,21 @@ class UpgradeBootloaderWindow (InstallWindow): self.bl.useGrubVal = 0 self.bl.setDevice(self.bootDev) - def _usedLibataPreviously(self, rootPath): + def _newToLibata(self, rootPath): + # NOTE: any changes here need to be done in upgrade_bootloader_text too + try: + f = open("/proc/modules", "r") + buf = f.read() + if buf.find("libata") == -1: + return False + except: + log.debug("error reading /proc/modules") + pass + try: f = open(rootPath + "/etc/modprobe.conf") except: + log.debug("error reading /etc/modprobe.conf") return False lines = f.readlines() @@ -67,7 +78,7 @@ class UpgradeBootloaderWindow (InstallWindow): if l.strip()[0] == "#": continue - if l.find("scsi_hostadapter") != -1: + if l.find("scsi_hostadapter") == -1: return True return False @@ -76,7 +87,7 @@ class UpgradeBootloaderWindow (InstallWindow): self.dispatch = anaconda.dispatch self.bl = anaconda.id.bootloader - usedLibata = self._usedLibataPreviously(anaconda.rootPath) + newToLibata = self._newToLibata(anaconda.rootPath) (self.type, self.bootDev) = \ checkbootloader.getBootloaderTypeAndBoot(anaconda.rootPath) @@ -84,7 +95,7 @@ class UpgradeBootloaderWindow (InstallWindow): self.update_radio = gtk.RadioButton(None, _("_Update boot loader configuration")) updatestr = _("This will update your current boot loader.") - if not usedLibata or (self.type is None or self.bootDev is None): + if newToLibata or (self.type is None or self.bootDev is None): current = _("The installer is unable to detect the boot loader " "currently in use on your system.") self.update_label = gtk.Label("%s" % (updatestr,)) @@ -127,7 +138,7 @@ class UpgradeBootloaderWindow (InstallWindow): # default is to not touch anything if update == 1: default = self.update_radio - elif not usedLibata: + elif newToLibata: default = self.newbl_radio else: default = self.nobl_radio diff --git a/textw/upgrade_bootloader_text.py b/textw/upgrade_bootloader_text.py index 53f4c88ff..5ebc50643 100644 --- a/textw/upgrade_bootloader_text.py +++ b/textw/upgrade_bootloader_text.py @@ -23,11 +23,39 @@ import iutil import checkbootloader class UpgradeBootloaderWindow: + def _ideToLibata(self, rootPath): + try: + f = open("/proc/modules", "r") + buf = f.read() + if buf.find("libata") == -1: + return False + except: + log.debug("error reading /proc/modules") + pass + + try: + f = open(rootPath + "/etc/modprobe.conf") + except: + log.debug("error reading /etc/modprobe.conf") + return False + + lines = f.readlines() + f.close() + + for l in lines: + if l.strip()[0] == "#": + continue + + if l.find("scsi_hostadapter") != -1: + return True + + return False def __call__(self, screen, anaconda): self.dispatch = anaconda.dispatch self.bl = anaconda.id.bootloader + newToLibata = self._ideToLibata(anaconda.rootPath) (self.type, self.bootDev) = \ checkbootloader.getBootloaderTypeAndBoot(anaconda.rootPath) @@ -39,27 +67,27 @@ class UpgradeBootloaderWindow: elif self.dispatch.stepInSkipList("instbootloader"): nobl = 1 else: - if self.type is not None and self.bootDev is not None: - update = 1 + if newToLibata or self.type is None or self.bootDev is None: + newbl = 1 else: - nobl = 1 + update = 1 - if self.type is not None and self.bootDev is not None: + if newToLibata or self.type is None or self.bootDev is None: t = TextboxReflowed(53, - _("The installer has detected the %s boot " - "loader currently installed on %s.") - % (self.type, self.bootDev)) + _("The installer is unable to detect the boot loader " + "currently in use on your system.")) self.update_radio = blradio.add(_("Update boot loader configuration"), "update", update) + self.update_radio.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET) else: t = TextboxReflowed(53, - _("The installer is unable to detect the boot loader " - "currently in use on your system.")) + _("The installer has detected the %s boot " + "loader currently installed on %s.") + % (self.type, self.bootDev)) self.update_radio = blradio.add(_("Update boot loader configuration"), "update", update) - self.update_radio.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET) self.nobl_radio = blradio.add(_("Skip boot loader updating"), "nobl", nobl) |