Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 05-31-2007, 01:18 PM   #1
Registered: Sep 2005
Distribution: debian, solaris 10
Posts: 194

Rep: Reputation: 31
compile kernel modules without compiling new kernel

I would need to add a couple of modules to the kernel.
if i compile a new kernel, i am going to lose the modules that doesn't come with the kernel such as ieee80211 and ipw3945 and it's a pain to reinstall those in this laptop. also dri and direct rendering will stop funcioning.
how can just enable modules in the kernel without having to install a whole new kernel. I need at this stage cpu scaling and fuse
I heard I could do a "make module_install"? but when?
here's how i compile my kernel

make mrproper
make oldconfig
make menuconfig
fakeroot make-kpkg --append-to version -xxx --revision x kernel-image kernel-headers
sudo dpkg -i linux-image. deb

this procedure tells me a big warning saying to mode /lib/modules/2.6.x.x/kernel somewhere else.
if do so, the modules for the wireless and others will stop working.

if there's a trick to do what i have to do I'll be grateful if you let me know. or any book i could buy and see.
thank you very much.
Old 06-01-2007, 06:33 AM   #2
Registered: Jul 2006
Location: Shanghai
Distribution: Fedora, OpenSUSE
Posts: 31

Rep: Reputation: 16
Smile Look it up at <<Linux Device Driver>> 3rd

Actually, you don't need compile the kernel. Just compile the module directly.

However, you need to prepare/write a simple makefile and then type one line command to make it.

1. Kernel code should prepare for the build.
# make oldconfig
# make

Trick : No need to wait it complete, wait 30 seconds, Ctrl-C to stop it.

2. Put the module source code and makefile together. For example, module file is example.c.

Suppose kernel is at /usr/src/linux-

# make -C /usr/src/linux- M=`pwd` modules
make[1]: Leaving directory `/usr/src/linux-'
# ls
.example.ko.cmd .tmp_versions Module.symvers example.mod.c
.example.mod.o.cmd Makefile example.c example.mod.o
.example.o.cmd Makefile~ example.ko example.o


obj-m := example.o

Details also could see LDD3 - Linux Device Driver 3rd edition.


1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
/lib/modules/ folder is missing after compiling kernel Paulo Ges Slackware - Installation 2 04-15-2007 09:42 PM
Compiling kernel modules NNP Programming 4 12-18-2005 03:08 PM
no modules after kernel compile glorsplitz Slackware 7 09-20-2005 11:26 AM
Compiling Modules for 2.6.6 kernel! Bigg Mike Linux - Newbie 9 06-09-2004 10:04 PM
modules after re-compile kernel skarim Linux - Software 3 10-15-2003 02:48 AM

All times are GMT -5. The time now is 11:01 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration