]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/config/config.8
MFV r361936:
[FreeBSD/FreeBSD.git] / usr.sbin / config / config.8
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. 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 May 8, 2007
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 CVgp
40 .Op Fl I Ar path
41 .Op Fl d Ar destdir
42 .Op Fl s Ar srcdir
43 .Ar SYSTEM_NAME
44 .Nm
45 .Op Fl x Ar kernel
46 .Sh DESCRIPTION
47 The
48 .Nm
49 utility builds a set of system configuration files from the file
50 .Ar SYSTEM_NAME
51 which describes
52 the system to configure.
53 A second file
54 tells
55 .Nm
56 what files are needed to generate a system and
57 can be augmented by configuration specific set of files
58 that give alternate files for a specific machine
59 (see the
60 .Sx FILES
61 section below).
62 .Pp
63 Available options and operands:
64 .Bl -tag -width ".Ar SYSTEM_NAME"
65 .It Fl V
66 Print the
67 .Nm
68 version number.
69 .It Fl C
70 If the INCLUDE_CONFIG_FILE is present in a configuration file,
71 kernel image will contain full configuration files included
72 literally (preserving comments).
73 This flag is kept for backward compatibility.
74 .It Fl I Ar path
75 Search in
76 .Ar path
77 for any file included by the
78 .Ic include
79 directive.  This option may be specified more than once.
80 .It Fl d Ar destdir
81 Use
82 .Ar destdir
83 as the output directory, instead of the default one.
84 Note that
85 .Nm
86 does not append
87 .Ar SYSTEM_NAME
88 to the directory given.
89 .It Fl s Ar srcdir
90 Use
91 .Ar srcdir
92 as the source directory, instead of the default one.
93 .It Fl m
94 Print the MACHINE and MACHINE_ARCH values for this
95 kernel and exit.
96 .It Fl g
97 Configure a system for debugging.
98 .It Fl x Ar kernel
99 Print kernel configuration file embedded into a kernel
100 file.
101 This option makes sense only if
102 .Cd "options INCLUDE_CONFIG_FILE"
103 entry was present in your configuration file.
104 .It Fl p
105 Configure a system for profiling; for example,
106 .Xr kgmon 8
107 and
108 .Xr gprof 1 .
109 If two or more
110 .Fl p
111 options are supplied,
112 .Nm
113 configures a system for high resolution profiling.
114 .It Ar SYSTEM_NAME
115 Specify the name of the system configuration file
116 containing device specifications, configuration options
117 and other system parameters for one system configuration.
118 .El
119 .Pp
120 The
121 .Nm
122 utility should be run from the
123 .Pa conf
124 subdirectory of the system source (usually
125 .Pa /sys/ Ns Va ARCH Ns Pa /conf ) ,
126 where
127 .Va ARCH
128 represents one of the architectures supported by
129 .Fx .
130 The
131 .Nm
132 utility creates the directory
133 .Pa ../compile/ Ns Ar SYSTEM_NAME
134 or the one given with the
135 .Fl d
136 option
137 as necessary and places all output files there.
138 The output of
139 .Nm
140 consists of a number of files; for the
141 .Tn i386 ,
142 they are:
143 .Pa Makefile ,
144 used by
145 .Xr make 1
146 in building the system;
147 header files,
148 definitions of
149 the number of various devices that will be compiled into the system.
150 .Pp
151 The
152 .Nm
153 utility looks for kernel sources in the directory
154 .Pa ../..
155 or the one given with the
156 .Fl s
157 option.
158 .Pp
159 After running
160 .Nm ,
161 it is necessary to run
162 .Dq Li make depend
163 in the directory where the new makefile
164 was created.
165 The
166 .Nm
167 utility prints a reminder of this when it completes.
168 .Pp
169 If any other error messages are produced by
170 .Nm ,
171 the problems in the configuration file should be corrected and
172 .Nm
173 should be run again.
174 Attempts to compile a system that had configuration errors
175 are likely to fail.
176 .Sh DEBUG KERNELS
177 Traditional
178 .Bx
179 kernels are compiled without symbols due to the heavy load on the
180 system when compiling a
181 .Dq debug
182 kernel.
183 A debug kernel contains complete symbols for all the source files, and
184 enables an experienced kernel programmer to analyse the cause of a problem.
185 The
186 debuggers available prior to
187 .Bx 4.4 Lite
188 were able to find some information
189 from a normal kernel;
190 .Xr gdb 1
191 provides very little support for normal kernels, and a debug kernel is needed
192 for any meaningful analysis.
193 .Pp
194 For reasons of history, time and space, building a debug kernel is not the
195 default with
196 .Fx :
197 a debug kernel takes up to 30% longer to build and
198 requires about 30 MB of disk storage in the build directory, compared to about 6
199 MB for a non-debug kernel.
200 A debug kernel is about 11 MB in size, compared to
201 about 2 MB for a non-debug kernel.
202 This space is used both in the root file
203 system and at run time in memory.
204 Use the
205 .Fl g
206 option to build a debug kernel.
207 With this option,
208 .Nm
209 causes two kernel files to be built in the kernel build directory:
210 .Bl -bullet
211 .It
212 .Pa kernel.debug
213 is the complete debug kernel.
214 .It
215 .Pa kernel
216 is a copy of the kernel with the debug symbols stripped off.
217 This is equivalent
218 to the normal non-debug kernel.
219 .El
220 .Pp
221 There is currently little sense in installing and booting from a debug kernel,
222 since the only tools available which use the symbols do not run on-line.
223 There
224 are therefore two options for installing a debug kernel:
225 .Bl -bullet
226 .It
227 .Dq Li "make install"
228 installs
229 .Pa kernel
230 in the root file system.
231 .It
232 .Dq Li "make install.debug"
233 installs
234 .Pa kernel.debug
235 in the root file system.
236 .El
237 .Sh FILES
238 .Bl -tag -width ".Pa /sys/ Ns Va ARCH Ns Pa /compile/ Ns Ar SYSTEM_NAME" -compact
239 .It Pa /sys/conf/files
240 list of common files system is built from
241 .It Pa /sys/conf/Makefile. Ns Va ARCH
242 generic makefile for the
243 .Va ARCH
244 .It Pa /sys/conf/files. Ns Va ARCH
245 list of
246 .Va ARCH
247 specific files
248 .It Pa /sys/ Ns Va ARCH Ns Pa /compile/ Ns Ar SYSTEM_NAME
249 default kernel build directory for system
250 .Ar SYSTEM_NAME
251 on
252 .Va ARCH .
253 .El
254 .Sh SEE ALSO
255 .Xr config 5
256 .Pp
257 The
258 .Sx SYNOPSIS
259 portion of each device in section 4.
260 .Rs
261 .%T "Building 4.3 BSD UNIX System with Config"
262 .Re
263 .Sh HISTORY
264 The
265 .Nm
266 utility appeared in
267 .Bx 4.1 .
268 .Pp
269 Before support for
270 .Fl x
271 was introduced,
272 .Cd "options INCLUDE_CONFIG_FILE"
273 included entire configuration file that used to be embedded in
274 the new kernel.
275 This meant that
276 .Xr strings 1
277 could be used to extract it from a kernel:
278 to extract the configuration information, you had to use
279 the command:
280 .Pp
281 .Dl "strings -n 3 kernel | sed -n 's/^___//p'"
282 .Sh BUGS
283 The line numbers reported in error messages are usually off by one.