Loading kernel modules

You can load, unload and list modules using the simple insmod, lsmod, and rmmod commands. Here they are shown loading the dummy driver:

# insmod /lib/modules/4.1.10/kernel/drivers/dummy.ko
# lsmod
dummy 1248 0 - Live 0xbf009000 (O)
# rmmod dummy

If the module is placed in a subdirectory in /lib/modules/<kernel release>, as in the example, you can create a modules dependency database using the command depmod:

# depmod -a
# ls /lib/modules/4.1.10/
kernel               modules.builtin.bin  modules.order
modules.alias        modules.dep          modules.softdep
modules.alias.bin    modules.dep.bin      modules.symbols
modules.builtin      modules.devname      modules.symbols.bin

The information in the module.* files is used by the command modprobe to locate a module by name rather ...

Get Embedded Linux for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.