You are not logged in.

#1 2007-08-02 09:06:05

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

building a kernel module without building whole kernel

The current kernel doesn't come with a module I want so I'd like to build just that module. What is the best way to do it?

I was thinking of grabbing the current sources from ABS, taking the config file from /proc, dropping it into place and then using menuconfig to add the module and doing a make modules modules_install . Will that work?

If not, what is the easiest way to do it? I'd rather not start messing around with PKGBUILD files and having a complete custom kernel just for a single module.

Offline

#2 2007-08-04 09:41:34

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: building a kernel module without building whole kernel

Someone out there must have done this!

If not, can anyone point me at somewhere that may be able to help me with this?

Offline

#3 2007-08-04 10:13:53

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,928

Re: building a kernel module without building whole kernel

There are several kernel modules packages in extra and aur.
Nvidia, ati, madwifi (just a few examples) all build their own kernel modules without recompiling the entire kernel.

What kernel module do you need ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2007-08-04 10:19:48

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: building a kernel module without building whole kernel

It is for the rtl8187 wireless chipset.

Offline

#5 2007-08-04 10:28:00

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,928

Re: building a kernel module without building whole kernel

This Arch Wiki on Wireless r8187 has instructions on how to build the modules for rtl8187 from source.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#6 2007-08-04 10:28:54

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: building a kernel module without building whole kernel

It's in the AUR.

Offline

#7 2007-08-04 10:36:01

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: building a kernel module without building whole kernel

Both of those are for the drivers from realtek, recently they have been re-written and integrated into the kernel (2.6.22 partially, 2.6.23 completely) with extra functionality (Master mode), so I want to use those rather than the realtek ones.

Offline

#8 2007-08-04 10:56:50

Hohoho
Member
Registered: 2007-06-23
Posts: 222

Re: building a kernel module without building whole kernel

The problem is, the kernel rejects modules compiled with options different from its own (not sure here, but it DID reject modules compiled by different version of gcc), so you'll need to recompile the whole kernel yourself.
Perhaps you can use ABS, edit the .config file, turn on the modules you need in there and then issue a makepkg.

Offline

#9 2007-08-04 11:00:44

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: building a kernel module without building whole kernel

Ye, that is what I was trying to avoid. What would be nice is to find out what options the default Arch kernel is compiled with and then use those. I don't do any customizing on the standard kernel and I do nothing special with gcc so I should be able to recreate the build environment as long as gcc doesn't change versions.

Offline

#10 2007-08-04 11:25:37

Gilneas
Member
From: Netherlands
Registered: 2006-10-22
Posts: 320

Re: building a kernel module without building whole kernel

Check out the kernel sources, maybe there's a makefile in the directory with the sources you need.

Otherwise make your own makefile or if it's just one file, gcc it.
Here's a really long guide: (this book is made free or something)
http://www.xml.com/ldd/chapter/book/ch02.html

There's a makefile under "Compiling and Loading". Fit it to your needs and see what happens.

Offline

#11 2007-08-04 12:43:16

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: building a kernel module without building whole kernel

I'll have a read through that and see if it helps, if not I'll have to resort to the ABS way and build the whole thing.

Thanks

Offline

#12 2007-08-04 13:41:41

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: building a kernel module without building whole kernel

If I understand you correctly, you'll need to backport the rtl8187 source code from 2.6.23-rc1 on to 2.6.22. Have you got the necessary patch?

Offline

#13 2007-08-04 17:08:56

dninja
Member
From: Sheffield, UK
Registered: 2006-04-29
Posts: 374
Website

Re: building a kernel module without building whole kernel

From what I've read, there is some support for rtl8187 in the 2.6.22 kernel and full support in 2.6.23. Seeing as arch is currently on 2.6.22 I wanted to try to get the limited support version working so that when 2.6.23 comes out I know what I'm doing and I can get it up and running easily.

Offline

Board footer

Powered by FluxBB