Linux – How to understand the modinfo output

kernelkernel-moduleslinuxlinux-kernel

I'm just trying to understand the modinfo output that describes a kernel module. For instance, in the case of the module i915, the output looks like this:

$ modinfo i915
filename:       /lib/modules/4.2.0-1-amd64/kernel/drivers/gpu/drm/i915/i915.ko
license:        GPL and additional rights
description:    Intel Graphics
author:         Intel Corporation
[...]
firmware:       i915/skl_dmc_ver1.bin
alias:          pci:v00008086d00005A84sv*sd*bc03sc*i*
[...]
depends:        drm_kms_helper,drm,video,button,i2c-algo-bit
intree:         Y
vermagic:       4.2.0-1-amd64 SMP mod_unload modversions
parm:           modeset:Use kernel modesetting [KMS] (0=DRM_I915_KMS from .config, 1=on, -1=force vga console preference [default]) (int)
[...]

I'm able to understand some of the fields, but I have no idea what the following mean:

  • firmware
  • alias
  • intree
  • vermagic

Does anyone know how to interpret them?

Best Answer

firmware:

firmware:       i915/skl_dmc_ver1.bin

Many devices need two things to run properly. A driver and a firmware. The driver requests the firmware from the filesystem at /lib/firmware. This is a special file, needed by the hardware, it's not a binary. The diver then does what it needs to do to load the firmware into the device. The firmware does programming the hardware inside the device.


alias:

alias:          pci:v00008086d00005A84sv*sd*bc03sc*i*

This can be splitted up in the part after the characters:

  • v00008086: v stands for the vendor id, it identifies a hardware manufacturer. That list is maintained by the PCI Special Interest Group. Your number 0x8086 stands for "Intel Corporation".
  • d00005A84: d stands for the device id, which is selected by the manufacturer. This ID is usually paired with the vendor ID to make a unique 32-bit identifier for a hardware device. There is no offical list and I wasn't able to find a Intel device id list to lookup that number.
  • sv*, sd*: The subsystem vendor version and subsystem device version are for further identification of a device (* indicates that it will match anything)
  • bc03: The base class. It defines what kind of device it is; IDE interface, Ethernet controller, USB Controller, ... bc03 stands for Display controller. You may notice them from the output of lspci, because lspci maps the number to the device class.
  • sc*: A sub class to the base class.
  • i*: interface

intree:

intree:         Y

All kernel modules start their developments as out-of-tree. Once a module gets accepted to be included, it becomes an in-tree module. A modules without that flag (set to N) could taint the kernel.


vermagic:

vermagic:       4.2.0-1-amd64 SMP mod_unload modversions

When loading a module, the strings in the vermagic value are checked if they match. If they don't match you will get an error and the kernel refuses to load the module. You can overcome that by using the --force flag of modprobe. Naturally, these checks are there for your protection, so using this option is dangerous.

Related Question