Building a Kernel


If config(8) runs successfully, it will build a compilation directory including a Makefile and a whole slew of header files. The traditional place for this compile directory is under the appropriate platform directory, /usr/src/sys/arch/i386 in our case. There you'll find a directory named "compile." This directory contains a subdirectory for each kernel configuration that you have run config(8) on, each named after the kernel config file. For example, the OPENBSDTEST kernel configuration is in /usr/src/sys/arch/i386/compile/OPENBSDTEST.

If config(8) gave you any special instructions, obey them first. Then issue the following commands to build your kernel:

 # make depend 1 # make 2 # 

Each of these will take quite some time, and generate quite a lot of output. The 1 make depend command builds dependencies between the various objects that comprise the kernel. The 2 make command actually builds the binary that will become your kernel.

Build Errors

If your kernel fails to build, don't immediately despair. Chances are, you have a perfectly explicable error. First, read the message that the compile gives. Almost all the time, the error message you get explains what you need to do to get a successful kernel compile. Generally you need to change your kernel configuration in some way, because of an error that config(8) could not catch. Only rarely is the actual OpenBSD kernel code "uncompilable."

If you still cannot build the kernel, follow the support process discussed in Chapter 1. Remember, kernel compilation is not a standard practice in OpenBSD, and the support you will get is pretty minimal unless your error is obvious to someone else.




Absolute Openbsd(c) Unix for the Practical Paranoid
Absolute OpenBSD: Unix for the Practical Paranoid
ISBN: 1886411999
EAN: 2147483647
Year: 2005
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net