How to find needed modules for rebuilding kernel

2005-03-31 Thread Pat Maddox
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?
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to find needed modules for rebuilding kernel

2005-03-31 Thread Danny Pansters
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

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to find needed modules for rebuilding kernel

2005-03-31 Thread Pat Maddox
Thanks for the info.  My terminology is off...apparently what I really
meant is I'm wondering what drivers I need to compile into the kernel.
 I've done what you've suggested - removed SCSI support, all of the
NIC drivers besides the one I need, etc.  I'm just wondering how I can
find out EXACTLY what I need in there, so I can have as little as
possible.  It's a server, so it has a pretty narrow purpose, and I'd
like to keep the kernel as small and fast as I can.


On Fri, 1 Apr 2005 00:31:36 +0200, Danny Pansters [EMAIL PROTECTED] wrote:
 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
 
 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to [EMAIL PROTECTED]

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: How to find needed modules for rebuilding kernel

2005-03-31 Thread Danny Pansters
On Friday 01 April 2005 00:45, Pat Maddox wrote:
 Thanks for the info.  My terminology is off...apparently what I really
 meant is I'm wondering what drivers I need to compile into the kernel.
  I've done what you've suggested - removed SCSI support, all of the
 NIC drivers besides the one I need, etc.  I'm just wondering how I can
 find out EXACTLY what I need in there, so I can have as little as
 possible.  It's a server, so it has a pretty narrow purpose, and I'd
 like to keep the kernel as small and fast as I can.

Surely it's not going to run out of memory or disk space any time soon with a 
few kB more or less for the kernel.

Like I said there _is_ documentation ranging from abundant to sparce to terse 
to the plain source. The latter is to be taken literally...  some things are 
only documented in the sources, if you're lucky in a line of normal text in a 
header file (e.g. with device drivers). Reading NOTES would be a start. 

But I'd like to caution you not to put too much efford in this. The point is 
you only need to go that far if really needed, and I'm quite sure it's not. 
It would hardly matter. If you want to do it the hard way, well then see the 
above for the hard way :)

You might be more interested in tuning(7) and the various device.hints to get 
the most out of your hardware. The smallest size/footprint kernel used to 
be a common issue when people had small drives, little RAM and had to use 
floppies. Also, if you want a server that runs well, invest some time into 
the configuration of your services. Things like maximum files, maximum forks, 
timeouts, ... Much more likely to appear as troublemakers than a somewhat 
overweight kernel.

Dan
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]