Tagging module BootManager - BootManager-3.2-20
[bootmanager.git] / source / systeminfo.py
index ba77629..973c817 100755 (executable)
@@ -26,8 +26,7 @@ import popen2
 import re
 import errno
 import ModelOptions
-import pypciscan
-import pypcimap
+from pypci import *
 from Exceptions import *
 
 """
@@ -47,9 +46,6 @@ DEVICES_SCANNED_FLAG= "/tmp/devices_scanned"
 BLOCKS_PER_GB = pow(10, 9) / 1024.0;
 
 
-# -n is numeric ids (no lookup), -m is machine readable
-LSPCI_CMD= "/sbin/lspci -nm"
-
 MODULE_CLASS_NETWORK= "network"
 MODULE_CLASS_SCSI= "scsi"
 
@@ -280,9 +276,12 @@ def get_system_modules( vars = {}, log = sys.stderr):
     scsi_mods= []
 
     # XXX: this is really similar to what BootCD/conf_files/pl_hwinit does. merge?
-    pcidevs = pypciscan.get_devices()
+    pcidevs = get_devices()
 
-    for (slot, dev) in pcidevs.iteritems():
+    devlist=pcidevs.keys()
+    devlist.sort()
+    for slot in devlist:
+        dev = pcidevs[slot]
         base = (dev[4] & 0xff0000) >> 16
         if base not in (PCI_BASE_CLASS_STORAGE,
                         PCI_BASE_CLASS_NETWORK):
@@ -291,18 +290,9 @@ def get_system_modules( vars = {}, log = sys.stderr):
         modules = pcimap.get(dev)
         if len(modules) > 0:
             if base == PCI_BASE_CLASS_NETWORK:
-                network_mods.append(modules[0])
+                network_mods += modules
             elif base == PCI_BASE_CLASS_STORAGE:
-                scsi_mods.append(modules[0])
-
-                # XXX ata_piix and ahci both claim 8086:2652 and 8086:2653,
-                # and it is usually a non-visible BIOS option that decides
-                # which is appropriate. Just load both.
-                if dev[0] == 0x8086 and (dev[1] == 0x2652 or dev[1] == 0x2653):
-                    if modules[0] == "ahci":
-                        scsi_mods.append("ata_piix")
-                    elif modules[0] == "ata_piix":
-                        scsi_mods.append("ahci")
+                scsi_mods += modules
 
     system_mods[MODULE_CLASS_SCSI]= scsi_mods
     system_mods[MODULE_CLASS_NETWORK]= network_mods