LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 05-31-2007, 12:18 PM   #1
mariogarcia
Member
 
Registered: Sep 2005
Distribution: debian, solaris 10
Posts: 192

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


Hello
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.
mario
 
Old 06-01-2007, 05:33 AM   #2
cdcshu
Member
 
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-2.6.18.2-34.

# make -C /usr/src/linux-2.6.18.2-34 M=`pwd` modules
......
make[1]: Leaving directory `/usr/src/linux-2.6.18.2-34'
# 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

[Makefile]

obj-m := example.o

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

Cheers,

cdcshu
 
1 members found this post helpful.
  


Reply


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/2.4.33.3/kernel/sound folder is missing after compiling kernel Paulo Ges Slackware - Installation 2 04-15-2007 08:42 PM
Compiling kernel modules NNP Programming 4 12-18-2005 02:08 PM
no modules after kernel compile glorsplitz Slackware 7 09-20-2005 10:26 AM
Compiling Modules for 2.6.6 kernel! Bigg Mike Linux - Newbie 9 06-09-2004 09:04 PM
modules after re-compile kernel skarim Linux - Software 3 10-15-2003 01:48 AM


All times are GMT -5. The time now is 03:29 AM.

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