ObjectiveGenerating a custom -current memstick image without all the debug feature enabled.
PrerequisiteHave the head source installed (I will use /usr/src as example).
If not, here is an example for synchronizing up-to-date head (-current) sources on /usr/src
svn co svn://svn.freebsd.org/base/head /usr/src
Customizing kernel configuration file-current kernel have lot's of extra debug features enabled and I need netmap: Then I will create a customized kernel configuration file.
cat > /usr/src/sys/amd64/conf/PROD <<EOF
Customizing build compilation optionsThere is still another debug feature to disable on -current:
echo "MALLOC_PRODUCTION=yes" > /etc/src.conf
Building world and kernelNew we start the classical building of world and our customized kernel.
For information this step takes about 4 hours on my PC.
make buildworld; make buildkernel KERNCONF=PROD
Generating install media imageLast step: Generating the install media.
Here is an example for generating memstick install media without port tree (long live to pkgng! neither doc):
make -DNOPORTS -DNODOC memstick
Replace "memstick" by "cdrom" (bootonly.iso and release.iso) or "ftp" for other media.
You can add a -DNOSRC option for avoiding to include sources too on the media.
Then copy the image to your usb key:
dd if=memstick of=/dev/da0 bs=64k
Cleaning your messYour system has lot's of file that you don't need anymore, here is how to clean it: