2007-02-09 17:44:04

by Leisner, Martin

[permalink] [raw]
Subject: force insmod on 2.6

I had modules which were compiled with another kernel version string
(same kernel though).

In 2.4, you could do a force in the modules.conf files or in the insmod
command line.

The current insmod doesn't have a force option.

Modprobe CAN force, but the modules has to be in the modules tree (i.e.
not arbitrary places on the
file system)

Is there a way to force load a module at an arbitrary location?

This is very handy for development (not production).

marty


2007-02-10 10:19:23

by Rusty Russell

[permalink] [raw]
Subject: Re: force insmod on 2.6

On Fri, 2007-02-09 at 12:27 -0500, Leisner, Martin wrote:
> I had modules which were compiled with another kernel version string
> (same kernel though).
>
> In 2.4, you could do a force in the modules.conf files or in the insmod
> command line.
>
> The current insmod doesn't have a force option.
>
> Modprobe CAN force, but the modules has to be in the modules tree (i.e.
> not arbitrary places on the
> file system)
>
> Is there a way to force load a module at an arbitrary location?
>
> This is very handy for development (not production).

Sure, you simply remove the information from the module, then the kernel
will load it. To strip modversions, remove the __versions section. To
strip the version magic, it's easiest to remove the entire .modinfo
section. You can use objcopy for this...

Hope that helps!
Rusty.