📄 pmoncfg.8
字号:
.\" $OpenBSD: config.8,v 1.23 2000/08/08 21:42:40 deraadt Exp $.\" $NetBSD: config.8,v 1.10 1996/08/31 20:58:16 mycroft Exp $.\".\" Copyright (c) 1980, 1991, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" from: @(#)config.8 8.2 (Berkeley) 4/19/94.\".Dd October 15, 1999.Dt CONFIG 8.Os.Sh NAME.Nm config.Nd "build kernel compilation directories or modify a kernel".Sh SYNOPSIS.Nm config.Op Fl b Ar builddir.Op Fl s Ar srcdir.Op Fl p.Op Ar config-file.Nm config.Fl e.Op Fl f | Fl o Ar outfile.Op Fl u.Ar infile.Sh DESCRIPTIONIn the first synopsis form, the.Nmprogram creates a kernel build directory from the kernel configuration filespecified by.Ar config-file .In the second synopsis form,.Nmallows editing of the kernel binary specified by.Ar infile ..PpFurthermore, devices may be enabled, disabled, or modified withoutrecompiling, by editing the kernel executable using the.Fl eoption.Similarily, you can do the same editing at boot-time, usingthe in-kernel editor, as described in.Xr boot_config 8 ) ..Pp.Nmis most commonly invoked from the directory containing.Oxkernel configuration files (i.e.,.Pa /sys/arch/i386/conffor i386 machines).For instance, the following steps would be followed to configure and compilea new GENERIC kernel (assuming a complete kernel source tree is available in.Pa /sys ) :.Bd -literal -offset indent# cd /sys/arch/i386/conf# config ./GENERIC# cd ../compile/GENERIC# make depend && make.Ed.PpReplace.Dq i386with the appropriate architecture name..PpThe options are as follows:.Bl -tag -width Ds.It Fl eAllows the modification of kernel device configuration (see.Xr boot_config 8 ) .Temporary changes can be made to the running kernel's configuration or a newkernel binary may be written for permanent changes between system reboots.See the section.Sx Kernel modificationbelow for more details..It Fl fOverwrite the.Ar infilekernel binary with the modified kernel.Otherwise,.Fl oshould be given to specify an alternate output file..It Fl o Ar outfileWrite the modified kernel to.Ar outfile ..It Fl uCheck to see if the kernel configuration was modified at boot-time(i.e.,.Cm boot -cwas used).If so, compare the running kernel with the kernel to be edited.Pq Ar infile .If they seem to be the same, apply all configuration changes performed atboot..It Fl b Ar builddirCreate the build directory in the path specified by.Ar builddirinstead of the default.Pa ../compile/SYSTEMNAME ..It Fl s Ar srcdirUse.Ar srcdiras the top-level kernel source directory instead of the default (fourdirectories above the build directory)..It Fl pConfigure for a system that includes profiling code; see.Xr kgmon 8and.Xr gprof 1 .When this option is specified,.Nmacts as if the lines.Dq makeoptions PROF="-pg"and.Dq options GPROFappeared in the specified kernel configuration file.In addition,.Dq .PROFis appended to the default compliation directory name..PpThe.Fl pflag is expected to be used for.Dq one-shotprofiles of existing systems; for regular profiling, it is probably wiser tomake a separate configuration containing the makeoptions line..El.PpThe old.Fl gflag is deprecated and no longer supported.Instead, add.Dq makeoptions DEBUG="-g"to the kernel configuration file, along with (typically).Dq options KGDB ..PpThe output of.Nmconsists of a number of files, principally.Pa ioconf.c(a description of I/O devices that may be attached to the system)and a.Pa Makefile ,used by.Xr make 1when building the kernel..PpAfter running.Nmit is wise to run.Dq make dependin the new build directory..Nmprints a reminder of this when it completes..PpIf.Nmstops due to errors, the problems reported should be corrected and.Nmshould be run again..Nmattempts to avoid changing the compilation directory if there areconfiguration errors, but this code is not well-tested and some problems(such as running out of disk space) are unrecoverable..PpIf.Ar config-fileis not specified,.Nmuses the current directory as the build directory, and looks in it fora file called.Pa CONFIG .If you run.Nmthis way, you must specify the location of the top-level kernel sourcedirectory using the.Fl soption or by using the.Dq Li sourcedirective at the beginning of the system configuration file..PpThe configuration files consists of various statements whichinclude the following:.Pp.Bl -tag -offset indent -width indent.It machine Ar varRequired.Specifies the machine architecture..It include Ar fileInclude another configuration file..It option Ar nameSet a kernel option.Kernel options may take either the form.Ar NAMEor the form.Ar NAME=value .These options are passed to the compiler with the.Fl Dflag..It rmoption Ar nameDelete a previously set option.This is useful when including another kernel configuration file.A typical use is to include the.Va GENERICkernel provided with each release and remove options that areunwanted, thus allowing for automatic inclusion of new devicedrivers..It maxusers Ar numberRequired.Used to size various system tables and maximum operating conditionsin an approximate fashion.Multiple instances of this keyword may be specified.The number provided in the last instance will be used, andwarnings will be printed for each duplicate value.This is convenient when used with the.Va includedirective..It config Ar bsd root on "dev [swap on dev [and dev ...]] [dump on dev [and dev ...]]"Required.Specifies the swap and dump devices which the system should use..It config Ar bsd swap genericOtherwise, if generic is specified, the system follows generic routines todevice what should happen..El.PpMany other statements exist, and the file format is fairly rich; for moreinformation see the various configuration files included in the system..Pp.Ss Kernel modificationWhen.Fl eis specified, device parameters that are normally hard-coded into the kernelmay be changed.This is useful to avoid the need for kernel recompilation or rebooting.Modifications are made to the currently running kernel and can be written toa new kernel binary so changes are preserved during subsequent system restarts..PpWhen invoked, the kernel identification is first shown..Pp.Bd -literal.Li #\ Ic config Fl e o Ar bsd.new /bsdOpenBSD 2.6-beta (GENERIC.rz0) #0: Mon Oct 4 03:57:22 MEST 1999 root@winona:/usr/src/sys/arch/pmax/compile/GENERIC.rz0Enter 'help' for informationukc>.Ed.PpOne or more warnings may be printed before the.Li ukc>prompt..Bd -literal -offset indentwarning: no output file specified.Ed.PpNeither the.Fl fnor.Fl ooption has been specified.Changes will be ignored..Pp.Bd -literal -offset indentWARNING this kernel doesn't contain all information needed!WARNING the commands add and change might not work..Ed.PpThe kernel is too old (pre.Ox 2.6 )and cannot support all of the functionality needed by the.Fl eoption..Pp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -