© 2011 Warren Block

Last updated 2011-05-30

Available in HTML or PDF. Links to all my articles here. Created with AsciiDoc.

Including the GENERIC kernel config file can make customizations easier.


Building a custom kernel for FreeBSD has never been particularly difficult. In the old days, we’d copy GENERIC to another file and start modifying it. The new custom config file had to be periodically compared to GENERIC, or changes in newer versions of GENERIC would be missed. The initial customization meant going through the copied file and removing all the things that weren’t needed, and modifying those that were needed.

Including GENERIC

Today there’s a better way to make a customized kernel config file. By including GENERIC into the custom config, updates are brought in automatically. The user’s customizations become a diff against GENERIC. It’s much like the way /etc/defaults/rc.conf is read at boot, then overridden by settings in /etc/rc.conf, or how properties and methods of an object can be overridden with a subclass.

How It Works

A short sample:

include GENERIC
nocpu   i486_CPU

nooptions       INET6
nooptions       WITNESS
nooptions       INVARIANTS

nodevice        eisa

nodevice        fdc

device          ahci

The GENERIC kernel is included, support for 486 processors is disabled, then ident is overridden with the new kernel name. nooptions and nodevice are used to turn off things that GENERIC enables but are not wanted in SUPERKERNEL. The ahci device that GENERIC does not include is then added.

The kernel built from this file will be the same as that built from GENERIC, but with these added customizations. The next time SUPERKERNEL is built, it will include the current version of GENERIC without the user having to do anything extra.

More Information