summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Gilmore <dennis@ausil.us>2010-02-25 15:24:43 -0600
committerDennis Gilmore <dennis@ausil.us>2010-03-05 15:25:22 -0600
commit6f0b4528394dc949c0f064d2efb732bda3de7e74 (patch)
treea789ce00c36bfd524bb920baaa104453b85708ab
parent2364d9ba4e110da400e24b3a14760cca93e38e04 (diff)
downloadanaconda-6f0b4528394dc949c0f064d2efb732bda3de7e74.tar.gz
anaconda-6f0b4528394dc949c0f064d2efb732bda3de7e74.tar.xz
anaconda-6f0b4528394dc949c0f064d2efb732bda3de7e74.zip
add function to get the sparc system type
depending on the type of SPARC machine we are running on we need to pass different flags to silo. include a function to determine what machine we are running on.
-rw-r--r--iutil.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/iutil.py b/iutil.py
index 872915dff..e2751307c 100644
--- a/iutil.py
+++ b/iutil.py
@@ -496,6 +496,25 @@ def copyDeviceNode(src, dest):
os.mknod(dest, mode | type, filestat.st_rdev)
+## Get the SPARC machine variety type.
+# @return The SPARC machine type, or 0 if not SPARC.
+def getSparcMachine():
+ if not isSPARC():
+ return 0
+
+ machine = None
+
+
+ f = open('/proc/cpuinfo', 'r')
+ lines = f.readlines()
+ f.close()
+ for line in lines:
+ if line.find('type') != -1:
+ machine = line.split(':')[1].strip()
+ return machine
+
+ return None
+
## Get the PPC machine variety type.
# @return The PPC machine type, or 0 if not PPC.
def getPPCMachine():