This is a tiny patch with makes autotest base_util works with arm based
ubuntu linux, and hopefully, chromeos in the near future.

Index: client/bin/base_utils.py
===================================================================
--- client/bin/base_utils.py (revision 4265)
+++ client/bin/base_utils.py (working copy)
@@ -293,6 +293,8 @@
         return 'power7'
     elif list_grep(cpuinfo, '^cpu.*PPC970'):
         return 'power970'
+    elif list_grep(cpuinfo, 'ARM'):
+        return 'arm'
     elif list_grep(cpuinfo, '^flags.*:.* lm .*'):
         return 'x86_64'
     else:
@@ -317,7 +319,7 @@
     f = file('/proc/cpuinfo', 'r')
     cpus = 0
     for line in f.readlines():
-        if line.startswith('processor'):
+        if line.lower().startswith('processor'):
             cpus += 1
     return cpus

The reason for this change is arm ubuntu /proc/cpuinfo will return upper
case 'Processor' instead of 'processor'.


Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 797.90
Features : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc08
CPU revision : 2

Hardware : voguesv210
Revision : 0000
Serial : 0000000000000000


-- 
Eric Li
李咏竹
Google Kirkland
Index: client/bin/base_utils.py
===================================================================
--- client/bin/base_utils.py    (revision 4265)
+++ client/bin/base_utils.py    (working copy)
@@ -293,6 +293,8 @@
         return 'power7'
     elif list_grep(cpuinfo, '^cpu.*PPC970'):
         return 'power970'
+    elif list_grep(cpuinfo, 'ARM'):
+        return 'arm'
     elif list_grep(cpuinfo, '^flags.*:.* lm .*'):
         return 'x86_64'
     else:
@@ -317,7 +319,7 @@
     f = file('/proc/cpuinfo', 'r')
     cpus = 0
     for line in f.readlines():
-        if line.startswith('processor'):
+        if line.lower().startswith('processor'):
             cpus += 1
     return cpus
 
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to