How to find needed modules for rebuilding kernel

Danny Pansters danny at ricin.com
Thu Mar 31 14:31:50 PST 2005


On Thursday 31 March 2005 19:43, Pat Maddox wrote:
> In rebuilding a kernel, how do you know exactly what modules you need?
>  The Handbook is a good start, and a lot of them are obvious (i.e. if
> I have no SCSI disks, disable all SCSI modules).  Others aren't so
> easy, particularly serial devices, and the pseudo devices.  How can I
> find out exactly what I need to enable, so I can make the kernel as
> tight as possible?

Modules are not your concern, they get built anyway (or mostly .. not sure but 
probably not each and every possible module gets built). The idea is that if 
you for example need support for a new soundcard, you can just load the 
module (loader.conf) without needing to recompile the kernel. On an IDE/ATA 
system I generally turn down the scsi delay (I always do) and remove:

- all scsi raid cards and support
- all ethernet cards, both pci/isa and usb except the one(s) I have (most can 
be loaded as a module also); beware whether it needs mii too
- from the pseudo devices ppp/tun/slip as I'm connected via ethernet (cable) 
sometimes I disable ipv6 and gif/faith, sometimes I don't
- all CPUs except the one you actually have (performance!)

I also remove most scsi support but beware that cdrecord (atapicam) requires 
the basic scsi devices, as does umass (camera's, cf fards, usb scanners, ..).

Generally unless you need to _add_ something to your kernel you don't really 
need to stray from GENERIC at all. If you want to have a kernel at least 
tuned for your CPU and without a lot of stuff you don't have anyway, do the 
above). But depending on the purpose of the box you can strip out quite a 
lot. Check NOTES, both in /usr/src/sys/conf and /usr/src/sys/<yourarch>/conf. 
(on FreeBSD4 that is LINT).

Also most if not all drivers and devices have manual pages and from the 
synopsis you can see which other devices or options come with them.

HTH,

Dan



More information about the freebsd-questions mailing list