xref: /freebsd/usr.sbin/config/config.8 (revision 4cf49a43559ed9fdad601bdcccd2c55963008675)
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 BSD 4
38.Sh NAME
39.Nm config
40.Nd build system configuration files
41.Sh SYNOPSIS
42.Nm config
43.Op Fl gpr
44.Ar SYSTEM_NAME
45.Sh DESCRIPTION
46This is the old version of the
47.Nm
48program.
49It understands the old autoconfiguration scheme
50used on the HP300, i386, DECstation, and derivative platforms.
51The new version of config is used with the
52SPARC platform.
53Only the version of
54.Nm
55applicable to the architecture that you are running
56will be installed on your machine.
57.Pp
58.Nm Config
59builds a set of system configuration files from the file
60.Ar SYSTEM_NAME
61which describes
62the system to configure.
63A second file
64tells
65.Nm
66what files are needed to generate a system and
67can be augmented by configuration specific set of files
68that give alternate files for a specific machine
69(see the
70.Sx FILES
71section below).
72.Pp
73Available options and operands:
74.Pp
75.Bl -tag -width SYSTEM_NAME
76.It Fl g
77Configure a system for debugging.
78.It Fl p
79Configure a system for profiling; for example,
80.Xr kgmon 8
81and
82.Xr gprof 1 .
83If two or more
84.Fl p
85options are supplied,
86.Nm
87configures a system for high resolution profiling.
88.It Fl r
89Remove the old compile directory (see below).
90.It Ar SYSTEM_NAME
91Specifies the name of the system configuration file
92containing device specifications, configuration options
93and other system parameters for one system configuration.
94.El
95.Pp
96.Nm Config
97should be run from the
98.Pa conf
99subdirectory of the system source (usually
100.Pa /sys/ARCH/conf ) ,
101where
102.Pa ARCH
103represents one of the architectures supported by FreeBSD.
104.Nm Config
105creates the directory
106.Pa ../../compile/SYSTEM_NAME
107as necessary and place all output files there.
108If the directory already exists and the
109.Fl r
110flag was specified, it will be removed first.
111The output of
112.Nm
113consists of a number of files; for the
114.Tn i386 ,
115they are:
116.Pa ioconf.c ,
117a description
118of what I/O devices are attached to the system;
119.Pa vector.h ,
120definitions of
121macros related to counting interrupts;
122.Pa Makefile ,
123used by
124.Xr make 1
125in building the system;
126header files,
127definitions of
128the number of various devices that will be compiled into the system;
129so-called swap configuration files,
130definitions for
131the disk areas to be used for the root file system
132and system dumps.
133.Pp
134After running
135.Nm config ,
136it is necessary to run
137.Dq Li make depend
138in the directory where the new makefile
139was created.
140.Nm Config
141prints a reminder of this when it completes.
142.Pp
143If any other error messages are produced by
144.Nm config ,
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 BSD kernels compiled without symbols due to the heavy load on the
161system when compiling a
162.if n "debug"
163.if t ``debug''
164kernel.  A debug kernel contains complete symbols for all the source files, and
165enables an experienced kernel programmer to analyse the cause of a problem.  The
166debuggers available prior to 4.4BSD-Lite were able to find some information
167from a normal kernel;
168.Xr gdb 1
169provides very little support for normal kernels, and a debug kernel is needed
170for any meaningful analysis.
171.Pp
172For reasons of history, time and space, building a debug kernel is not the
173default with FreeBSD: a debug kernel takes up to 30% longer to build and
174requires about 30 MB of disk storage in the build directory, compared to about 6
175MB for a non-debug kernel.  A debug kernel is about 11 MB in size, compared to
176about 2 MB for a non-debug kernel.  This space is used both in the root file
177system and at run time in memory.  Use the
178.Fl g
179option to build a debug kernel.  With this option,
180.Nm
181causes two kernel files to be built in the kernel build directory:
182.Bl -bullet
183.It
184.Nm kernel.debug
185is the complete debug kernel.
186.It
187.Nm kernel
188is a copy of the kernel with the debug symbols stripped off.  This is equivalent
189to the normal non-debug kernel.
190.El
191.Pp
192There is currently little sense in installing and booting from a debug kernel,
193since the only tools available which use the symbols do not run on-line.  There
194are therefore two options for installing a debug kernel:
195.Bl -bullet
196.It
197.Nm make
198.Ar install
199installs
200.Nm kernel
201in the root file system.
202.It
203.Nm make
204.Ar install.debug
205installs
206.Nm kernel.debug
207in the root file system.
208.El
209.Sh FILES
210.Bl -tag -width /sys/i386/conf/Makefile.i386 -compact
211.It Pa /sys/conf/files
212list of common files system is built from
213.It Pa /sys/i386/conf/Makefile.i386
214generic makefile for the
215.Tn i386
216.It Pa /sys/i386/conf/files.i386
217list of
218.Tn i386
219specific files
220.It Pa /sys/i386/conf/files. Ns Em ERNIE
221list of files specific to
222.Em ERNIE
223system
224.It Pa /sys/compile/SYSTEM_NAME
225kernel build directory for system
226.Pa SYSTEM_NAME .
227.El
228.Sh SEE ALSO
229The SYNOPSIS portion of each device in section 4.
230.Rs
231.%T "Building 4.3 BSD UNIX System with Config"
232.Re
233.Sh BUGS
234The line numbers reported in error messages are usually off by one.
235.Sh HISTORY
236The
237.Nm
238command appeared in
239.Bx 4.1 .
240