How to find the version of a compiled kernel module?

Jacob Marble picture Jacob Marble · Jan 29, 2011 · Viewed 8.4k times · Source

I am in a situation where it would be very convenient to find the version of a loaded kernel module by querying the loaded module or .ko file.

Is there a standard way to do this without digging into the source code?

Answer

Sdaz MacSkibbons picture Sdaz MacSkibbons · Jan 29, 2011
$ apropos modinfo
modinfo              (8)  - display information about a kernel module
$ modinfo cpuid.ko
filename:       cpuid.ko
author:         H. Peter Anvin <[email protected]>
description:    x86 generic CPUID driver
license:        GPL
vermagic:       2.6.37 SMP preempt mod_unload PENTIUM4 gcc-4.4.5
depends: