LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-24-2009, 11:08 AM   #1
hosler
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 184

Rep: Reputation: 30
When do you use modules?


I read somewhere that building a module is better than just building it in the kernel because that makes the kernel load faster. Is this true? Anyway, I would like to know which things should always be built straight into the kernel and which would be fine for building as modules.
 
Old 05-24-2009, 11:31 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
If you are running a desktop, then building off the default options of your distro would be OK. If you don't have a device that a kernel module uses, it won't be loaded.

One time where you might want to build a flat kernel is if you run a server on the internet. Servers tend to not need to support as many devices as a desktop might, so you can strip out a lot of support that you don't need. You can build a kernel with custom options that only support what your server has, and no more. Then a flat kernel won't be as large. Further, by building a flat kernel and removing support for LKMs, a cracker will have a harder time since most rootkits tend to work by replacing an LKM with their own version.
 
Old 05-24-2009, 05:00 PM   #3
hosler
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 184

Original Poster
Rep: Reputation: 30
I run a laptop. So I will be putting a bunch of devices into a usb port and other slots. Maybe I should build a lot of modules for these devices I may be using in the future, or should I not even bother? I would like for linux to recognize these devices when I plug them in (eg. Some random digital camera a friend of mine owns and wants to upload to my comp).
Also, in regards to my previous question, what needs to be built into the kernel so I don't get a kernel panic when I boot? Usually just run
Code:
make defconfig
and just add all the drivers my laptop needs into the kernel and build it. I'm too scared to try and optimize the kernel for I might break it.
I have been using linux for years and built over 100 kernels, but I still feel like a complete noob when I do it because I don't know what half the stuff in the kernel is or does.
Maybe someone could just send me a nice internet link that explains all of this instead of having to answer this tedious post.
 
Old 05-25-2009, 08:35 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The option you probably want to use is "make oldconfig" instead of "make defconfig". This will use the same config settings as your running kernel. If there are new options in a newer kernel, you will be prompted whether to select them.

One thing to keep in mind is that some distro's patch the kernel. There are some things that you may loose if you start with a generic kernel you downloaded. For example, if you build a kernel for the eeepc, the generic kernel source doesn't have support for unionfs. It is considered experimental (unless my knowledge is too old) and you would need to apply a patch to install it unless you work with your distro's patched source.

Also keep your old kernel. Backing up /boot would be a good idea as well. If you are re-building the same kernel version, you might also want to backup /lib/modules/$(uname -r) and /etc/modprobe.conf & /etc/modprobe.d/.

Good Luck!
 
Old 05-25-2009, 10:02 AM   #5
hosler
Member
 
Registered: Mar 2005
Distribution: Gentoo
Posts: 184

Original Poster
Rep: Reputation: 30
Is it a good idea to make every USB input device driver into a module? I guess thats what i'm really asking. Don't know why I had to write so much.
 
  


Reply



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
FATAL: Could not load /lib/modules/2.6.14-default/modules.dep no such file exist dr_zayus69 Linux - Software 3 12-26-2005 06:44 PM
Update-modules: No longer managing /lib/modules/modprobe.conf? geekzen Debian 0 04-03-2004 06:49 PM
Slack9 - no PPP (can't open dependencies file /lib/modules/2.4.18/modules.dep) bluehz Slackware 1 05-04-2003 02:32 PM
Re: modprobe: Note: /etc/modules.conf is more recent than lib/modules/2.4.9/modules.d Andy.M Linux - General 1 01-24-2002 01:50 AM
Re: modprobe: Note: /etc/modules.conf is more recent than lib/modules/2.4.9/modules.d Andy.M Linux - Newbie 2 01-24-2002 01:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration