Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recompiling kernel modules 2

Status
Not open for further replies.

venkman

Programmer
Oct 9, 2001
467
US
If I compile my kernel and decide not to build certain modules, can I later compile those modules without recompiling the entire kernel?

For instance lets say I recompile my kernel and I build only one module for ethernet cards... the module for the card I have. When I boot up, I suddenly realize that I clicked the wrong box in xconfig and compiled the wrong ethernet card module. Can I then go back and just compile the module I need?

If so, how do I go about doing this?

-Venkman
 

Dont' think so but if you find out, please tell me.

It's not that big a problem though unless you have a 486 a rebuild shouldn't take more than two minutes.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
You should be able to. A simple [tt]cd[/tt] to the directory where the module is, and then a [tt]make <module name>.o[/tt] should build the module. I'm not sure though, but this is the most a very common way to write Makefiles... //Daniel
 

I've tried that though never succesfully.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
Daniel,

Rebuilding the kernel takes me a lot longer than 2 minutes. Did you mean rebuild as in remake the kernel image and its modules, or just its modules? Can I just rerun make modules no problem, or does the kernel image itself need to be recompiled to know that a new module exists?

Thanks
-Venkman
 

I have a PII 233MHz and it takes a lot less than two minutes for 'make bzImage' to complete.

Again, in my experience I have to run the hole thing, rebuild kernel, modules, etc, otherwise it just stops with an error when I run 'make'.

But give it a try.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
It seems like if the kernel requires you to rerun everything. //Daniel
 
I haven't timed it recently, but make bzImage takes me about 20 minutes on my p3-1GHz. I'm usually running kde and a whole bunch of daemons (like ftpd and httpd), but would this really slow it down that much? Am I building my kernel incorrectly? Is that even possible in the sense we're talking about?

In any case, thanks all for the advice.

-Venkman
 
Well, I recompiled my kernel today and it took me about 15 minutes (it's a P4 1.7GHz with 512 MB RAM) running Fluxbox, so I really don't think that it's slowing you down that much. //Daniel
 
My apologies Daniel, I accidently directed the kernel compliling time question/comment to you, but I guess it's Henrik who said that it takes less time. Henrik, do you know why it doesn't take you that long as opposed to me and Daniel?

Thanks,
Venkman
 

Ok, I left out some info I guess:

1. I'm only running a 2.2 kernel, they're probably a bit smaller.

2. Minimalistic maybe, I like modules :) Still it only takes about 5-6 minutes for the modules.

3. Hardware: It migth be a PII 233MHz but there are two of them and they're running 280MHz. System bus running 112MHz and I have 512Mb PC100 SDRAM.
Disk system is three Quantum Vikings on an Adaptec 7890U2W controller running software striping.

God I love this computer :) It's six years old and it can still beat all of my friend computers :-D

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
It's about a third of the 2.4 kernels, so that would explain it :p. //Daniel
 

Oh no it isn't. The source might be three times bigger but that's just additional driver and new functionality.

A 2.4 kernel configured for the same hardware is maybe 20-30% larger. You won't get me down that easy ;)

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
With a decent 686 and reasonable options
your compile shouldn't take more than 8-12
minutes unless you are really doing a lot
at the same time.

My desktop machine is much more modest
than some I've seen described:
Amd T-bird 700 mhz, 200 mb RAM and it's never taken
more than fifteen minutes.

These compiles occurred while running kde 3.x,
mozilla, etc..I don't understand these horror
stories. Ripping cd's with grip/krabber is much
more demanding in my experience..

To answer the other set of questions:
&quot;Can I just make modules&quot;
Sure, but without the proper core kernel support
the modules you compile may be unusable.
Many times I have compiled kernels and modules for
use on other,slower machines(my old 233mhz laptop
for one)and transferred kernel, System.map and the
entire modules directory over. After ldconfig -v, and
the usual edits and moves the whole thing is
transparent.
That's the great flexibility of being able to choose
what processor, filesystems, etc.. you want support
for and how you want that support made available.

It sounds like everyone is a little mystified by the
kernel compile process. The kernel howto is still a good primer for this.

After make menuconfig(or whatever) and saving your
selection try:
make dep ; make modules ; make modules_install
 

> It sounds like everyone is a little mystified

I'm not, so 'everyone' might be a little exxagerated??

Someone simple asked about compiling a new module which was a good question.

Cheers Henrik Morsing
Certified AIX 4.3 Systems Administration
& p690 Technical Support
 
It seems as if this should work:
[tt]cd ~/linux-2.4.20/<module's directory>/; make <module's name>.o TOPDIR=~/linux-2.4.20/ CFLAGS=&quot;<the various CFLAGS needed>&quot;; insmod <module's name>[/tt] //Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top