D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Save your old hardware! DSL & USB ethernet adapter

 

Robin Cornelius wrote:
>> Actually, on that subject, does anyone know how to compile a kernel
>> module (and maybe it's dependencies too) without having to change the
>> kernel config and compile the whole lot?
> 
> If your distribution provides either a properly configured kernel
> source or a kernel headers package (with config stuff all set) then
> you are laughing. If you just take a stock kernel from kernel.org then
> this will need configuring. Also be warned that may distros (mandrake
> use to be good for this) will apply many patches to ther kernel and it
> can become very different to the stock kernel, in this case you MUST
> get the source for the running kernel from your distros source
> packages. Also keep gcc the same.
> 
> As mentioned my someone again recently, often the .config for the
> running kernel is also copied in to /boot/????.config and coping this
> back to the kernel source dir as .config sets all the correct config
> stuff.

Then what? Normally you would edit the config and do make modules, and 
it would compile all the modules selected in the config.
How do you compile ONE module?
I'm looking for a command like:
make module [module name]
or even directly with:
gcc [options: this is a kernel module- compile it for the running 
kernel] module.c

Preferably without doing anything with the config.

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html