Posted By

Juanje on 05/08/08


Tagged

linux MODULES hardware kernel


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

alexxx


Get the linux modules for our pci devices


 / Published in: Bash
 

  1. # search modules for pci devices
  2. get_pci_modules () {
  3. while read IGNORE ID IGNORE
  4. do
  5. VENDOR=`echo $ID | cut -b1-4`
  6. DEVICE=`echo $ID | cut -b5-8`
  7. DEVENTRY=`echo 0x0000${VENDOR} 0x0000${DEVICE}`
  8. cat /lib/modules/`uname -r`/*.pcimap | grep "$DEVENTRY" | cut -d ' ' -f1
  9. done
  10. }
  11.  
  12. for MODULE in `get_pci_modules < /proc/bus/pci/devices | sort -u` ; do
  13. echo $MODULE
  14. done

Report this snippet  

You need to login to post a comment.