|CONFIG(8)||System Manager's Manual||CONFIG(8)|
configprogram creates a kernel build directory from the kernel configuration file specified by config-file. In the second synopsis form,
configallows editing of the kernel binary specified by infile. Devices may be enabled, disabled, or modified without recompiling, by editing the kernel executable. Similarly, the same editing can be done at boot-time, using the in-kernel editor, as described in boot_config(8). For kernel building, the options are as follows:
configacts as if the lines “makeoptions PROF="-pg"” and “option GPROF” appeared in the specified kernel configuration file. In addition, “.PROF” is appended to the default compilation directory name. The
-pflag is expected to be used for “one-shot” profiles of existing systems; for regular profiling, it is probably wiser to make a separate configuration containing the makeoptions line.
-oshould be given to specify an alternate output file.
boot -cwas used). If so, compare the running kernel with the kernel to be edited (infile). If they seem to be the same, apply all configuration changes performed at boot. Using this option requires read access to /dev/mem, which may be restricted based upon the value of the kern.allowkmem sysctl(8).
configconsists of a number of files, principally ioconf.c (a description of I/O devices that may be attached to the system) and a Makefile, used by make(1) when building the kernel. If
configstops due to errors, the problems reported should be corrected and
configshould be run again.
configattempts to avoid changing the compilation directory if there are configuration errors, but this code is not well-tested and some problems (such as running out of disk space) are unrecoverable. If config-file is not specified,
configuses the current directory as the build directory, and looks in it for a file called CONFIG. If
configis run this way, the location of the top-level kernel source directory must be specified using the
-soption or by using the “
source” directive at the beginning of the system configuration file. The configuration files consists of various statements which include the following:
bsd root ondev [
swap ondev [
bsd swap generic
-eis specified, device parameters that are normally hard-coded into the kernel may 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 to a new kernel binary so changes are preserved during subsequent system restarts. When invoked, the kernel identification is first shown.
# config -e -o bsd.new /bsd OpenBSD 5.3-current (GENERIC.MP) #91: Mon Mar 25 16:43:17 MDT 2013 firstname.lastname@example.org:/usr/src/sys/arch/i386/compile/GENERIC.MP Enter 'help' for information ukc>
warning: no output file specified
-ooption has been specified. Changes will be ignored.
WARNING kernel mismatch. -u ignored. WARNING the running kernel version:
configdoes not believe the running kernel is the same as the infile specified. Since the log of changes (from
boot -c) in the running kernel is kernel-specific, the
-uoption is ignored. The commands are as follows:
changedevno | dev
disableattr val | devno | dev
enableattr val | devno | dev
finddevno | dev
find ne24 ne0 at isa0 port 0x240 size 0 iomem 0xd8000 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0 25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 26 ne* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0 27 ne* at pci* dev -1 function -1 flags 0x0 28 ne* at pcmcia* function -1 irq -1 flags 0x0 ukc>
changecommand. The device can be specified by either name or number.
change ne125 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 change (y/n) ?
yport [0x300] ? size  ? iomem [-1] ? iosiz  ? irq  ?
5drq [-1] ? drq2 [-1] ? flags  ? 25 ne1 changed 25 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 5 drq -1 drq2 -1 flags 0x0 ukc>
disable port 0x30025 ne1 disabled 72 we1 disabled 75 el0 disabled 77 ie1 disabled
showcommand is useful for finding which devices have a certain attribute. It can also be used to find those devices with a particular value for an attribute.
show slot2 ahc* at eisa0 slot -1 10 uha* at eisa0 slot -1 12 ep0 at eisa0 slot -1 17 ep* at eisa0 slot -1 102 ahb* at eisa0 slot -1 103 fea* at eisa0 slot -1 ukc>
show port 0x30025 ne1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 72 we1 at isa0 port 0x300 size 0 iomem 0xcc000 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 75 el0 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 9 drq -1 drq2 -1 flags 0x0 77 ie1 at isa0 port 0x300 size 0 iomem -1 iosiz 0 irq 10 drq -1 drq2 -1 flags 0x0 ukc>
find ep11 ep0 at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0 12 ep0 at eisa0 slot -1 flags 0x0 13 ep0 at pci* dev -1 function -1 flags 0x0 14 ep* at isapnp0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 flags 0x0 15 ep* at isa0 port -1 size 0 iomem -1 iosiz 0 irq -1 drq -1 drq2 -1 flags 0x0 16 ep* at eisa0 slot -1 flags 0x0 17 ep* at pci* dev -1 function -1 flags 0x0 18 ep* at pcmcia* dev -1 irq -1 flags 0x0 ukc>
add ep1Clone Device (DevNo, 'q' or '?') ?
13Insert before Device (DevNo, 'q' or '?')
1414 ep1 at pci* dev -1 function -1 ukc>
change 1414 ep1 at pci* dev -1 function -1 change (y/n) ?
ydev [-1] ?
14function [-1] ? flags  ?
1814 ep1 changed 14 ep1 at pci* dev 14 function -1 flags 0x12 ukc>
exitwill ignore any changes while
quitwrites the changes to outfile (if
-fwas given, else ignore changes).
configprogram appeared in 4.1BSD and was completely revised in 4.4BSD. The
-eoption appeared in OpenBSD 2.6.
|April 25, 2018||OpenBSD-current|