diff options
author | Jeremy Katz <katzj@redhat.com> | 2005-11-15 17:12:54 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2005-11-15 17:12:54 +0000 |
commit | ce9dfb504e2622754fa40c3dfe730e4604302275 (patch) | |
tree | 89e236a41c0408891aa4cbb941fb91e8ed0e8d02 /iutil.py | |
parent | 2e807cd5ad3dc16b30c21b0d316098d01b0b3218 (diff) | |
download | anaconda-ce9dfb504e2622754fa40c3dfe730e4604302275.tar.gz anaconda-ce9dfb504e2622754fa40c3dfe730e4604302275.tar.xz anaconda-ce9dfb504e2622754fa40c3dfe730e4604302275.zip |
2005-11-15 Jeremy Katz <katzj@redhat.com>
* yuminstall.py (YumBackend.getBestKernelByArch): Install smp
kernel if NX is present (#172345)
* iutil.py (hasNX): Add a method to find out if we have NX
Diffstat (limited to 'iutil.py')
-rw-r--r-- | iutil.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -653,6 +653,27 @@ def getPPCMacBook(): return 1 return 0 +def hasNX(): + """Convenience function to see if a machine supports the nx bit. We want + to install an smp kernel if NX is present since NX requires PAE (#173245)""" + if getArch() not in ("i386", "x86_64"): + return False + f = open("/proc/cpuinfo", "r") + lines = f.readlines() + f.close() + + for line in lines: + if not line.startswith("flags"): + continue + # get the actual flags + flags = line[:-1].split(":", 1)[1] + # and split them + flst = flags.split(" ") + if "nx" in flst: + return True + return False + + def writeRpmPlatform(root="/"): import rhpl.arch |