Why Is This Kernel Module Marked at Permanent on 2.6.39

Why is this kernel module marked at permanent on 2.6.39

So, after consultation with Canonical, I know what the problem is:

Ubuntu mainline builds are built with the Hardy tool chain, and the 11.04 and 11.10 tool chains are incompatible for building out-of-tree kernel modules.

how to resolve module marked permanent in LKM

Kernel module is marked as permanent (cannot be unloaded) if there is no exit function is defined for it.

exit function accepts no arguments and return nothing and should be defined either with predefined name

void cleanup_module(void)
{
...
}

or with arbitrary name but registered with module_exit macro

void <func_name>(void)
{
...
}

module_exit(<func_name>);

static, __exit and other attributes for exit function are optional.

Error: device or resource busy in removing proc module

Either name the module cleanup function cleanup_module (and not clean_module) or specifically declare it as a cleanup function (much better) like so:

module_init(init_module);
module_exit(clean_module);


Related Topics



Leave a reply



Submit