From 6f0b4528394dc949c0f064d2efb732bda3de7e74 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 25 Feb 2010 15:24:43 -0600 Subject: 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. --- iutil.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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(): -- cgit