use build/build.common to use common build operations
[bootmanager.git] / source / merge_hw_tables.py
index 904847c..dfe3378 100755 (executable)
@@ -1,4 +1,11 @@
-#!/usr/bin/env python
+#!/usr/bin/python2
+
+# Copyright (c) 2003 Intel Corporation
+# All rights reserved.
+#
+# Copyright (c) 2004-2006 The Trustees of Princeton University
+# All rights reserved.
+
 
 """
 The point of this small utility is to take a file in the format
@@ -43,6 +50,7 @@ cciss 0e11:b060 0e11:b178
 
 import os, sys
 import string
+import StringIO
 
 PCI_ANY = 0xffffffffL
 
@@ -72,7 +80,7 @@ def merge_files(modules_dep_path, modules_pcimap_path, pcitable_path):
     except IOError:
         sys.stderr.write( "Unable to open pcitable: %s\n" %
                           pcitable_path )
-        return
+       pcitable_file=StringIO.StringIO()
 
     # associative array to store all matches of module -> ['vendor:device',..]
     # entries
@@ -117,6 +125,11 @@ def merge_files(modules_dep_path, modules_pcimap_path, pcitable_path):
         # first two parts are always vendor / device id
         module= line_parts[0]
 
+        # XXX In kernel versions <2.6.14, mptscsih is the actual
+        # module that should be loaded instead of mptbase.
+        if module == "mptbase":
+            module= "mptscsih"
+
         try:
             vendor_id= long(line_parts[1],16)
         except ValueError, e: