From mboxrd@z Thu Jan 1 00:00:00 1970 From: pebolle@tiscali.nl (Paul Bolle) Date: Thu, 25 Sep 2014 09:29:18 +0200 Subject: Compile external module against linux source and use functionality in linux source In-Reply-To: References: <1411627008.6613.4.camel@x220> <1411627717.6613.8.camel@x220> <1411628331.6613.11.camel@x220> Message-ID: <1411630158.6613.23.camel@x220> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Thu, 2014-09-25 at 12:30 +0530, Arjun Pandey wrote: > On Thu, Sep 25, 2014 at 12:28 PM, Paul Bolle 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