summaryrefslogtreecommitdiffstats
path: root/textw/upgrade_bootloader_text.py
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 /textw/upgrade_bootloader_text.py
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 'textw/upgrade_bootloader_text.py')
-rw-r--r--textw/upgrade_bootloader_text.py48
1 files changed, 38 insertions, 10 deletions
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)