Skip to content. | Skip to navigation

Sections
Personal tools
You are here: Home Tutorials Using modinfo

Using modinfo

— filed under: , ,

Linux / Kernel: Introduction to modinfo

From Wikipedia:

"Linux Loadable Kernel Modules, or LKM, are object files that contain code to extend the running kernel, or so-called base kernel. They are typically used to add support for new hardware, filesystems or for adding system calls. When the functionality provided by an LKM is no longer required, it can be unloaded, freeing memory.

...

Without Linux Loadable Kernel Modules, Linux distributions would have to build kernels with all possible anticipated functionality already compiled directly into the kernel image. Besides having larger kernels, this has the disadvantage of requiring users to rebuild and reboot the kernel every time new functionality is desired."

The modinfo command allows use to query information regarding the kernel module, such as the full module path, author, short description, license, and most importantly, module parameter.

Example:

# modinfo usbserial
filename:       /lib/modules/2.6.15.4-ubuntu1/kernel/drivers/usb/serial/usbserial.ko
author:         Greg Kroah-Hartman, greg@kroah.com, http://www.kroah.com/linux/
description:    USB Serial Driver core
license:        GPL
vermagic:       2.6.15.4-ubuntu1 preempt PENTIUM4 gcc-4.0
depends:        usbcore
srcversion:     A7680AF853CDB00DF568B27
parm:           product:User specified USB idProduct (ushort)
parm:           vendor:User specified USB idVendor (ushort)
parm:           debug:Debug enabled or not (bool)

Now, we know that the usbserial module take product, vendor, and debug flag as it's parameter. Thus, we can call modprobe and pass the parameter like this:

modprobe usbserial vendor=0x001 product=0x002
Document Actions
  • Send this
  • Print this
  • Bookmarks
Please Donate

If you find contents of this website is useful to you, please consider to donate. Proceeds will go towards the site maintenance.

 
Creative Commons Plone Zope Python
web page monitoring website performance SiteUptime Web Site Monitoring Service Clicky Web Analytics