You are not logged in.

#1 2008-06-07 02:20:17

phabulosa
Member
From: Mountain View, CA
Registered: 2007-10-17
Posts: 182
Website

Build Kernel Module or NOT?

I am trying to build my own kernel manually myself.

I knew that by default many kernel features are built as "modules".

However, I am sure that I don't need lots of modules, such as some hardware drivers.

My question is what benefit I will achieve by not building some modules (besides saving some hard disk space and shorten build time).

Will I achieve any performance gain? Will my boot speed accelerated?

Offline

#2 2008-06-07 03:45:53

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

Re: Build Kernel Module or NOT?

Neither method really gains anything over the other. I personally build all the stuff I need into the kernel simply because my hardware is not going to change any time soon, and If it did I would just rebuild the kernel.
Modules provide some flexibility as far as not loading drivers for something if it gets broken in a kernel update or something, but then your better of just using the last kernel that worked anyway. The stock kernels use modules so they can support everything without bloating the kernel itself, saying that stock kernels do have some stuff to support older hardware built in that you probably dont need.

If you understand what hardware you have and what drivers it needs, build it in, you will gain a couple of seconds on boot times. If you really have no idea about your hardware/drivers just build a stock arch kernel and change whatever options you want, aside from a longer compile time you dont loose anything by building the 3.5k modules or whatever it is now, as far as memory/cpu time.

Offline

#3 2008-06-07 04:02:34

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,328

Re: Build Kernel Module or NOT?

If I understand correctly what you're asking, then the answer is *no*. There is no difference. The modules you don't use are just lying on the disk, and have no influence whatsoever on anything (except the free disk space) until you load them into the kernel. Which you (or udev) don't, if they're not needed.

Offline

#4 2008-06-07 05:18:48

klixon
Member
From: Nederland
Registered: 2007-01-17
Posts: 525

Re: Build Kernel Module or NOT?

There is however an increase in the time it takes to _build_ the kernel if you just build everything wink This is a good time to learn about your hardware

Plus, if you decide to make it fully customized to your own needs, you might actually learn a little bit about what it takes to make a good config, what things are needed to make other things run, etc... This has the added downside that it takes a while to get right and your first experiments might run a bit slower than the avg kernel, but you learn stuff, which might come in handy one day

Plus, if you compile everything into the kernel (statically, no modules) there is a good chance of shaving a few seconds off of your boot time. Mind you, these are only seconds. Might not offset the time it takes to build the kernel.

This is my pov: Tinkering ftw!


Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!

Offline

#5 2008-06-07 09:07:55

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

Re: Build Kernel Module or NOT?

Just dont tinker by overwriting the stock arch kernel or you will end up with a headache, best to modify CONFIG_LOCALVERSION in the kernel config and build a completely separate package build.

Offline

#6 2008-06-07 12:25:52

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Build Kernel Module or NOT?

I agree with klixon, however, I think some people do get a bit carried away on kernel compiling and recompiling...and they sometimes tend to use source based distributions. wink
My pov is that obsessing over building a static kernel is, well, so "90's". On modern hardware there is no benefit from it. Tinkering is fun and educational, though.
Modular is more versatile, with no performance hit, so I like the modular approach. With a modular kernel, you can remove the hard drive on a broken down PC, slap it into a working machine, and have a good chance of booting up without incident. You can also add and change hardware without thinking twice.
As you practice building your own, you'll come to find what works best for you. Enjoy.

Offline

#7 2008-06-07 16:23:07

Zepp
Member
From: Ontario, Canada
Registered: 2006-03-25
Posts: 334
Website

Re: Build Kernel Module or NOT?

Misfit138 wrote:

I agree with klixon, however, I think some people do get a bit carried away on kernel compiling and recompiling...and they sometimes tend to use source based distributions. wink
My pov is that obsessing over building a static kernel is, well, so "90's". On modern hardware there is no benefit from it. Tinkering is fun and educational, though.
Modular is more versatile, with no performance hit, so I like the modular approach. With a modular kernel, you can remove the hard drive on a broken down PC, slap it into a working machine, and have a good chance of booting up without incident. You can also add and change hardware without thinking twice.
As you practice building your own, you'll come to find what works best for you. Enjoy.

There is an argument that it prevents one way of installing a kernel root kit. However I don't think it's really a big issue, especially for a home desktop, and more so there are better ways to get that extra bit of security without flat out disabling modules from being loaded ever tongue.

Last edited by Zepp (2008-06-07 16:23:38)

Offline

Board footer

Powered by FluxBB