Sunday, April 19, 2009

Look up hardware for kernel and module compilation

PCI Devices

List kernel drivers and modules

lspci -k
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
Kernel driver in use: ata_piix
00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)
Kernel driver in use: ata_piix
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
Kernel driver in use: i801_smbus
Kernel modules: i2c-i801

(This is just a small portion of the output from the command, it is normally longer)

List more info about the hardware

lspci -s <bus>:<slot>
ker@srv1:~$ sudo lspci -vv -s 0:1e


To just list the drivers and modules in use do
sudo lspci -k |grep Kernel

Then make sure they're activated in the kernel config

USB

lsusb
lsusb -s <bus>:<slot>

4 comments:

loomsen said...

These are some useful commands, indeed.

They even get more useful with some additional cutting and sorting, try:

lspci -k |grep-i kernel | cut -d ':' -f2 | sort | uniq >> MyKernelModsAndDrivers.txt

sort is self-explainatory I guess, uniq will omit multiple occurences :)

loomsen said...

Oh, and btw, you might want to alias the grep command to be case insensitive by default as well, at least I prefer...

To do so, either use this if you do not hava a .bash_aliases file:

echo "alias grep='grep -i'" >> ~/.bashrc

Or, if you have created a bash_aliases file for backup purposes:

echo "alias grep='grep -i'" >> ~/.bash_aliases

To populate you don't have to log out nor close the terminal, just run

source ~/.bashrc

And enjoy :)

vigstrom said...

Indeed good point! I use cut now then.
Oh btw, instead of 'source ~/.bashrc' you can get away with '. ~/.bashrc'

Anyway, thanks for commenting!

Anonymous said...

the red hands look sharp and charismatically spooky against the black.
http://www.watchestoo.com
rolex oyster perpetual datejust watch
ROLEX SUBMARINER
ROLEX YACHTMASTER
rolex 16610
JUBILEE GENTS
SUBMARINER
YACHTMASTER
rolex 16610
BREITLING MONTBRILLANT
BREITLING NAVITIMER
BREITLING OTHER
BREITLING SUPEROCEAN_HERITAGE