总结下Linux modules的使用笔记。

1. 指令

  • modinfo
  • modprobe
  • insmod
  • rmmod
  • lsmod
  • depmod

2. 文件

  • modprobe.d
  • modules.dep
  • modules-load.d

3. 功能

详情请参考archlinux Kernel module

  • Obtaining information
  • Automatic module loading with systemd
  • Manual module handling
  • Setting module options(pass a parameter to a kernel module)
    • Manually at load time using modprobe
    • Using files in /etc/modprobe.d/
    • Using kernel command line
  • Blacklisting

4. tips

  • modprobe uses modules.dep to translate module names into module locations and get dependency relationship.

  • depmodgenerates modules.dep and map files.

  • insmod your module by providing a fully qualified path to the .ko file. insmod doesn’t do any dependency checking.

参考资料:

  1. archlinux Kernel module
  2. How make modprobe find my kernel module?