Linux hardware drivers—such as Wi-Fi adapters, graphics cards, storage RAID controllers, and network interface cards—operate as dynamically loadable kernel modules (.ko files). When troubleshooting hardware incompatibilities, debugging driver crashes, or fine-tuning hardware parameters (such as disabling power management or enabling experimental features), systems administrators need complete visibility into module metadata. In Ubuntu, the modinfo command extracts comprehensive driver profiles directly from compiled kernel objects.
Querying Kernel Driver Metadata with modinfo
The modinfo command queries the module database residing in /lib/modules/$(uname -r)/ without requiring the module to be actively loaded in memory:
- Open your terminal via
Ctrl + Alt + Tor connect over SSH. - Execute
modinfofollowed by the module name (for example, the Intel Wi-Fi driveriwlwifi):modinfo iwlwifi - The terminal outputs a detailed technical dossier:
filename: /lib/modules/6.8.0-45-generic/kernel/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko.zst license: GPL description: Intel(R) Wireless WiFi driver for Linux author: Intel Corporation <[email protected]> firmware: iwlwifi-ty-a0-gf-a0-59.ucode depends: cfg80211 parm: power_save:enable-WiFi power management (default: true) (bool) parm: 11n_disable:disable 11n functionality, 1=disable, 2=disable aggTX, 4=disable aggRX (uint)
Inspecting Configurable Driver Parameters (parm)
The lines prefixed with parm: are crucial for systems engineering. They detail the exact configuration flags supported by the driver:
- Parameter Name & Description: Explains what the parameter controls (e.g.
power_saveorbt_coex_active). - Accepted Data Types: Indicates whether the parameter expects a boolean (
bool: 0 or 1), integer (int), or text string. - Applying Custom Parameters: To pass custom parameters permanently, create a configuration file inside
/etc/modprobe.d/(e.g.options iwlwifi power_save=0) and regenerate initramfs.
Extracting Specific Fields with the -F Flag
When writing automated auditing scripts or verifying licensing compliance, use the field selector (-F) to isolate specific values:
- Check Module License:
Output:modinfo -F license e1000eGPL v2 - List Required Firmware Files:
Outputs allmodinfo -F firmware iwlwifi.ucodefirmware binaries expected by the driver in/lib/firmware/. - Inspect Module Dependencies:
Displays all subsidiary kernel modules that must be loaded prior to this driver initializing.modinfo -F depends nouveau