http://web.archive.org/web/20070808163738/http://blog.miraclelinux.com/mita/2006/04/linux__f408.html
ほほー
デバイスIDを一緒に表示するように改造。
$ cat ls-pci-mod-0.1.sh #!/bin/bash DB=/lib/modules/`uname -r`/modules.pcimap if [ -n "$1" ]; then DB=$1; fi find_mod() { vendor=$1 device=$2 cat $DB | \ awk "{if (\$2 ~ /^$vendor$/ && \$3 ~ /^$device$/) { printf \"%s \", \$1 } }" } lspci -n | tr ':' ' ' | awk '{printf "0x%08s 0x%08s\n", $5, $6}' | \ while read vd ; do echo -n $vd "";find_mod $vd;echo ; done
実行例
$ sh ls-pci-mod-0.1.sh 0x00008086 0x00007122 intel-agp 0x00008086 0x00007123 0x00008086 0x00002418 hw_random 0x00008086 0x00002410 i8xx_tco 0x00008086 0x00002411 piix 0x00008086 0x00002412 0x00008086 0x00002413 0x000013f6 0x00000111 cmpci snd-cmipci 0x00001033 0x00000035 0x00001033 0x00000035 0x00001033 0x000000e0 0x000010b7 0x00009200 3c59x
awkが分からんのでイマイチだが、良しとする。