X-Git-Url: http://git.onelab.eu/?p=bootcd.git;a=blobdiff_plain;f=initscripts%2Fpl_hwinit;h=16763c0e49a51cf8ec939a226f0b7c88b20bb56a;hp=7cddccb117394a7d2bfa11140ce5cdfe69408c88;hb=7428db3606354833b77f2ed33d928f7ac804011f;hpb=c2127494a9b277ddb164ff04a79c1724a3e3ae2e diff --git a/initscripts/pl_hwinit b/initscripts/pl_hwinit index 7cddccb..16763c0 100755 --- a/initscripts/pl_hwinit +++ b/initscripts/pl_hwinit @@ -1,5 +1,7 @@ #!/usr/bin/python +# xxx could use a port to python3.. + import sys import pypci import pypcimap @@ -64,30 +66,30 @@ def main(argv): storage_devices += 1 elif base == 0x02: network_devices += 1 - + # FIXME: This needs improved logic in the case of multiple matching modules for module in modules: if module not in blacklisted_modules: verbose_message("pl_hwinit: found and loading module {} (%s)" % (module, slot)) modprobe(module, loadedmodules) - + if network_devices == 0: verbose_message("pl_hwinit: no supported network devices found!") verbose_message("pl_hwinit: the following devices were found, but have no driver:") lines = [ "{} x {}".format(slot, dev) for slot, dev in missing ] for line in lines: verbose_message("pl_hwinit: missing " + line) - + # XXX: could check for storage devices too, but older kernels have a lot of that built-in - + # sd_mod won't get loaded automatically verbose_message("pl_hwinit: loading sd_mod") modprobe("sd_mod", loadedmodules) - + # load usb_storage to support node conf files on flash disks verbose_message("pl_hwinit: loading usb_storage") modprobe("usb_storage", loadedmodules) - + verbose_message("pl_hwinit: loading floppy device driver") modprobe("floppy", loadedmodules, "floppy=0,allowed_drive_mask") @@ -104,7 +106,7 @@ def main(argv): # the way this will be done is to look for files in /sys/devices that are named # 'bInterfaceClass', these will be a list of the usb devices on the system, and - # their primary usb device interface class ids. The base directory these files + # their primary usb device interface class ids. The base directory these files # exist in will be the full path to the /sys/device entry for that device. # for each mass storage devices (they have an interface class value of 08), # we wait for a new symbolic link named 'driver' to exist in that directory, @@ -140,7 +142,7 @@ def main(argv): total_wait_time = 0 success = False - while total_wait_time < MAX_USB_WAIT_TIME: + while total_wait_time < MAX_USB_WAIT_TIME: total_wait_time += PER_CHECK_USB_WAIT_TIME verbose_message("pl_hwinit: waiting {} seconds.".format(PER_CHECK_USB_WAIT_TIME))