1.\" $OpenBSD: options.4,v 1.267 2019/11/05 07:53:58 jmc 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: November 5 2019 $ 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.Li uid_t 185or 186.Li 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 FFS_SOFTUPDATES 257Enables a scheme that uses partial ordering of buffer cache operations 258to allow metadata updates in FFS to happen asynchronously, increasing write 259performance significantly. 260Normally, the FFS filesystem writes metadata updates synchronously which exacts 261a performance penalty in favor of filesystem integrity. 262With soft updates, the performance of asynchronous writes is gained while 263retaining the safety of synchronous metadata updates. 264.Pp 265Soft updates must be enabled on a per-filesystem basis. 266See 267.Xr mount 8 . 268.It Cd option FIFO 269Adds support for 270.At V 271style FIFOs (i.e., 272.Dq named pipes ) . 273This option is recommended in almost all cases as many programs use these. 274.It Cd option NFSSERVER 275Include the server side of the 276.Em NFS 277(Network File System) remote file sharing protocol. 278Although the bulk of the code implementing 279.Em NFS 280is kernel based, several user level daemons are needed for it to 281work. 282See 283.Xr mountd 8 284and 285.Xr nfsd 8 . 286.It Cd option QUOTA 287Enables kernel support for file system quotas. 288See 289.Xr quotaon 8 , 290.Xr edquota 8 , 291.Xr repquota 8 , 292and 293.Xr quota 1 . 294Note that quotas only work on 295.Dq ffs 296file systems, although 297.Xr rpc.rquotad 8 298permits them to be accessed over 299.Em NFS . 300.It Cd option UFS_DIRHASH 301This option enables using an in memory hash table to speed lookups 302in large directories. 303.El 304.Sh MISCELLANEOUS OPTIONS 305.Bl -ohang 306.It Cd option APERTURE 307Provide in-kernel support for controlling VGA framebuffer mapping 308and PCI configuration registers by user-processes 309(such as an X Window System server). 310See 311.Xr xf86 4 . 312This option is supported on the 313.Va alpha , 314.Va amd64 , 315.Va i386 , 316.Va macppc , 317and 318.Va sparc64 319architectures. 320.It Cd option BOOT_CONFIG 321Adds support for the 322.Fl c 323boot option (User Kernel Config). 324Allows modification of kernel settings (e.g., device parameters) before 325booting the system. 326See 327.Xr boot_config 8 . 328.It Cd option CRYPTO 329Enables support for the kernel cryptographic framework. 330See 331.Xr crypto 9 . 332While not IP specific, this option is usually used in conjunction with option 333.Em IPSEC . 334.It Cd option EISAVERBOSE 335Makes the boot process more verbose for EISA peripherals. 336See 337.Xr eisa 4 . 338.It Cd option KMEMSTATS 339The kernel memory allocator, 340.Xr malloc 9 , 341will keep statistics on its performance if this option is enabled. 342.It Cd option MULTIPROCESSOR 343On those architectures that have it, this enables multiprocessor support. 344.It Cd option PCIVERBOSE 345Makes the boot process more verbose for PCI peripherals 346(vendor names and other information is printed, etc.). 347See 348.Xr pci 4 . 349.It Cd option PCMCIAVERBOSE 350Makes the boot process more verbose for PCMCIA peripherals. 351See 352.Xr pcmcia 4 . 353.It Cd option USER_PCICONF 354Enables the user level access to the PCI bus configuration space 355through ioctls on the 356.Pa /dev/pci 357device. 358It's used by 359.Xr Xorg 1 360and 361.Xr pcidump 8 . 362See 363.Xr pci 4 . 364.It Cd option UVM_SWAP_ENCRYPT 365Enables kernel support for encrypting pages that are written out to 366swap storage. 367Swap encryption prevents sensitive data from remaining 368on the disk even after the operating system has been shut down. 369This option should be turned on if cryptographic filesystems are used. 370The sysctl variable 371.Em vm.swapencrypt.enable 372controls its behaviour. 373See 374.Xr sysctl 8 375and 376.Xr sysctl 2 . 377.El 378.Sh NETWORKING OPTIONS 379.Bl -ohang 380.It Cd option ENCDEBUG 381This option permits the conditional logging of IPsec debugging information, 382and requires the 383.Em IPSEC 384option. 385Debug logging can be turned on/off through the use of the 386.Em net.inet.ip.encdebug 387sysctl variable. 388If 389.Em net.inet.ip.encdebug 390is 1, debug logging is on. 391See 392.Xr sysctl 8 393and 394.Xr sysctl 2 . 395.It Cd option INET6 396Includes support for the IPv6 protocol stack. 397See 398.Xr inet6 4 . 399.Em INET6 400enables multicast routing code as well. 401.It Cd option IPSEC 402This option enables IP security protocol support. 403See 404.Xr ipsec 4 405for more details. 406.It Cd option MROUTING 407Includes support for IP multicast routers. 408Multicast routing is controlled by the 409.Xr mrouted 8 410daemon. 411.It Cd option ND6_DEBUG 412The option sets the default value of 413.Em net.inet6.icmp6.nd6_debug 414to 1, 415for debugging IPv6 neighbor discovery protocol handling. 416See 417.Xr sysctl 2 . 418.It Cd option PIPEX 419Includes pipex in-kernel acceleration for PPPoE, L2TP or PPTP. 420See 421.Xr pipex 4 . 422.It Cd option PPP_BSDCOMP 423Enables BSD compressor for PPP connections. 424.It Cd option PPP_DEFLATE 425For use in conjunction with PPP_BSDCOMP; provides an interface to zlib for PPP 426for deflate compression/decompression. 427.It Cd option PPPOE_TERM_UNKNOWN_SESSIONS 428Send PADT to terminate open sessions before connecting. 429See 430.Xr pppoe 4 . 431.It Cd option SOCKET_SPLICE 432Enables zero-copy socket splicing in the kernel. 433See 434.Dv SO_SPLICE 435in 436.Xr setsockopt 2 437and 438.Xr sosplice 9 . 439.It Cd option TCP_ECN 440Turns on Explicit Congestion Notification (RFC 3168). 441.Em ECN 442allows intermediate routers to use the Congestion Experienced 443codepoint in the IP header as an indication of congestion, and allows 444TCP to adjust the transmission rate using this signal. 445Both communication endpoints negotiate enabling 446.Em ECN 447functionality at the TCP connection establishment. 448.It Cd option TCP_SIGNATURE 449Turns on support for the TCP MD5 Signature option (RFC 2385). 450This is used by 451Internet backbone routers to provide per-packet authentication for the TCP 452packets used to communicate BGP routing information. 453You will also need a 454routing daemon that supports this option in order to actually use it. 455.El 456.Sh OPERATION RELATED OPTIONS 457.Bl -ohang -compact 458.It Cd option BUFPAGES= Ns Ar value 459This option sets the number of pages available for the buffer cache. 460The default value is machine dependent, often calculated as 461between 5% and 10% of total available RAM. 462.Pp 463.It Cd option NKMEMPAGES= Ns Ar value 464.It Cd option NKMEMPAGES_MAX= Ns Ar value 465Size of kernel malloc area in PAGE_SIZE-sized logical pages. 466This area is covered by the kernel submap 467.Em kmem_map . 468The kernel attempts to auto-size this map based on the amount of 469physical memory in the system. 470Platform-specific code may place bounds on this computed size, 471which may be viewed with the 472.Xr sysctl 8 473variable 474.Em vm.nkmempages . 475See 476.Pa /usr/include/machine/param.h 477for the default upper bound. 478The related option 479.Sq NKMEMPAGES_MAX 480allows the bounds to be overridden in the kernel configuration file 481in the event the computed value is insufficient resulting in an 482.Dq out of space in kmem_map 483panic. 484.El 485.Sh SCSI SUBSYSTEM OPTIONS 486See 487.Xr scsi 4 . 488.Bl -ohang 489.It Cd option SCSI_DELAY= Ns Ar value 490Delay for 491.Ar value 492seconds before starting to probe the first SCSI bus. 493This can be used if a SCSI device needs extra time to get ready. 494.It Cd option SCSIDEBUG 495Enable printing of SCSI subsystem debugging info to the console. 496Each of 497.Em SCSIDEBUG_LEVEL , 498.Em SCSIDEBUG_BUSES , 499.Em SCSIDEBUG_TARGETS 500and 501.Em SCSIDEBUG_LUNS 502must have non-zero values for any debugging info to be printed. 503Only 504.Em SCSIDEBUG_LEVEL 505has a default value (SDEV_DB1 | SDEV_DB2) that is non-zero. 506.It Cd option SCSIDEBUG_BUSES= Ns Ar value 507Define which SCSI buses will print debug info. 508Each bit enables debugging info for the corresponding bus. 509e.g. a value of 0x1 enables debug info for bus 0. 510.It Cd option SCSIDEBUG_LEVEL= Ns Ar value 511Define which of the four levels of debugging info are printed. 512Each bit enables a level, and multiple levels are specified by setting multiple 513bits. 514.Bd -literal -offset indent 5150x0010 (SDEV_DB1) SCSI commands, errors, and data 5160x0020 (SDEV_DB2) routine flow 5170x0040 (SDEV_DB3) routine internals 5180x0080 (SDEV_DB4) miscellaneous addition debugging 519.Ed 520.Pp 521If 522.Em SCSIDEBUG_LEVEL 523is undefined, a value of 0x0030 (SDEV_DB1|SDEV_DB2) is used. 524.It Cd option SCSIDEBUG_LUNS= Ns Ar value 525Define which SCSI luns will print debug info. 526Each bit enables debugging info for the corresponding lun. 527.It Cd option SCSIDEBUG_TARGETS= Ns Ar value 528Define which SCSI targets will print debug info. 529Each bit enables debugging info for the corresponding target. 530.It Cd option SCSITERSE 531Terser SCSI error messages. 532This omits the table for decoding ASC/ASCQ info, saving about 30KB. 533.El 534.Sh SYSTEM V IPC OPTIONS 535.Bl -ohang 536.It Cd option SEMMNI= Ns Ar value 537Number of semaphore identifiers (also called semaphore handles 538and semaphore sets) available in the system. 539Default value is 10. 540The kernel allocates memory for the control structures at startup, 541so arbitrarily large values should be avoided. 542.It Cd option SEMMNS= Ns Ar value 543Maximum number of semaphores in all sets in the system. 544Default value is 60. 545.It Cd option SEMMNU= Ns Ar value 546Maximum number of semaphore undo structures in the system. 547Default value is 30. 548.It Cd option SEMUME= Ns Ar value 549Maximum number of per-process undo operation entries in the 550system. 551Semaphore undo operations are invoked by the kernel when 552.Xr semop 2 553is called with the SEM_UNDO flag and the process holding 554the semaphores terminates unexpectedly. 555Default value is 10. 556.It Cd option SHMMAXPGS= Ns Ar value 557Sets the maximum number of 558.At V 559style shared memory pages that are available through the 560.Xr shmget 2 561system call. 562Default value is 1024 on most architectures. 563See 564.Pa /usr/include/machine/vmparam.h 565for the default. 566.It Cd option SYSVMSG 567Includes support for 568.At V 569style message queues. 570See 571.Xr msgctl 2 , 572.Xr msgget 2 , 573.Xr msgrcv 2 , 574.Xr msgsnd 2 . 575.It Cd option SYSVSEM 576Includes support for 577.At V 578style semaphores. 579See 580.Xr semctl 2 , 581.Xr semget 2 , 582.Xr semop 2 . 583.It Cd option SYSVSHM 584Includes support for 585.At V 586style shared memory. 587See 588.Xr shmat 2 , 589.Xr shmctl 2 , 590.Xr shmdt 2 , 591.Xr shmget 2 . 592.El 593.Sh SEE ALSO 594.Xr intro 4 , 595.Xr files.conf 5 , 596.Xr config 8 , 597.Xr sysctl 8 598.Sh HISTORY 599The 600.Nm 601man page first appeared in 602.Ox 2.3 . 603