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