Skip to content

Build your own kernel of FreeBSD

Install source code

choose a release version of source code based on your arch, and download source code here or github.

wget https://download.freebsd.org/ftp/releases/amd64/amd64/13.0-RELEASE/src.txz
tar -C / -xvzf src.txz

Build kernel

may take a long while

cd /usr/src/sys/`uname -m`/conf
cp GENERIC MY_FIRST_BUILD
cd /usr/src
make buildkernel KERNCONF="MY_FIRST_BUILD"

Install new kernel

make installkernel KERNCONF="MY_FIRST_BUILD"
reboot

Verify new kernel

uname -a
uname -i

Reference

  • https://docs.freebsd.org/en/books/handbook/kernelconfig

Disclaimer
  1. License under CC BY-NC 4.0
  2. Copyright issue feedback me#imzye.me, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try iOS App