Linux.com

Module versions

Link to this post 07 Apr 10

I started learning kernel module programming. I have few doubts in the below lines found in the internet.


A module compiled for one kernel won't load if you boot a different kernel unless you enable CONFIG_MODVERSIONS in the kernel.
Most stock Linux distro kernels come with modversioning turned on. If you're having trouble loading the modules because of versioning errors, compile a kernel with modversioning turned off.

Doubts:

1. How we can enable CONFIG_MODVERSIONS ? During kernel compilation.
2. Is it possible to change CONFIG_MODVERSIONS for a running kernel.
2. How we can turned on/off modversioning.
3. what is relation between CONFIG_MODVERSIONS and mocversioning.


Can you please clarify my doubts.

Thanks in advance.

Link to this post 24 Jun 10

To answer the first half of your questions, this is a compile time option only. Or that is my understanding of it. To enable it, you would need to modify the .config file of the kernel source that you are either recompiling or obtaining from the kernel.org website.

When you navigate into the kernel's directory (usually distributions place their kernel source in /usr/src) you can change the .config file manually (if you know what you are doing) or by using menuconfig:

$ make menuconfig

If using menuconfig, under "Enable loadable module support --->" you will need to enable, "Module versioning support".

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board