3 pci_table=/etc/pl_pcitable
5 loaded_module_list=/tmp/loadedmodules
7 echo "pl_hwinit: loading applicable modules"
9 echo > $loaded_module_list
11 # this will contain lines of device_id:vendor_id (no 0x)
12 system_devices=$(lspci -n | cut -d " " -f4)
14 for device in $system_devices; do
16 # now vendor_id and device_id are broken apart
17 vendor_id=$(echo $device | cut -d ":" -f1)
18 device_id=$(echo $device | cut -d ":" -f2)
20 # either exactly match vendor:device, or a vendor:ffff (let the module
21 # figure out if it can be used for this device), or ffff:device
22 # (not sure if this is legal, but shows up in the pci map)
23 mods=$(grep -i "\($vendor_id:ffff\|$vendor_id:$device_id\|ffff:$device_id\)" \
24 $pci_table | cut -d " " -f1)
26 for module in $mods; do
27 if [ -n "$module" ]; then
28 echo "pl_hwinit: found and loading module $module"
29 /sbin/modprobe $module
30 echo $module >> $loaded_module_list
35 # just in case, look for any modules that are ffff:ffff and load them
36 mods=$(grep -i "ffff:ffff" $pci_table | cut -d " " -f1)
37 for module in $mods; do
38 if [ -n "$module" ]; then
39 echo "pl_hwinit: found and loading wild module $module"
40 /sbin/modprobe $module
44 # sd_mod won't get loaded automatically
45 echo "pl_hwinit: loading sd_mod"
48 echo "pl_hwinit: loading floppy device driver"