config(8)


Now that you have a configuration file, you can prepare to actually compile your kernel. You use config(8) for this. The config program will read your configuration file and prepare a kernel compilation area that contains all the necessary source code and other information to build your custom kernel. The syntax is extremely simple: Just enter "config" and the name of your kernel configuration file. For example, to config the OPENBSDTEST kernel file, just type this.

 # config OPENBSDTEST Don't forget to run "make depend" # 

If you see this, everything went correctly.

At times, config(8) will give you additional instructions. In particular, it may tell you that you must run make clean before trying to compile the kernel. Obey config(8); it doesn't issue those messages just to amuse itself! [2]

Config Errors

If, on the other hand, you made a mistake, you'll see something like this.

 # config OPENBSDTEST OPENBSDTEST:491: syntax error *** Stop. # 

The number is the line number where the error lies. I see this most often when I don't have a carriage return at the end of the last line of my configuration. The simplest way to avoid this problem is to put a single blank line at the end of the configuration file. If you have an error on some other line, then you've made a different error.

One common problem is misspelling the name of an option or device driver.

 # config OPENBSDTEST OPENBSDTEST:148: susbeep0: unknown device `susbeep' *** Stop. # 

In this case, you not only get the line number but the name of the unknown device or option. There is no "susbeep" device, but there certainly is a "sysbeep" device. Oops.

You might neglect to include some vital part of the system in your configuration. For example, if you have devices attached to a certain bus, but that bus is not in your kernel configuration, config(8) will complain. Loudly.

 # config OPENBSDTEST OPENBSDTEST:41: bios0 at mainbus0 is orphaned  (no mainbus0 declared) OPENBSDTEST:48: pci* at mainbus0 is orphaned  (no mainbus0 declared) *** Stop. # 

Here, the key to solving the problem is very straightforward: Read the error message. Most often, config will tell you outright when you have neglected to include something that another device depends on. In this example, I overenthusiastically commented out the mainbus declaration. Every device that claims to be plugged into the main bus is "orphaned," or unattached to anything.

The internal error checking performed by config(8) does not guarantee that your kernel will work as expected, or even compile. The only errors it catches are ones where the configuration is either internally inconsistent or just flat-out invalid. The first real test comes when you try to actually build your configured kernel.

[2]It waits until you reboot on the new kernel to be amused.




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