Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
/modules.dep.   If  you make    changes to  the file
/etc/modprobe.conf, run depmod -a manually. The depmod
command, its list of dependencies, and the /etc/modprobe.conf
file enable kernel modules to be automatically loaded as needed.
/etc/modprobe.conf—This is not a command but a file that
controls how modprobe and depmod behave; it contains kernel
module variables. Although the command syntax can be quite complex,
most actual needs are simple. The most common use is to alias a module
and then pass some parameters to it. For example, the following code
aliases a device name (from devices.txt) to a more descriptive word
and then passes some information to an associated module:

Click here to view code image
alias char-major-89 i2c-dev
options eeprom ignore=2,0x50,2,0x51,2,0x52


The i2c-dev device  is  used    to  read    the CPU temperature and fan speed
on this system. These lines for /etc/modprobe.conf were
suggested for our use by the program’s documentation. We added them
with a text editor.

A partial listing of lsmod is shown here, piped through the less command,
enabling you to view it a page at a time:


Click here to view code image
matthew@seymour:~$ sudo lsmod | less
Module Size Used by
parport_pc 19392 1
Module Size Used by
parport_pc 19392 1
lp 8236 0
joydev 17377 0
parport 29640 2 parport_pc,lp
autofs4 10624 0
sunrpc 101064 1


The list is actually much longer, but here you see that the input module is
being used by the joydev (joystick device) module, but the joystick module
is not being used. This computer has a joystick port that was autodetected, but
no joystick is connected. A scanner module is also loaded, but because the
USB scanner is unplugged, the module is not being used. You use the lsmod
command to determine whether a module was loaded and what other modules
were using it. If you examine the full list, you see modules for all the devices
attached to your computer.

Free download pdf