FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Kubuntu Development

 
 
LinkBack Thread Tools
 
Old 02-26-2010, 02:05 AM
Dennis Gilmore
 
Default add function to get the sparc system type

---
iutil.py | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/iutil.py b/iutil.py
index 3422009..def8db6 100644
--- a/iutil.py
+++ b/iutil.py
@@ -467,6 +467,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():
--
1.7.0

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-26-2010, 09:59 PM
Dennis Gilmore
 
Default add function to get the sparc system type

---
iutil.py | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/iutil.py b/iutil.py
index 872915d..e275130 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():
--
1.7.0

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:41 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org