I'm looking for a few kernel modules to load i2c-dev
and i2c-bcm2708
. But the modprobe
command returns:
sudo modprobe i2c-dev
modprobe: module i2c-dev not found in modules.dep
How can I list all the available modules in the system? In which directory are they located?
Best Answer
By default
modprobe
loads modules from kernel subdirectories located in the/lib/modules/$(uname -r)
directory. Usually all files have extension.ko
, so you can list them withor, taking into account compressed files:
Each module can be also loaded by referring to its aliases, stored in the
/lib/modules/$(uname -r)/modules.alias
(andmodules.alias.bin
).However, to load a modules successfully
modprobe
needs their dependencies listed in the file/lib/modules/$(uname -r)/modules.dep
(and a corresponding binary versionmodules.dep.bin
). If some module is present on the system, but is not on the list, then you should run a commanddepmod
which will generate such dependencies and automatically include your module tomodules.dep
andmodules.dep.bin
.Additionally, if the module is successfully loaded it will be listed in the file
/proc/modules
(also accessed via commandlsmod
).