What has to be compiled in, and what can be a module?
Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What has to be compiled in, and what can be a module?
Hi
I am just about to configure the kernel for LFS v6.3 and am unsure as to what "must" be compiled into the kernel - and what can be done as modules?
I read somewhere:-
Quote:
"The only thing that really is required to be compiled into the kernel are the drivers for the root file system"
Is this OK, so I only need to bother with ext3 (everything else modules) or are there general rules that I can follow?
Thanks for any advice
PS. I was going to just compile everything I needed directly into the kernel, but got the impression this was wrong and would make the kernel run slower(?), so I am thinking sound, network drivers etc - should be loaded as modules - does this make any sense?
Last edited by drut; 05-15-2008 at 02:48 PM.
Reason: Added the PS
If you're not using a ramdisk at boot time, then it is recommended that you build both the filesystem that you
use for your root partition, and the disk controller for that disk, into the kernel, instead of having it as a module. Also, everything that can't be built as a module has to be built into the kernel .
I don't think there's anything "wrong" with building everything into the kernel vice as modules. The speed really depends on the arch from what I've read. A better reason to build modules is that you can unload them if something goes haywire.
Many thanks for the quick responses and useful info.
As you may have guessed it's the first time I'm configuring a kernel, and I have downloaded O’Reilly's 'Kernel in a Nutshell' - but it's a fairly big nutshell and I've not got through it all yet.
But with your advice I can carry on and hopefully get this LFS system up and running soon..
LFS is quite an adventure... but well worth the trouble.
When I built my (Gentoo) kernel, I determined (from a Knoppix DVD) what drivers were needed by my hardware. I put those drivers into the resident kernel and omitted everything else. In this way, when "my kernel" comes into memory, it has everything needed to run "my system."
What did I put into modules? Cryptographic routines, drivers for removable devices, stuff like that.
I don't like to set up systems that require the "initial ramdisk" approach. I understand of-course why distro writers use it, but for my own systems "I know precisely what I want."
Last edited by sundialsvcs; 05-21-2008 at 09:26 PM.
If you have problematic hardware is better to compile as module. For example my sound card needs modprobe -r mycard; modprobe mycard to operate after suspend.
That's a good point: "suspend" can be a problem and many drivers out there are not aware of its implications. Device-initialization needs to be performed a second time since the electrical power has been turned off and back on again. If you have a driver for a non-essential device that is not suspend-friendly, removing and then reloading the module is a way to be sure that the device-initialization step happens (again).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.