I briefly read the manual of lspci, where I found out that there is a machine-readable format lspci output using "-m" or "-mm" or "-vmm".
I need to print out the device name, the device id and the kernel module driver in use using the machine-readable format.
I tried this command:
$ lspci -vmm -v -nn -d 10de:0393
Slot: 01:00.0
Class: VGA compatible controller [0300]
Vendor: NVIDIA Corporation [10de]
Device: G73 [GeForce 7300 GT] [0393]
SVendor: Micro-Star International Co., Ltd. [1462]
SDevice: NX7300GT-TD256EH [0412]
Rev: a1
Compared to this output:
$ lspci -nn -v -d 10de:0393
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G73 [GeForce 7300 GT] [10de:0393] (rev a1) (prog-if 00 [VGA controller])
Subsystem: Micro-Star International Co., Ltd. NX7300GT-TD256EH [1462:0412]
Flags: bus master, fast devsel, latency 0, IRQ 16
Memory at fd000000 (32-bit, non-prefetchable) [size=16M]
Memory at d0000000 (64-bit, prefetchable) [size=256M]
Memory at fc000000 (64-bit, non-prefetchable) [size=16M]
I/O ports at cc00 [size=128]
[virtual] Expansion ROM at fe9e0000 [disabled] [size=128K]
Capabilities: <access denied>
Kernel driver in use: nvidia
Kernel modules: nvidia_current, nouveau, nvidiafb
You can see that the normal (non-machine-readable) format shows the kernel driver/module in use.
How do I get it to show the Driver/Module lines in machine-readable format?
In the manual it says that "Module" and "Driver" lines are optional. Does that mean that I have to compile it from source with some special attributes?
P.S. I know about awk and sed and other workarounds, I'm just curious why it doesn't work.
I use ubuntu 12.10, pciutils version 3.1.9-5ubuntu4