# 8.1-RELEASE purpose of a custom kernel



## davidgurvich (Sep 4, 2010)

All of my hardware seems to work well with the GENERIC kernel which is about 12MB.  I'm using FreeBSD as a laptop OS with all ZFS filesystem.  What, if any, would be the advantages in building a custom kernel?


----------



## fronclynne (Sep 4, 2010)

*This list may be in decreasing order of importance, if you think it is*

altq(4).

And, err, 90 column console?

You might see a bit of a speed-up on i386 if you remove 
	
	



```
cpu             I486_CPU
cpu             I586_CPU
```
(assuming you're running something as new-fangled as a pentium-pro, that is)
(note also that the entire AMD K6 line requires I586_CPU)


----------



## UNIXgod (Sep 4, 2010)

It's good to have a slim kernel. Generally you shouldn't need most scsi and raid drivers as well as the nic drivers you will never have on that system as well.


----------



## phoenix (Sep 4, 2010)

If GENERIC works, and you are happy with the performance, there's not much reason to compile a custom kernel.

If you are loading drivers via /boot/loader.conf, and using only a specific set of hardware, then it can be useful to compile a kernel that only has the drivers you use (no extras) and the drivers that aren't part of GENERIC.

Or, if you need access to options (like IPFIREWALL_DEFAULT_TO_ACCEPT or ALTQ_* etc) then you have no choice but to compile a custom kernel.

It all depends on your circumstances.  There's no general "one size fits everyone" rule to compiling kernels.


----------



## UNIXgod (Sep 4, 2010)

Another note would be to remove bpf from the kernel on an internet facing machine for security reasons. Since your on a laptop (most likely running dhcp) this wont apply to you.

Out of curiosity though. Modern hardware takes maybe 15-20 minutes at the most to compile and install a custom kernel. Is there a specific reason you wouldn't want to?


----------



## gilinko (Sep 4, 2010)

UNIXgod said:
			
		

> Out of curiosity though. Modern hardware takes maybe 15-20 minutes at the most to compile and install a custom kernel. Is there a specific reason you wouldn't want to?



Many reasons, the main one I would say is the eases up binary upgrade. I would reverse that question. Is there a reason you actually need a custom kernel? You _need_ it is when features/drivers that can't be loaded dynamically(like ALTQ_*), otherwise I would say that it's never needed. You won't gain much speed from a small custom kernel. On normal hardware that is...

If you actually like to compile your own kernel, then it's not a question if you need to or not.


----------



## fronclynne (Sep 4, 2010)

I would say that 80% of custom kernel build failures are from enthusiastic "slimmers" who inevitably remove "device scbus" or "device da" because they don't have any SCSI disks.


----------



## davidgurvich (Sep 4, 2010)

Not sure that building a custom kernel would take only 15-20 minutes. This is a 1Ghz P3 with 1GB of ram.  That's aside from all the time taken in configuring the custom kernel.


----------



## UNIXgod (Sep 5, 2010)

Is that 80% from 90% of the time. or is that with a margin of +-2% error. Statistically speaking of what devices need from the scsi subsystem should be properly documented which last I checked are. So your enthusiastically 'slimmer' is simply  a noob who hasn't taken the time to read the documentation. Also I believe at least 1% learn from their mistakes the first time failure occurs.

It is also documented why you would want to compile your own kernel. Read the documentation. It has always been suggested that you do. I don't believe that will change anytime soon.


----------



## davidgurvich (Sep 5, 2010)

I have read the documentation and don't see any hardware or software that needs modifications in the kernel to work on my system.  That leaves only one aspect that might be improved through building a custom kernel, speed.  

In prior releases the GENERIC kernel had multiple settings that caused unnecessary delays.  I haven't seen that in the 8.1-RELEASE.


----------

