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 43.Op Fl gpr 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 Config 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 Fl r 97Remove the old compile directory (see below). 98.It Ar SYSTEM_NAME 99Specify the name of the system configuration file 100containing device specifications, configuration options 101and other system parameters for one system configuration. 102.El 103.Pp 104.Nm Config 105should be run from the 106.Pa conf 107subdirectory of the system source (usually 108.Pa /sys/ARCH/conf ) , 109where 110.Pa ARCH 111represents one of the architectures supported by 112.Fx . 113.Nm Config 114creates the directory 115.Pa ../../compile/SYSTEM_NAME 116or the one given with the 117.Fl d 118option 119as necessary and places all output files there. 120If the output directory already exists and the 121.Fl r 122flag was specified, it will be removed first. 123The output of 124.Nm 125consists of a number of files; for the 126.Tn i386 , 127they are: 128.Pa ioconf.c , 129a description 130of what I/O devices are attached to the system; 131.Pa Makefile , 132used by 133.Xr make 1 134in building the system; 135header files, 136definitions of 137the number of various devices that will be compiled into the system. 138.Pp 139After running 140.Nm , 141it is necessary to run 142.Dq Li make depend 143in the directory where the new makefile 144was created. 145.Nm Config 146prints a reminder of this when it completes. 147.Pp 148If any other error messages are produced by 149.Nm , 150the problems in the configuration file should be corrected and 151.Nm 152should be run again. 153Attempts to compile a system that had configuration errors 154are likely to fail. 155.Pp 156If the option "INCLUDE_CONFIG_FILE" is used in the configuration file the 157entire input file is embedded in the new kernel. This means that 158.Xr strings 1 159can be used to extract it from a kernel: 160to extract the configuration information, use the command 161.Bd -literal 162strings kernel | grep ___ 163.Ed 164.Sh DEBUG KERNELS 165Traditional BSD kernels compiled without symbols due to the heavy load on the 166system when compiling a 167.Dq debug 168kernel. A debug kernel contains complete symbols for all the source files, and 169enables an experienced kernel programmer to analyse the cause of a problem. The 170debuggers available prior to 4.4BSD-Lite were able to find some information 171from a normal kernel; 172.Xr gdb 1 173provides very little support for normal kernels, and a debug kernel is needed 174for any meaningful analysis. 175.Pp 176For reasons of history, time and space, building a debug kernel is not the 177default with 178.Fx : 179a debug kernel takes up to 30% longer to build and 180requires about 30 MB of disk storage in the build directory, compared to about 6 181MB for a non-debug kernel. A debug kernel is about 11 MB in size, compared to 182about 2 MB for a non-debug kernel. This space is used both in the root file 183system and at run time in memory. Use the 184.Fl g 185option to build a debug kernel. With this option, 186.Nm 187causes two kernel files to be built in the kernel build directory: 188.Bl -bullet 189.It 190.Nm kernel.debug 191is the complete debug kernel. 192.It 193.Nm kernel 194is a copy of the kernel with the debug symbols stripped off. This is equivalent 195to the normal non-debug kernel. 196.El 197.Pp 198There is currently little sense in installing and booting from a debug kernel, 199since the only tools available which use the symbols do not run on-line. There 200are therefore two options for installing a debug kernel: 201.Bl -bullet 202.It 203.Nm make 204.Ar install 205installs 206.Nm kernel 207in the root file system. 208.It 209.Nm make 210.Ar install.debug 211installs 212.Nm kernel.debug 213in the root file system. 214.El 215.Sh FILES 216.Bl -tag -width /sys/i386/conf/Makefile.i386 -compact 217.It Pa /sys/conf/files 218list of common files system is built from 219.It Pa /sys/i386/conf/Makefile.i386 220generic makefile for the 221.Tn i386 222.It Pa /sys/i386/conf/files.i386 223list of 224.Tn i386 225specific files 226.It Pa /sys/i386/conf/files. Ns Em ERNIE 227list of files specific to 228.Em ERNIE 229system 230.It Pa /sys/compile/SYSTEM_NAME 231default kernel build directory for system 232.Pa SYSTEM_NAME . 233.El 234.Sh SEE ALSO 235The 236.Sx SYNOPSIS 237portion of each device in section 4. 238.Rs 239.%T "Building 4.3 BSD UNIX System with Config" 240.Re 241.Sh BUGS 242The line numbers reported in error messages are usually off by one. 243.Sh HISTORY 244The 245.Nm 246command appeared in 247.Bx 4.1 . 248