summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2005-11-15 17:12:54 +0000
committerJeremy Katz <katzj@redhat.com>2005-11-15 17:12:54 +0000
commitce9dfb504e2622754fa40c3dfe730e4604302275 (patch)
tree89e236a41c0408891aa4cbb941fb91e8ed0e8d02 /iutil.py
parent2e807cd5ad3dc16b30c21b0d316098d01b0b3218 (diff)
downloadanaconda-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.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/iutil.py b/iutil.py
index 051e3abe8..7aa180119 100644
--- a/iutil.py
+++ b/iutil.py
@@ -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