Compile external module against linux source and use functionality in linux source

Paul Bolle pebolle at tiscali.nl
Thu Sep 25 03:29:18 EDT 2014


On Thu, 2014-09-25 at 12:30 +0530, Arjun Pandey wrote:
> On Thu, Sep 25, 2014 at 12:28 PM, Paul Bolle <pebolle at tiscali.nl> wrote:
> > On Thu, 2014-09-25 at 12:24 +0530, Arjun Pandey wrote:
> >> I tried moving the module to kernel tree as well. Ideally this will be
> >> out of tree module. That still didn't work.
> >> I have included a header file with the extern function declaration in
> >> the source file that i modified.
> >> That didn't help either.

Building a module built-in requires a bit more: changes to a kernel tree
Kconfig file and a Makefile. There must be a lot of documentation on
this. But I would do something like
    git grep -w tristate $(git ls-files "net/*Kconfig*")

and pick a few Kconfig symbols (ie, the things with lines reading
"config EXAMPLE"). The grep the tree again for their macros:
    git grep -w "CONFIG_EXAMPLE" net/

and figure out how things all fit together.

(My guess, of course, is that your linker error disappears when you
manege to build the module built-in. Once we know that, we can look
whether it's actually possible to achieve what you want to do with an
external module.)

Hope this helps.


Paul Bolle




More information about the Kernelnewbies mailing list