>If you have modified your kernel configuration, or if you have written a new one, you will want to test it before making it the default kernel for booting. Especially if you don’t have physical access to the console.
This is how you accomplish this:
cd /usr/src
sudo
make buildkernel KERNCONF=MYKERNEL
sudo make installkernel KERNCONF=MYKERNEL KODIR=/boot/testkernel
sudo nextboot -k testkernel
For more information, check out:
- FreeBSD Handbook, section 8.3: Building and installing a custom kernel
- FreeBSD Handbook, section 8.5: If something goes wrong
- the /usr/src/UPDATING file (search for nextboot)
If it works, make the testkernel the default, and make the previous kernel the backup:
cd /boot
sudo rm -rf kernel.old
sudo mv kernel kernel.old
sudo mv testkernel kernel