Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HowTo make genkernel load only the modules you want
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Soul_rebel
Tux's lil' helper
Tux's lil' helper


Joined: 12 Nov 2004
Posts: 88

PostPosted: Sun Jun 18, 2006 8:00 am    Post subject: HowTo make genkernel load only the modules you want Reply with quote

Some people prefer having ultra modular kernels, so they can share configs between many computers or simply like the idea of loading and unload stuff, without recompiling or rebooting.
Also when building a the kernel for the first time it may be easier to use a generic config as a base, unless you know really well every part of the kernel. I think Debian kernel configs are very good for this purpose.
For example when I installed gentoo the last time I took a kernel config from debian, did a make oldconfig, and then did a menuconfig to remove some stuff, but I left a lot of drivers as modules.
The advantages are that you have drivers for any possible external hardware you can attach and you get a working kernel config in minutes, although compile time and hd space use increase a bit.

So if you compile almost anything as module, you may need to use an initrd to boot...
and since building an initramfs manually is complicated, genkernel is here to help.

However it would load a lot of kernel modules in order to boot on almost any hardware and configuration. It will load sata controllers and usb drivers, for example.
If you want to load just a couple of modules, the ones you need to boot and nothing else, you may edit the file /usr/share/genkernel/YOUR_ARCH/modules_load
As of now (genkernel-3.3.11d) I recommend to place every module you want to load under MODULES_SATA. They will be loaded even if you do not use sata.
For example I have nothing compiled statically except framebuffer console and ramdisk. With this setup you can even have your root filsystem as module.
My file is just one line:
Code:
MODULES_SATA="ide-core sis5513 ide-disk xfs"

to build the initramfs use
Code:
genkernel --debuglevel=3 initrd
to check that everything is working as expected.
Beware to bakup the modified files because it will be overwritten upon upgrades.
I hope that genkernel developers will make customizable the module selection in future releases.
_________________
LinuX @ the Speed of Thought
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum