12.7. Compile and Install a New Kernel

Use KERNCONF=CUSTOM to designate a custom kernel in both buildkernel and installkernel steps. Omit for a GENERIC kernel.

# cd /usr/src
# make buildkernel KERNCONF=CUSTOM
# make installkernel KERNCONF=CUSTOM

Many people find it useful to keep the kernel config file elsewhere and use a symbolic link from the appropriate directory. In this example using /usr/src/sys/i386/conf:

# cd /usr/src/sys/i386/conf
# ln -s /root/kernels/CUSTOM

This makes it easy to entirely remove /usr/src if ever necessary and not lose your kernel configurations.