CONFIG(8)
π CONFIG(8) β like, the whole manual page, bestie
okay so real quick β this is the config page from section 8 of the System Manager's Manual, and it's genuinely one of those "quietly runs everything" tools. bucket get it.
β¨ NAME β¨
config β builds system configuration files π οΈ
πΈ SYNOPSIS πΈ
config [-CVgpv] [-I path] [-d destdir] [-s srcdir] SYSTEM_NAME
config [-x kernel]
π DESCRIPTION π
So config takes the file SYSTEM_NAME β which is literally the file describing the system you're trying to configure β and builds a whole set of system configuration files out of it. iconic behaviour honestly.
Then there's a second file that tells config which files are needed to generate a system, and that one can be augmented by a configuration-specific set of files that give alternate files for a specific machine (peep the βFILESβ section below, iykyk π).
Here's everything it takes β options and operands, no skips:
-Vβ prints theconfigversion number. cute little flex.-Cβ ifINCLUDE_CONFIG_FILEis present in a configuration file, the kernel image will contain the full configuration files included literally (preserving comments). heads up though: this flag is kept for backward compatibility. legacy queen π-I pathβ searches inpathfor any file included by theincludedirective. and yes bestie, you can pass this more than once. stack 'em.-d destdirβ usesdestdiras the output directory instead of the default one. β οΈ important:configdoes not appendSYSTEM_NAMEto the directory you give it. so like, don't expect it to.-s srcdirβ usessrcdiras the source directory instead of the default one.-mβ prints theMACHINEandMACHINE_ARCHvalues for this kernel and exits. in and out, no small talk.-gβ configures a system for debugging. we love a debugging moment.-x kernelβ prints the kernel configuration file embedded into a kernel file. this only makes sense if theoptions INCLUDE_CONFIG_FILEentry was present in your configuration file. no entry, no dice.-vβ turns on verbose output. yap mode: enabled π£οΈSYSTEM_NAMEβ specifies the name of the system configuration file containing device specifications, configuration options and other system parameters for one system configuration. that's the main character argument.
Right, so where do you run this? config should be run from the conf subdirectory of the system source β usually /sys/ARCH/conf β where ARCH represents one of the architectures supported by FreeBSD.
The utility creates the directory ../compile/SYSTEM_NAME, or the one you gave it with -d, as necessary, and places all the output files there. the output of config is a number of files; for the i386, they are: Makefile, used by make(1) in building the system, and header files β definitions of the number of various devices that will be compiled into the system. πβ¨
config looks for kernel sources in the directory ../.., or the one given with the -s option.
after runningconfig, you have to runmake dependin the directory where the new makefile was created.configprints a reminder of this when it completes, so don't say nobody told you π«Ά
And if config throws any other error messages? fix the problems in the configuration file and run config again. attempts to compile a system that had configuration errors are likely to fail β like, likely fail. don't do that to yourself π
π¦ DEBUG KERNELS π¦
okay history lesson, buckle up. traditional BSD kernels are compiled without symbols, because of the heavy load on the system when compiling a βdebugβ kernel. a debug kernel contains complete symbols for all the source files, and lets an experienced kernel programmer analyse the cause of a problem. the debuggers available prior to 4.4BSD-Lite could find some information from a normal kernel; gdb(1) (ports/devel/gdb) provides very little support for normal kernels, so a debug kernel is needed for any meaningful analysis. no cap.
for reasons of history, time and space, building a debug kernel is not the default with FreeBSD. here's the receipts:
- a debug kernel takes up to 30% longer to build β³
- and requires about 30 MB of disk storage in the build directory, compared to about 6 MB for a non-debug kernel
- a debug kernel is about 11 MB in size, compared to about 2 MB for a non-debug kernel
- this space is used both in the root file system and at run time in memory π
use the -g option to build a debug kernel. with this option, config causes two kernel files to be built in the kernel build directory:
kernel.debugis the complete debug kernel. the full deluxe edition πkernelis a copy of the kernel with the debug symbols stripped off. this is equivalent to the normal non-debug kernel.
there is currently little sense in installing and booting from a debug kernel, since the only tools available which use the symbols do not run on-line. so you've got two options for installing a debug kernel:
- β
make installβ installskernelin the root file system. - β
make install.debugβ installskernel.debugin the root file system.
pick your fighter π₯
π FILES π
/sys/conf/filesβ list of common files system is built from/sys/conf/Makefile.ARCHβ generic makefile for theARCH/sys/conf/files.ARCHβ list ofARCHspecific files/sys/ARCH/compile/SYSTEM_NAMEβ default kernel build directory for systemSYSTEM_NAMEonARCH.
π SEE ALSO π
config(5)- The βSYNOPSISβ portion of each device in section 4.
- S. J. Leffler and M. J. Karels, βBuilding 4.3 BSD UNIX System with Configβ, 4.4BSD System Manager's Manual (SMM).
β HISTORY β
config appeared in 4.1BSD. ancestor behaviour fr.
before support for -x was introduced, options INCLUDE_CONFIG_FILE included the entire configuration file that used to be embedded in the new kernel. this meant strings(1) could be used to extract it from a kernel. to extract the configuration information, you had to use this command:
strings -n 3 kernel | sed -n 's/^___//p'
look at that little pipeline. vintage π
π BUGS π
the line numbers reported in error messages are usually off by one. that's it, that's the bug. not me getting gaslit by an off-by-one ππ
okay that's the whole page, bestie β every flag, every path, every number, every bug, preserved and slayed. this one's from the Debian crew, dated April 9, 2021, and it's the CONFIG(8) page from the System Manager's Manual. mwah π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: config 15.0.0
- Copyright (c) 1980, 1991, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms