This episode covers development and customization: building the base system with make buildworld and buildkernel, installing with make installkernel, binary updates with dragonfly-update, plus writing a custom kernel config in /usr/src/sys.

In episode 19 you designed production storage with multi-volume HAMMER2. Now we take full control of the system: building DragonFlyBSD from source. This is the moment when you're no longer just a user — you become a builder.
Remember in episode 2: the base system is one source tree that can be fully rebuilt. Episode 20 makes that a reality. You'll run make buildworld and make buildkernel, install the results, write a custom kernel config, and use binary updates for the faster path.
It all starts with the source tree. If you don't have it yet, clone it from git:
git clone git://git.dragonflybsd.org/dragonfly /usr/src
cd /usr/src
git checkout DragonFly_RELEASE_6_4buildworld builds the entire userland — shell, libraries, utilities — from source:
cd /usr/src
make buildworld -j4The -j4 flag runs 4 parallel jobs — use as many as you have cores. This process takes a long time (minutes to hours depending on the machine), so run it in a session that won't easily disconnect (tmux/screen) and make sure you have enough disk space.
buildkernel builds the kernel:
make buildkernel -j4By default it builds the GENERIC kernel. For a custom kernel, specify it with KERNCONF:
make buildkernel KERNCONF=DRAGONFLY -j4After a successful build, install the kernel first:
make installkernel KERNCONF=DRAGONFLYThen install world and reboot:
make installworld
shutdown -r nowDanger
Installing the kernel and world is an operation that changes the core system. Always back up the active kernel (cp /boot/kernel/kernel /boot/kernel.old or keep the previous kernel) and never install world before the kernel is proven to boot. One wrong step can produce a system that won't boot.
Cleaning up build artifacts:
make cleanworld
make cleankernelBuilding from source gives full control but is slow. For fast updates, DragonFlyBSD provides dragonfly-update — a binary update that downloads a ready-made base system:
dragonfly-updateThis tool downloads the latest release, verifies integrity, and prepares the upgrade. It's the recommended path for production servers that just need an up-to-date base system without compilation.
Kernel configuration files live in /usr/src/sys/config:
ls /usr/src/sys/configCreate a custom kernel by copying the default:
cd /usr/src/sys/config
cp GENERIC DRAGONFLY
vi DRAGONFLYInside the config file, you register devices and options. Here's a realistic snippet:
ident DRAGONFLY
options SMP
options INET6
device em
device igb
device nvmm
device hammer2ident names the kernel, options enables kernel-wide features, device registers drivers. Remove unused devices for a leaner kernel and faster builds.
A new kernel is installed in /boot/kernel/. Select a kernel at boot via the loader:
uname -a
nextboot -k /boot/kernel/kernel
shutdown -r nownextboot sets the kernel for the next boot only — ideal for testing. Once the new kernel is stable, loaderboot or the kernel setting in /boot/loader.conf makes it the default.
In this episode 20 you mastered the DragonFlyBSD build system: building the userland with make buildworld, the kernel with make buildkernel, installing with make installkernel and make installworld, using binary updates with dragonfly-update, and writing a custom kernel config in /usr/src/sys/config.
Key takeaways:
make buildworld and make buildkernel -j4 build the base system from source in /usr/src.make installkernel then make installworld, with a backup kernel before upgrading.dragonfly-update provides fast base system binary updates for production.cp GENERIC DRAGONFLY in /usr/src/sys/config.nextboot -k tests a new kernel for one boot before making it the default.In the next episode, episode 21, we look to the future: DragonFlyBSD 6.4 & roadmap. You'll explore the 6.4.2 features — NVMM improvements, experimental HAMMER2 remote mounting, amdgpu driver updates, and bug fixes — then look at the direction of the 7.0 release and binary update practices with dfupdate.