summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2007-04-17 21:03:10 +0000
committerJeremy Katz <katzj@redhat.com>2007-04-17 21:03:10 +0000
commitc68dc01f32d4f9aa4913e31c19e90a187680c777 (patch)
tree891e6b4d25490b44739d6820daa9e8b674400dc0 /iw
parentff7254b990c90765448bf0bc33eab997e2b026b9 (diff)
downloadanaconda-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.
Diffstat (limited to 'iw')
-rw-r--r--iw/upgrade_bootloader_gui.py21
1 files changed, 16 insertions, 5 deletions
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