Differences between revisions 8 and 11 (spanning 3 versions)
Revision 8 as of 2020-03-22 09:17:00
Size: 3568
Editor: TpO
Comment: info on this page is out of date and should be reworked
Revision 11 as of 2020-03-23 00:00:44
Size: 3658
Editor: PaulWise
Comment: more cleanup
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
''This page is an introduction and FAQ for Modules. It is not intended to replace official documentation (listed at the bottom of the page). It is also very '''out of date''' and should be either deleted or heavily reworked. ''This page is an introduction and FAQ for Linux kernel modules. It is not intended to replace official documentation (listed at the bottom of the page).''
Line 11: Line 11:
Under Debian, the module can be installed from three different kind of sources :
 * Upstream (Linux) Kernel modules : Those are shipped in the {{{linux-image-2.6}}} kernel packages.
 * Extra modules, that's aren't in Linux kernel. Those are usually built using DebianPkg:module-assistant. The Available modules can be listed by running {{{apt-cache rdepends module-assistant}}}. ''Note:'' some of those packages are in {{{contrib}}}, or {{{non-free}}} sections.
 * Others, like Third party, Proprietary and other or Binary blobs modules... You should not install such modules on your system.

Under Debian, the module can be installed from three different kind of sources:

* Upstream Linux kernel modules: Those are shipped in the {{{linux-image-*}}} kernel packages.
 * Extra modules, that's aren't in the upstream Linux kernel. Those are usually built using DebianPkg:dkms. The available modules can be listed by running {{{apt rdepends dkms}}}.
   * An older less flexible mechanism for building extra modules is DebianPkg:
module-assistant. The available modules can be listed by running {{{apt rdepends module-assistant}}}.
   *
''Note:'' some of those packages are in {{{contrib}}}, or {{{non-free}}} sections.
 * Others, like third party, proprietary and other or binary blobs modules... You should not install such modules on your system except when you have no other choice.
Line 20: Line 24:
If you want to get a module to autoload when a device is accessed you can often add a file to {{{/etc/modutils}}} and run update-modules to generate {{{/etc/modules.conf}}}. When the kernel receives a request to open a device file that it does not have capabilities for it issues a request to modprobe for the module 'char-major-n' or 'block-major-n' depending on whether the device is a character or block device, and the device's major number, n. For example, my sound devices have major number 14, and my sound module is emu10k1 so added the alias below to my {{{/etc/modutils}}} directory. If you want to get a module to autoload when a device is accessed you can often add lines to {{{/etc/modules}}} or a file to {{{/etc/modules-load.d/}}}. When the Linux kernel receives a request to open a device file that it does not have capabilities for it issues a request to modprobe for the module 'char-major-n' or 'block-major-n' depending on whether the device is a character or block device, and the device's major number, n.

For example, my sound devices have major number 14, and my sound module is emu10k1 so added the alias below to my {{{/etc/modules-load.d}}} directory.
Line 25: Line 32:
$ cat /etc/modutils/sound $ cat /etc/modules-load.d
Line 30: Line 37:
This file links specific [[Kernel]] module names to the service names the kernel knows (aliases).
Line 32: Line 38:
As a very simple example, it could link the service ''eth0'' to the kernel driver module for the particular ethernet card you installed in your computer. This file links specific [[Kernel|Linux kernel]] module names to the service names the kernel knows (aliases).
Line 34: Line 40:
The alias directive can be used to give alias names to modules. A line in {{{/etc/modules.conf}}} that look like this: As a very simple example, it could link the service ''eth0'' to the kernel driver module for the particular Ethernet card you installed in your computer.

The alias directive can be used to give alias names to modules. A line in {{{/etc/modules}}} that look like this:
Line 42: Line 51:
Line 43: Line 53:
 * [[KernelModuleBlacklisting]] - Prevent a module from beeing automatically loaded.  * [[KernelModuleBlacklisting]] - Prevent a module from being automatically loaded.
Line 46: Line 56:
 * Manpages :
  * [[DebianMan:8/modprobe|modprobe]], [[DebianMan:8/lsmod|lsmod]], [[DebianMan:8/modinfo|modinfo]] and [[DebianMan:8/update-modules|update-modules]]
  * ...and also [[DebianMan:8/insmod|insmod]], [[DebianMan:8/depmod|depmod]], [[DebianMan:8/rmmod|rmmod]], [[DebianMan:5/depmod.conf|depmod.conf]], [[DebianMan:5/modules|modules]], [[DebianMan:5/modules.dep|modules.dep]] and [[DebianMan:5/modprobe.conf|modprobe.conf]]
 * Manual pages:
  * [[DebianMan:8/modprobe|modprobe]], [[DebianMan:8/lsmod|lsmod]] and [[DebianMan:8/modinfo|modinfo]]
  * ...and also [[DebianMan:8/insmod|insmod]], [[DebianMan:8/depmod|depmod]], [[DebianMan:8/rmmod|rmmod]], [[DebianMan:5/depmod.d|depmod.d]], [[DebianMan:5/modules|modules]], [[DebianMan:5/modules.dep|modules.dep]] and [[DebianMan:5/modprobe.d|modprobe.d]]

Translation(s): English - Français - Italiano

(!) ?Discussion

This page is an introduction and FAQ for Linux kernel modules. It is not intended to replace official documentation (listed at the bottom of the page).

Kernel Modules

Under Debian, the module can be installed from three different kind of sources:

  • Upstream Linux kernel modules: Those are shipped in the linux-image-* kernel packages.

  • Extra modules, that's aren't in the upstream Linux kernel. Those are usually built using dkms. The available modules can be listed by running apt rdepends dkms.

    • An older less flexible mechanism for building extra modules is module-assistant. The available modules can be listed by running apt rdepends module-assistant.

    • Note: some of those packages are in contrib, or non-free sections.

  • Others, like third party, proprietary and other or binary blobs modules... You should not install such modules on your system except when you have no other choice.

Automatic loading of modules

  • {i} Nowadays, most modules related to hardware support should be automatically loaded, thanks to udev and modules alias that are hardcoded in kernel modules (see the alias fields in modinfo snd-hda-intel output).

If you want to get a module to autoload when a device is accessed you can often add lines to /etc/modules or a file to /etc/modules-load.d/. When the Linux kernel receives a request to open a device file that it does not have capabilities for it issues a request to modprobe for the module 'char-major-n' or 'block-major-n' depending on whether the device is a character or block device, and the device's major number, n.

For example, my sound devices have major number 14, and my sound module is emu10k1 so added the alias below to my /etc/modules-load.d directory.

$ ls -l /dev/dsp
crw-rw----    1 root     audio     14,   3 Jul  5  2000 /dev/dsp

$ cat /etc/modules-load.d
alias char-major-14 emu10k1

Alias

This file links specific Linux kernel module names to the service names the kernel knows (aliases).

As a very simple example, it could link the service eth0 to the kernel driver module for the particular Ethernet card you installed in your computer.

The alias directive can be used to give alias names to modules. A line in /etc/modules that look like this:

 alias iso9660 isofs 

makes it possible to write modprobe iso9660 although there is no object file for such module available.

See Also


CategoryKernel