1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)config.8 8.2 (Berkeley) 4/19/94 33.\" $FreeBSD$ 34.\" 35.Dd April 19, 1994 36.Dt CONFIG 8 37.Os 38.Sh NAME 39.Nm config 40.Nd build system configuration files 41.Sh SYNOPSIS 42.Nm 43.Op Fl gp 44.Op Fl d Ar destdir 45.Ar SYSTEM_NAME 46.Sh DESCRIPTION 47This is the old version of the 48.Nm 49program. 50It understands the old autoconfiguration scheme 51used on the HP300, i386, DECstation, and derivative platforms. 52The new version of config is used with the 53SPARC platform. 54Only the version of 55.Nm 56applicable to the architecture that you are running 57will be installed on your machine. 58.Pp 59.Nm 60builds a set of system configuration files from the file 61.Ar SYSTEM_NAME 62which describes 63the system to configure. 64A second file 65tells 66.Nm 67what files are needed to generate a system and 68can be augmented by configuration specific set of files 69that give alternate files for a specific machine 70(see the 71.Sx FILES 72section below). 73.Pp 74Available options and operands: 75.Bl -tag -width SYSTEM_NAME 76.It Fl d Ar destdir 77Use 78.Ar destdir 79as the output directory, instead of the default one. 80Note 81that config does not append 82.Ar SYSTEM_NAME 83to the directory given. 84.It Fl g 85Configure a system for debugging. 86.It Fl p 87Configure a system for profiling; for example, 88.Xr kgmon 8 89and 90.Xr gprof 1 . 91If two or more 92.Fl p 93options are supplied, 94.Nm 95configures a system for high resolution profiling. 96.It Ar SYSTEM_NAME 97Specify the name of the system configuration file 98containing device specifications, configuration options 99and other system parameters for one system configuration. 100.El 101.Pp 102.Nm 103should be run from the 104.Pa conf 105subdirectory of the system source (usually 106.Pa /sys/ARCH/conf ) , 107where 108.Pa ARCH 109represents one of the architectures supported by 110.Fx . 111.Nm 112creates the directory 113.Pa ../compile/SYSTEM_NAME 114or the one given with the 115.Fl d 116option 117as necessary and places all output files there. 118The output of 119.Nm 120consists of a number of files; for the 121.Tn i386 , 122they are: 123.Pa ioconf.c , 124a description 125of what I/O devices are attached to the system; 126.Pa Makefile , 127used by 128.Xr make 1 129in building the system; 130header files, 131definitions of 132the number of various devices that will be compiled into the system. 133.Pp 134After running 135.Nm , 136it is necessary to run 137.Dq Li make depend 138in the directory where the new makefile 139was created. 140.Nm 141prints a reminder of this when it completes. 142.Pp 143If any other error messages are produced by 144.Nm , 145the problems in the configuration file should be corrected and 146.Nm 147should be run again. 148Attempts to compile a system that had configuration errors 149are likely to fail. 150.Pp 151If the option "INCLUDE_CONFIG_FILE" is used in the configuration file the 152entire input file is embedded in the new kernel. This means that 153.Xr strings 1 154can be used to extract it from a kernel: 155to extract the configuration information, use the command 156.Bd -literal 157strings kernel | grep ___ 158.Ed 159.Sh DEBUG KERNELS 160Traditional 161.Bx 162kernels compiled without symbols due to the heavy load on the 163system when compiling a 164.Dq debug 165kernel. A debug kernel contains complete symbols for all the source files, and 166enables an experienced kernel programmer to analyse the cause of a problem. The 167debuggers available prior to 168.Bx 4.4 Lite 169were able to find some information 170from a normal kernel; 171.Xr gdb 1 172provides very little support for normal kernels, and a debug kernel is needed 173for any meaningful analysis. 174.Pp 175For reasons of history, time and space, building a debug kernel is not the 176default with 177.Fx : 178a debug kernel takes up to 30% longer to build and 179requires about 30 MB of disk storage in the build directory, compared to about 6 180MB for a non-debug kernel. A debug kernel is about 11 MB in size, compared to 181about 2 MB for a non-debug kernel. This space is used both in the root file 182system and at run time in memory. Use the 183.Fl g 184option to build a debug kernel. With this option, 185.Nm 186causes two kernel files to be built in the kernel build directory: 187.Bl -bullet 188.It 189.Nm kernel.debug 190is the complete debug kernel. 191.It 192.Nm kernel 193is a copy of the kernel with the debug symbols stripped off. This is equivalent 194to the normal non-debug kernel. 195.El 196.Pp 197There is currently little sense in installing and booting from a debug kernel, 198since the only tools available which use the symbols do not run on-line. There 199are therefore two options for installing a debug kernel: 200.Bl -bullet 201.It 202.Nm make 203.Ar install 204installs 205.Nm kernel 206in the root file system. 207.It 208.Nm make 209.Ar install.debug 210installs 211.Nm kernel.debug 212in the root file system. 213.El 214.Sh FILES 215.Bl -tag -width /sys/ARCH/compile/LOCAL -compact 216.It Pa /sys/conf/files 217list of common files system is built from 218.It Pa /sys/conf/Makefile.ARCH 219generic Makefile for the 220.Pa ARCH . 221.It Pa /sys/conf/files.ARCH 222list of 223.Pa ARCH 224specific files 225.It Pa /sys/ARCH/compile/LOCAL 226default kernel build directory for system 227.Pa LOCAL 228on 229.Pa ARCH . 230.El 231.Sh SEE ALSO 232The 233.Sx SYNOPSIS 234portion of each device in section 4. 235.Rs 236.%T "Building 4.3 BSD UNIX System with Config" 237.Re 238.Sh BUGS 239The line numbers reported in error messages are usually off by one. 240.Sh HISTORY 241The 242.Nm 243command appeared in 244.Bx 4.1 . 245