Building a Custom Kernel

This page describes the procedure for building a custom FreeBSD kernel. Before performing this procedure, you should review the FreeBSD Handbook article Building and Installing a Custom Kernel.

If your sources have been updated since your last ‘make world’ (or since installation if you haven’t done a ‘make world’ yet), you should follow the steps listed in the Make World cheat sheet instead of this procedure.

  1. Start with a copy of the GENERIC kernel’s configuration file:
  2. # cd /usr/src/sys/i386/conf
    # cp GENERIC YOURKERNEL

  3. Edit the configuration file as required for the installed hardware. Remember, /usr/src/sys/i386/conf/NOTES is your friend!
  4. Compile and install the new kernel:
  5. # cd /usr/src
    # make buildkernel KERNCONF=YOURKERNEL

    # make installkernel KERNCONF=YOURKERNEL

  6. Reboot the machine and cross your fingers.
  7. # shutdown -r now

Leave a Reply

Your email address will not be published. Required fields are marked *