Guide on how to compile the FreeBSD kernel.
Sometimes you may find yourself in need to recompile the freebsd kernel either to add features and or devices or perhaps the opposite to remove unused devices and or features in order for the kernel take up less memory.
Now I don’t really have any memory issues on my machines but I’m still removing unused devices in order to save memory. I guess it’s just an old habit of mine that keeps sticking with me.
What I do compile into the kernel though is Disk Quota so that I can control the hard disk usage of the users on the system.
Now adding Disk Quota usually has nothing to do with for example quota on e-mail. Quota management on e-mail is normally done through the software installed along with the MTA.
If you followed my guide on how to install FreeBSD you should have a system with Kernel Sources installed and be ready to go. The procedure is quite easy and straight forward.
The compilation time varies from minutes to very long time depending on your systems hardware configuration.
For this guide replace “NEWKERNELNAME” with a real name you want to use.
You may wish to rename you kernel to something unique other than GENERIC. It is custom to write kernel names in all CAPITAL letters.
In order to add Disk Quota add the following line to the new kernel.
This will enable Disk Quota on the system.
Next step is to compile the new kernel so lets do just that.
Now this will take a considerable amount of time. So you might as well grab yourself some dinner or go watch television. If you encounter any errors correct them and run the above step again until all errors are gone.
Once it completes without errors you are ready to install the new kernel.