xref: /openbsd-src/share/man/man4/options.4 (revision 6b4f0b65f9fa98e2a144101a61cb1bcbcb956cc5)
1.\"	$OpenBSD: options.4,v 1.271 2024/05/05 07:26:58 jsg Exp $
2.\"	$NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $
3.\"
4.\" Copyright (c) 1998 Theo de Raadt
5.\" Copyright (c) 1998 Todd Miller
6.\" Copyright (c) 1998 Gene Skonicki
7.\" Copyright (c) 1996
8.\" 	Perry E. Metzger.  All rights reserved.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\" 3. All advertising materials mentioning features or use of this software
19.\"    must display the following acknowledgment:
20.\"	This product includes software developed for the NetBSD Project
21.\"	by Perry E. Metzger.
22.\" 4. The name of the author may not be used to endorse or promote products
23.\"    derived from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\"
36.\"
37.Dd $Mdocdate: May 5 2024 $
38.Dt OPTIONS 4
39.Os
40.Sh NAME
41.Nm options
42.Nd kernel configuration options
43.Sh SYNOPSIS
44.Cd option ...
45.Sh DESCRIPTION
46This manual page describes a number of miscellaneous kernel
47configuration options that may be specified in a kernel config file.
48See
49.Xr config 8
50for information on how to configure and build kernels.
51.Em Note :
52options are passed to the compile process as
53.Fl D
54flags to the C compiler.
55.Sh DEBUGGING OPTIONS
56.Bl -ohang
57.It Cd makeoptions DEBUG=""
58Do not build the debug kernel
59.Pa bsd.gdb .
60Normally,
61.Pa bsd.gdb
62is built
63(in addition to the regular
64.Pa bsd
65kernel)
66and is used for debugging kernels and their crash dumps with
67.Xr gdb 1 .
68A crash dump can be debugged by starting gdb with
69.Pa bsd.gdb
70as an argument (no core file) and then using the gdb command
71.Dq target kvm COREFILE .
72.It Cd makeoptions PROF="-pg"
73The
74.Fl pg
75flag causes the kernel to be compiled with support for profiling.
76The
77.Cm option GPROF
78is required for the kernel compile to succeed.
79.It Cd option ACCOUNTING
80Adds support for the
81.Xr acct 2
82system call.
83.It Cd option DDB
84Compiles in a kernel debugger for diagnosing kernel problems.
85See
86.Xr ddb 4 .
87.It Cd option DDB_SAFE_CONSOLE
88Allows a break into the kernel debugger during boot.
89Useful when debugging problems that can cause
90.Xr init 8
91to fail.
92.It Cd option DEBUG
93Turns on miscellaneous kernel debugging.
94Since options are turned into preprocessor defines (see above),
95.Cm option DEBUG
96is equivalent to doing a
97.Em #define DEBUG
98throughout the kernel.
99Much of the kernel has
100.Em #ifdef DEBUG
101conditional debugging code.
102Note that many parts of the kernel (typically device drivers) include their own
103.Em #ifdef XXX_DEBUG
104conditionals instead.
105.It Cd option DIAGNOSTIC
106Adds code to the kernel that does internal consistency checks.
107This code will cause the kernel to panic if corruption of internal data
108structures is detected.
109.It Cd option GPROF
110Adds code to the kernel for kernel profiling with
111.Xr kgmon 8 .
112.It Cd option KTRACE
113Adds hooks for the system call tracing facility, which allows users to
114watch the system call invocation behavior of processes.
115See
116.Xr ktrace 1 .
117.It Cd option KUBSAN
118Detect undefined behavior in the kernel.
119See
120.Xr kubsan 4 .
121.It Cd option NO_PROPOLICE
122Do not compile the kernel with the ProPolice stack protection.
123See
124.Xr gcc-local 1
125for more information about ProPolice.
126.It Cd option PTRACE
127Adds hooks for the process tracing facility, allowing a process to
128control and observe another process.
129See
130.Xr ptrace 2 .
131.It Cd option SMALL_KERNEL
132Removes some features and some optimizations from the kernel to reduce the
133size of the resulting kernel binary.
134This option is used on some installation media and should not be used
135for general purpose kernels.
136.It Cd option VFSLCKDEBUG
137Turns on debugging for the Virtual File System interface.
138See
139.Xr vfs 9 .
140.It Cd option WITNESS
141Compiles in a lock checker for detecting lock order violations in the kernel.
142See
143.Xr witness 4 .
144.It Cd option WITNESS_COUNT= Ns Ar integer
145Maximum number of lock types that are tracked by
146.Xr witness 4 .
147It defaults to 1536.
148.It Cd option WITNESS_LOCKTRACE
149Enable
150.Xr witness 4
151lock stack trace saving at boot.
152The feature is disabled by default and has to be enabled by setting the
153.Va kern.witness.locktrace
154.Xr sysctl 8
155variable.
156.It Cd option WITNESS_WATCH
157Enable
158.Xr witness 4
159at boot.
160By default, the subsystem is disabled and has to be enabled at runtime
161by raising the
162.Va kern.witness.watch
163.Xr sysctl 8
164variable.
165.El
166.Sh FILE SYSTEMS
167.Bl -ohang
168.It Cd option CD9660
169Includes code for the ISO 9660 + Rock Ridge file system, which is the
170standard file system used on many CD-ROMs.
171It also supports Joliet extensions.
172See
173.Xr mount_cd9660 8 .
174.It Cd option EXT2FS
175Includes code implementing the Second Extended File System
176.Em ( EXT2FS ) ,
177commonly used on the Linux operating system.
178This option is provided here for compatibility.
179Some specific features of
180.Em EXT2FS
181like the "behavior on errors" are not implemented.
182This file system
183can't be used with
184.Vt uid_t
185or
186.Vt gid_t
187values greater than 65535.
188Also, the filesystem will not function correctly on architectures with
189differing byte-orders.
190That is, a big-endian machine will not be able to read an
191ext2fs filesystem created on an i386 or other little-endian machine.
192See
193.Xr mount_ext2fs 8 .
194.It Cd option FFS
195Includes code implementing the Berkeley Fast File System
196.Em ( FFS ) .
197Most machines need this if they are not running diskless.
198.It Cd option FFS2
199Includes code implementing the enhanced Fast File System
200.Em ( FFS2 ) .
201.It Cd option MFS
202Include the memory file system
203.Em ( MFS ) .
204This file system stores files in swappable memory, and produces
205notable performance improvements when it is used as the file store
206for
207.Pa /tmp
208or similar mount points.
209See
210.Xr mount_mfs 8 .
211.It Cd option MSDOSFS
212Includes support for the MS-DOS FAT file system.
213The kernel also implements the Windows 95
214extensions which permit the use of longer, mixed-case file names.
215See
216.Xr mount_msdos 8
217and
218.Xr fsck_msdos 8 .
219.It Cd option NFSCLIENT
220Include the client side of the
221.Em NFS
222(Network File System) remote file sharing protocol.
223Although the bulk of the code implementing
224.Em NFS
225is kernel based, several user level daemons are needed for it to work.
226See
227.Xr mount_nfs 8
228for details on NFS.
229.It Cd option NTFS
230Includes support for reading NTFS file systems.
231See
232.Xr mount_ntfs 8 .
233.It Cd option UDF
234Includes code for the UDF file systems typically found on DVD discs.
235See
236.Xr mount_udf 8 .
237.It Cd option TMPFS
238Includes code for the TMPFS efficient memory file system.
239See
240.Xr mount_tmpfs 8 .
241.El
242.Sh FILE SYSTEM OPTIONS
243.Bl -ohang
244.It Cd option BUFCACHEPERCENT= Ns Ar integer
245The maximum percentage of DMA-reachable physical memory the buffer cache may use.
246.It Cd option EXT2FS_SYSTEM_FLAGS
247This option changes the behavior of the APPEND and IMMUTABLE flags
248for a file on an
249.Em EXT2FS
250filesystem.
251Without this option, the superuser or owner of the file can set and clear them.
252With this option, only the superuser can set them, and they can't be cleared
253if the securelevel is greater than 0.
254See also
255.Xr chflags 1 .
256.It Cd option FIFO
257Adds support for
258.At V
259style FIFOs (i.e.,
260.Dq named pipes ) .
261This option is recommended in almost all cases as many programs use these.
262.It Cd option NFSSERVER
263Include the server side of the
264.Em NFS
265(Network File System) remote file sharing protocol.
266Although the bulk of the code implementing
267.Em NFS
268is kernel based, several user level daemons are needed for it to
269work.
270See
271.Xr mountd 8
272and
273.Xr nfsd 8 .
274.It Cd option QUOTA
275Enables kernel support for file system quotas.
276See
277.Xr quotaon 8 ,
278.Xr edquota 8 ,
279.Xr repquota 8 ,
280and
281.Xr quota 1 .
282Note that quotas only work on
283.Dq ffs
284file systems, although
285.Xr rpc.rquotad 8
286permits them to be accessed over
287.Em NFS .
288.It Cd option UFS_DIRHASH
289This option enables using an in memory hash table to speed lookups
290in large directories.
291.El
292.Sh MISCELLANEOUS OPTIONS
293.Bl -ohang
294.It Cd option APERTURE
295Provide in-kernel support for controlling VGA framebuffer mapping
296and PCI configuration registers by user-processes
297(such as an X Window System server).
298See
299.Xr xf86 4 .
300This option is supported on the
301.Va alpha ,
302.Va amd64 ,
303.Va i386 ,
304.Va macppc ,
305and
306.Va sparc64
307architectures.
308.It Cd option BOOT_CONFIG
309Adds support for the
310.Fl c
311boot option (User Kernel Config).
312Allows modification of kernel settings (e.g., device parameters) before
313booting the system.
314See
315.Xr boot_config 8 .
316.It Cd option CRYPTO
317Enables support for the kernel cryptographic framework.
318See
319.Xr crypto 9 .
320While not IP specific, this option is usually used in conjunction with option
321.Em IPSEC .
322.It Cd option EISAVERBOSE
323Makes the boot process more verbose for EISA peripherals.
324See
325.Xr eisa 4 .
326.It Cd option KMEMSTATS
327The kernel memory allocator,
328.Xr malloc 9 ,
329will keep statistics on its performance if this option is enabled.
330.It Cd option MULTIPROCESSOR
331On those architectures that have it, this enables multiprocessor support.
332.It Cd option PCIVERBOSE
333Makes the boot process more verbose for PCI peripherals
334(vendor names and other information is printed, etc.).
335See
336.Xr pci 4 .
337.It Cd option PCMCIAVERBOSE
338Makes the boot process more verbose for PCMCIA peripherals.
339See
340.Xr pcmcia 4 .
341.It Cd option USER_PCICONF
342Enables the user level access to the PCI bus configuration space
343through ioctls on the
344.Pa /dev/pci
345device.
346It's used by
347.Xr Xorg 1
348and
349.Xr pcidump 8 .
350See
351.Xr pci 4 .
352.It Cd option UVM_SWAP_ENCRYPT
353Enables kernel support for encrypting pages that are written out to
354swap storage.
355Swap encryption prevents sensitive data from remaining
356on the disk even after the operating system has been shut down.
357This option should be turned on if cryptographic filesystems are used.
358The sysctl variable
359.Em vm.swapencrypt.enable
360controls its behaviour.
361See
362.Xr sysctl 8
363and
364.Xr sysctl 2 .
365.El
366.Sh NETWORKING OPTIONS
367.Bl -ohang
368.It Cd option ENCDEBUG
369This option permits the conditional logging of IPsec debugging information,
370and requires the
371.Em IPSEC
372option.
373Debug logging can be turned on/off through the use of the
374.Em net.inet.ip.encdebug
375sysctl variable.
376If
377.Em net.inet.ip.encdebug
378is 1, debug logging is on.
379See
380.Xr sysctl 8
381and
382.Xr sysctl 2 .
383.It Cd option INET6
384Includes support for the IPv6 protocol stack.
385See
386.Xr inet6 4 .
387.Em INET6
388enables multicast routing code as well.
389.It Cd option IPSEC
390This option enables IP security protocol support.
391See
392.Xr ipsec 4
393for more details.
394.It Cd option MROUTING
395Includes support for IP multicast routers.
396Multicast routing is controlled by the
397.Xr mrouted 8
398daemon.
399.It Cd option ND6_DEBUG
400The option sets the default value of
401.Em net.inet6.icmp6.nd6_debug
402to 1,
403for debugging IPv6 neighbor discovery protocol handling.
404See
405.Xr sysctl 2 .
406.It Cd option PIPEX
407Includes pipex in-kernel acceleration for PPPoE, L2TP or PPTP.
408See
409.Xr pipex 4 .
410.It Cd option PPP_BSDCOMP
411Enables BSD compressor for PPP connections.
412.It Cd option PPP_DEFLATE
413For use in conjunction with PPP_BSDCOMP; provides an interface to zlib for PPP
414for deflate compression/decompression.
415.It Cd option PPPOE_TERM_UNKNOWN_SESSIONS
416Send PADT to terminate open sessions before connecting.
417See
418.Xr pppoe 4 .
419.It Cd option SOCKET_SPLICE
420Enables zero-copy socket splicing in the kernel.
421See
422.Dv SO_SPLICE
423in
424.Xr setsockopt 2
425and
426.Xr sosplice 9 .
427.It Cd option TCP_ECN
428Turns on Explicit Congestion Notification (RFC 3168).
429.Em ECN
430allows intermediate routers to use the Congestion Experienced
431codepoint in the IP header as an indication of congestion, and allows
432TCP to adjust the transmission rate using this signal.
433Both communication endpoints negotiate enabling
434.Em ECN
435functionality at the TCP connection establishment.
436.It Cd option TCP_SIGNATURE
437Turns on support for the TCP MD5 Signature option (RFC 2385).
438This is used by
439Internet backbone routers to provide per-packet authentication for the TCP
440packets used to communicate BGP routing information.
441You will also need a
442routing daemon that supports this option in order to actually use it.
443.El
444.Sh OPERATION RELATED OPTIONS
445.Bl -ohang -compact
446.It Cd option BUFPAGES= Ns Ar value
447This option sets the number of pages available for the buffer cache.
448The default value is machine dependent, often calculated as
449between 5% and 10% of total available RAM.
450.Pp
451.It Cd option NKMEMPAGES= Ns Ar value
452Size of kernel malloc area in PAGE_SIZE-sized logical pages.
453This area is covered by the kernel submap
454.Em kmem_map .
455The kernel attempts to auto-size this map based on the amount of
456physical memory in the system.
457Platform-specific code may place bounds on this computed size,
458which may be viewed with the
459.Xr sysctl 8
460variable
461.Em vm.nkmempages .
462.El
463.Sh SCSI SUBSYSTEM OPTIONS
464See
465.Xr scsi 4 .
466.Bl -ohang
467.It Cd option SCSI_DELAY= Ns Ar value
468Delay for
469.Ar value
470seconds before starting to probe the first SCSI bus.
471This can be used if a SCSI device needs extra time to get ready.
472.It Cd option SCSIDEBUG
473Enable printing of SCSI subsystem debugging info to the console.
474Debugging info on the probing and attachment of all SCSI devices will
475be printed.
476.Pp
477Additional information can be requested by setting
478.Em SCSIDEBUG_BUSES ,
479.Em SCSIDEBUG_LEVEL ,
480.Em SCSIDEBUG_LUNS
481and
482.Em SCSIDEBUG_TARGETS .
483.It Cd option SCSIDEBUG_BUSES= Ns Ar value
484Define which SCSI buses will print debug info.
485Each bit enables debugging info for the corresponding bus.
486e.g. a value of 0x1 enables debug info for bus 0.
487.It Cd option SCSIDEBUG_LEVEL= Ns Ar value
488Define which of the four levels of debugging info are printed.
489Each bit enables a level, and multiple levels are specified by setting multiple
490bits.
491.Bd -literal -offset indent
4920x0010	(SDEV_DB1) SCSI commands, errors, and data
4930x0020	(SDEV_DB2) routine flow
4940x0040	(SDEV_DB3) routine internals
4950x0080	(SDEV_DB4) miscellaneous addition debugging
496.Ed
497.Pp
498.Em SCSIDEBUG_LEVEL
499defaults to a value of 0x0030 (SDEV_DB1|SDEV_DB2).
500.It Cd option SCSIDEBUG_LUNS= Ns Ar value
501Define which SCSI luns will print debug info.
502Each bit enables debugging info for the corresponding lun.
503.It Cd option SCSIDEBUG_TARGETS= Ns Ar value
504Define which SCSI targets will print debug info.
505Each bit enables debugging info for the corresponding target.
506.It Cd option SCSITERSE
507Terser SCSI error messages.
508This omits the table for decoding ASC/ASCQ info, saving about 30KB.
509.El
510.Sh SYSTEM V IPC OPTIONS
511.Bl -ohang
512.It Cd option SEMMNI= Ns Ar value
513Number of semaphore identifiers (also called semaphore handles
514and semaphore sets) available in the system.
515Default value is 10.
516The kernel allocates memory for the control structures at startup,
517so arbitrarily large values should be avoided.
518.It Cd option SEMMNS= Ns Ar value
519Maximum number of semaphores in all sets in the system.
520Default value is 60.
521.It Cd option SEMMNU= Ns Ar value
522Maximum number of semaphore undo structures in the system.
523Default value is 30.
524.It Cd option SEMUME= Ns Ar value
525Maximum number of per-process undo operation entries in the
526system.
527Semaphore undo operations are invoked by the kernel when
528.Xr semop 2
529is called with the SEM_UNDO flag and the process holding
530the semaphores terminates unexpectedly.
531Default value is 10.
532.It Cd option SHMMAXPGS= Ns Ar value
533Sets the maximum number of
534.At V
535style shared memory pages that are available through the
536.Xr shmget 2
537system call.
538Default value is 1024 on most architectures.
539See
540.Pa /usr/include/machine/vmparam.h
541for the default.
542.It Cd option SYSVMSG
543Includes support for
544.At V
545style message queues.
546See
547.Xr msgctl 2 ,
548.Xr msgget 2 ,
549.Xr msgrcv 2 ,
550.Xr msgsnd 2 .
551.It Cd option SYSVSEM
552Includes support for
553.At V
554style semaphores.
555See
556.Xr semctl 2 ,
557.Xr semget 2 ,
558.Xr semop 2 .
559.It Cd option SYSVSHM
560Includes support for
561.At V
562style shared memory.
563See
564.Xr shmat 2 ,
565.Xr shmctl 2 ,
566.Xr shmdt 2 ,
567.Xr shmget 2 .
568.El
569.Sh SEE ALSO
570.Xr intro 4 ,
571.Xr files.conf 5 ,
572.Xr config 8 ,
573.Xr sysctl 8
574.Sh HISTORY
575The
576.Nm
577man page first appeared in
578.Ox 2.3 .
579