Module changed names.
[bootcd.git] / conf_files / pl_hwinit
index 98b5590..225d48b 100755 (executable)
@@ -1,14 +1,20 @@
 #!/usr/bin/python
 
 import sys
-import pypciscan
+import pypci
 import pypcimap
 import os
 import time
 
-def modprobe(module):
-    ret = os.system("/sbin/modprobe %s" % module)
-    return os.WEXITSTATUS(ret) == 0
+loadedmodules = None
+
+def modprobe(module, args = ""):
+    ret = os.system("/sbin/modprobe %s %s" % (module, args))
+    if os.WEXITSTATUS(ret) == 0:
+        globals()['loadedmodules'].write("%s\n" % module)
+        return True
+    else:
+        return False
 
 def main(argv):
     if len(argv) == 0:
@@ -23,10 +29,11 @@ def main(argv):
 
     pcimap = pypcimap.PCIMap(path)
     print "pl_hwinit: loading applicable modules"
-    devices = pypciscan.get_devices()
+    devices = pypci.get_devices()
     storage_devices = 0
     network_devices = 0
     missing = []
+    globals()['loadedmodules'] = file('/tmp/loadedmodules', 'w')
     for (slot, dev) in devices.iteritems():
         modules = pcimap.get(dev)
         base = (dev[4] & 0xff0000) >> 16
@@ -61,7 +68,7 @@ def main(argv):
     modprobe("usb_storage")
 
     print "pl_hwinit: loading floppy device driver"
-    modprobe("floppy")
+    modprobe("floppy","floppy=0,allowed_drive_mask")
 
     # always wait a bit between loading the usb drivers, and checking /sys/
     # for usb devices (this isn't necessarily for waiting for mass storage files,