Tux's lil' helper
Joined: 12 Nov 2004
|Posted: Sun Jun 18, 2006 8:00 am Post subject: HowTo make genkernel load only the modules you want
|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:
|MODULES_SATA="ide-core sis5513 ide-disk xfs"
to build the initramfs use
to check that everything is working as expected.
|genkernel --debuglevel=3 initrd |
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