2014-05-09 21:11:27 +00:00
|
|
|
|
2022-01-02 07:30:37 +00:00
|
|
|
# Options set in the build system which affect the building of kernel
|
|
|
|
# modules. These select which parts to compile in or out (eg INET) or which
|
|
|
|
# parts to omit (eg CDDL or SOURCELESS_HOST). Some of these will cause
|
|
|
|
# config.mk to define symbols in various opt_*.h files.
|
2014-05-09 21:11:27 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Define MK_* variables (which are either "yes" or "no") for users
|
|
|
|
# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
|
|
|
|
# make(1) environment.
|
|
|
|
# These should be tested with `== "no"' or `!= "no"' in makefiles.
|
|
|
|
# The NO_* variables should only be set by makefiles for variables
|
|
|
|
# that haven't been converted over.
|
|
|
|
#
|
|
|
|
|
2014-08-11 14:50:49 +00:00
|
|
|
# Note: bsd.own.mk must be included before the rest of kern.opts.mk to make
|
|
|
|
# building on 10.x and earlier work. This should be removed when that's no
|
|
|
|
# longer supported since it confounds the defaults (since it uses the host's
|
|
|
|
# notion of defaults rather than what's default in current when building
|
|
|
|
# within sys/modules).
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2014-05-09 21:11:27 +00:00
|
|
|
# These options are used by the kernel build process (kern.mk and kmod.mk)
|
|
|
|
# They have to be listed here so we can build modules outside of the
|
|
|
|
# src tree.
|
|
|
|
|
2019-06-02 23:38:19 +00:00
|
|
|
KLDXREF_CMD?= kldxref
|
|
|
|
|
2014-05-09 21:11:27 +00:00
|
|
|
__DEFAULT_YES_OPTIONS = \
|
2015-01-26 07:15:49 +00:00
|
|
|
AUTOFS \
|
2015-01-26 06:44:48 +00:00
|
|
|
BHYVE \
|
2014-08-11 14:50:49 +00:00
|
|
|
BLUETOOTH \
|
2015-01-25 04:52:48 +00:00
|
|
|
CCD \
|
2014-08-11 14:50:49 +00:00
|
|
|
CDDL \
|
|
|
|
CRYPT \
|
2015-01-25 05:13:15 +00:00
|
|
|
CUSE \
|
2022-07-06 13:03:48 +00:00
|
|
|
DTRACE \
|
2018-03-17 17:18:29 +00:00
|
|
|
EFI \
|
2014-05-10 00:42:43 +00:00
|
|
|
FORMAT_EXTENSIONS \
|
2014-08-04 22:37:02 +00:00
|
|
|
INET \
|
|
|
|
INET6 \
|
2014-08-11 14:50:49 +00:00
|
|
|
IPFILTER \
|
2017-02-06 08:49:57 +00:00
|
|
|
IPSEC_SUPPORT \
|
2015-01-25 04:20:11 +00:00
|
|
|
ISCSI \
|
2014-08-11 14:50:49 +00:00
|
|
|
KERNEL_SYMBOLS \
|
|
|
|
NETGRAPH \
|
2021-02-02 13:01:26 +00:00
|
|
|
OFED \
|
2014-08-11 14:50:49 +00:00
|
|
|
PF \
|
2020-06-25 19:12:27 +00:00
|
|
|
SCTP_SUPPORT \
|
2014-08-11 14:50:49 +00:00
|
|
|
SOURCELESS_HOST \
|
|
|
|
SOURCELESS_UCODE \
|
2022-06-09 14:39:24 +00:00
|
|
|
SPLIT_KERNEL_DEBUG \
|
2017-05-09 05:03:35 +00:00
|
|
|
TESTS \
|
2014-08-11 14:50:49 +00:00
|
|
|
USB_GADGET_EXAMPLES \
|
|
|
|
ZFS
|
|
|
|
|
|
|
|
__DEFAULT_NO_OPTIONS = \
|
Initial support for bhyve save and restore.
Save and restore (also known as suspend and resume) permits a snapshot
to be taken of a guest's state that can later be resumed. In the
current implementation, bhyve(8) creates a UNIX domain socket that is
used by bhyvectl(8) to send a request to save a snapshot (and
optionally exit after the snapshot has been taken). A snapshot
currently consists of two files: the first holds a copy of guest RAM,
and the second file holds other guest state such as vCPU register
values and device model state.
To resume a guest, bhyve(8) must be started with a matching pair of
command line arguments to instantiate the same set of device models as
well as a pointer to the saved snapshot.
While the current implementation is useful for several uses cases, it
has a few limitations. The file format for saving the guest state is
tied to the ABI of internal bhyve structures and is not
self-describing (in that it does not communicate the set of device
models present in the system). In addition, the state saved for some
device models closely matches the internal data structures which might
prove a challenge for compatibility of snapshot files across a range
of bhyve versions. The file format also does not currently support
versioning of individual chunks of state. As a result, the current
file format is not a fixed binary format and future revisions to save
and restore will break binary compatiblity of snapshot files. The
goal is to move to a more flexible format that adds versioning,
etc. and at that point to commit to providing a reasonable level of
compatibility. As a result, the current implementation is not enabled
by default. It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option
for userland builds, and the kernel option BHYVE_SHAPSHOT.
Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai
Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz
Relnotes: yes
Sponsored by: University Politehnica of Bucharest
Sponsored by: Matthew Grooms (student scholarships)
Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D19495
2020-05-05 00:02:04 +00:00
|
|
|
BHYVE_SNAPSHOT \
|
2016-06-10 19:06:11 +00:00
|
|
|
EXTRA_TCP_STACKS \
|
2020-11-10 23:25:16 +00:00
|
|
|
INIT_ALL_PATTERN \
|
|
|
|
INIT_ALL_ZERO \
|
2018-02-28 14:57:45 +00:00
|
|
|
KERNEL_RETPOLINE \
|
2019-09-28 14:14:42 +00:00
|
|
|
RATELIMIT \
|
2023-04-16 23:36:07 +00:00
|
|
|
REPRODUCIBLE_BUILD \
|
|
|
|
VERIEXEC
|
2014-05-09 21:11:27 +00:00
|
|
|
|
2015-03-12 03:57:19 +00:00
|
|
|
# Some options are totally broken on some architectures. We disable
|
|
|
|
# them. If you need to enable them on an experimental basis, you
|
|
|
|
# must change this code.
|
2015-03-27 17:36:22 +00:00
|
|
|
# Note: These only apply to the list of modules we build by default
|
|
|
|
# and sometimes what is in the opt_*.h files by default.
|
|
|
|
# Kernel config files are unaffected, though some targets can be
|
|
|
|
# affected by KERNEL_SYMBOLS, FORMAT_EXTENSIONS, CTF and SSP.
|
2015-03-12 03:57:19 +00:00
|
|
|
|
|
|
|
# Things that don't work based on the CPU
|
2020-11-13 18:34:13 +00:00
|
|
|
.if ${MACHINE} == "amd64"
|
|
|
|
# PR251083 conflict between INIT_ALL_ZERO and ifunc memset
|
|
|
|
BROKEN_OPTIONS+= INIT_ALL_ZERO
|
|
|
|
.endif
|
|
|
|
|
2023-03-10 15:45:05 +00:00
|
|
|
# Broken on 32-bit arm, kernel module compile errors
|
2023-03-08 23:07:11 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "arm"
|
2015-03-12 03:57:19 +00:00
|
|
|
BROKEN_OPTIONS+= OFED
|
|
|
|
.endif
|
|
|
|
|
2018-02-28 14:57:45 +00:00
|
|
|
# Things that don't work based on toolchain support.
|
2018-03-15 00:57:57 +00:00
|
|
|
.if ${MACHINE} != "i386" && ${MACHINE} != "amd64"
|
2018-02-28 14:57:45 +00:00
|
|
|
BROKEN_OPTIONS+= KERNEL_RETPOLINE
|
|
|
|
.endif
|
|
|
|
|
2023-05-12 14:39:42 +00:00
|
|
|
# EFI doesn't exist on powerpc or riscv and is broken on i386
|
|
|
|
.if ${MACHINE:Mpowerpc} || ${MACHINE:Mriscv} || ${MACHINE} == "i386"
|
2018-03-17 17:18:29 +00:00
|
|
|
BROKEN_OPTIONS+=EFI
|
|
|
|
.endif
|
|
|
|
|
2022-04-05 19:39:09 +00:00
|
|
|
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
|
|
|
__DEFAULT_NO_OPTIONS += FDT
|
|
|
|
.else
|
|
|
|
__DEFAULT_YES_OPTIONS += FDT
|
|
|
|
.endif
|
|
|
|
|
2014-08-11 14:50:49 +00:00
|
|
|
# expanded inline from bsd.mkopt.mk to avoid share/mk dependency
|
2014-05-09 21:11:27 +00:00
|
|
|
|
2014-08-11 14:50:49 +00:00
|
|
|
# Those that default to yes
|
2014-05-17 20:31:34 +00:00
|
|
|
.for var in ${__DEFAULT_YES_OPTIONS}
|
|
|
|
.if !defined(MK_${var})
|
|
|
|
.if defined(WITHOUT_${var}) # WITHOUT always wins
|
|
|
|
MK_${var}:= no
|
2014-05-11 23:22:32 +00:00
|
|
|
.else
|
2014-05-17 20:31:34 +00:00
|
|
|
MK_${var}:= yes
|
2014-05-11 23:22:32 +00:00
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.else
|
|
|
|
.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
|
|
|
|
.error "Illegal value for MK_${var}: ${MK_${var}}"
|
2014-05-17 20:31:34 +00:00
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.endif # !defined(MK_${var})
|
2014-05-17 20:31:34 +00:00
|
|
|
.endfor
|
|
|
|
.undef __DEFAULT_YES_OPTIONS
|
2014-08-04 22:37:02 +00:00
|
|
|
|
2014-08-11 14:50:49 +00:00
|
|
|
# Those that default to no
|
|
|
|
.for var in ${__DEFAULT_NO_OPTIONS}
|
|
|
|
.if !defined(MK_${var})
|
|
|
|
.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT always wins
|
|
|
|
MK_${var}:= yes
|
|
|
|
.else
|
|
|
|
MK_${var}:= no
|
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.else
|
|
|
|
.if ${MK_${var}} != "yes" && ${MK_${var}} != "no"
|
|
|
|
.error "Illegal value for MK_${var}: ${MK_${var}}"
|
2014-08-11 14:50:49 +00:00
|
|
|
.endif
|
2015-02-09 16:03:55 +00:00
|
|
|
.endif # !defined(MK_${var})
|
2014-08-11 14:50:49 +00:00
|
|
|
.endfor
|
|
|
|
.undef __DEFAULT_NO_OPTIONS
|
|
|
|
|
2015-03-12 03:57:00 +00:00
|
|
|
#
|
|
|
|
# MK_* options which are always no, usually because they are
|
|
|
|
# unsupported/badly broken on this architecture.
|
|
|
|
#
|
|
|
|
.for var in ${BROKEN_OPTIONS}
|
|
|
|
MK_${var}:= no
|
|
|
|
.endfor
|
|
|
|
.undef BROKEN_OPTIONS
|
|
|
|
#end of bsd.mkopt.mk expanded inline.
|
|
|
|
|
2014-08-04 22:37:02 +00:00
|
|
|
#
|
|
|
|
# MK_*_SUPPORT options which default to "yes" unless their corresponding
|
|
|
|
# MK_* variable is set to "no".
|
|
|
|
#
|
|
|
|
.for var in \
|
|
|
|
INET \
|
|
|
|
INET6
|
|
|
|
.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
|
|
|
|
MK_${var}_SUPPORT:= no
|
|
|
|
.else
|
2014-11-14 21:10:45 +00:00
|
|
|
.if defined(KERNBUILDDIR) # See if there's an opt_foo.h
|
2016-03-12 22:21:02 +00:00
|
|
|
.if !defined(OPT_${var})
|
2014-11-14 21:10:45 +00:00
|
|
|
OPT_${var}!= cat ${KERNBUILDDIR}/opt_${var:tl}.h; echo
|
2016-03-12 22:21:02 +00:00
|
|
|
.export OPT_${var}
|
|
|
|
.endif
|
2014-11-14 21:10:45 +00:00
|
|
|
.if ${OPT_${var}} == "" # nothing -> no
|
|
|
|
MK_${var}_SUPPORT:= no
|
|
|
|
.else
|
|
|
|
MK_${var}_SUPPORT:= yes
|
|
|
|
.endif
|
|
|
|
.else # otherwise, yes
|
2014-08-04 22:37:02 +00:00
|
|
|
MK_${var}_SUPPORT:= yes
|
|
|
|
.endif
|
2014-11-14 21:10:45 +00:00
|
|
|
.endif
|
2014-08-04 22:37:02 +00:00
|
|
|
.endfor
|
2016-05-27 17:40:29 +00:00
|
|
|
|
2022-06-08 21:02:24 +00:00
|
|
|
.if ${MK_SPLIT_KERNEL_DEBUG} == "no"
|
|
|
|
MK_KERNEL_SYMBOLS:= no
|
|
|
|
.endif
|
|
|
|
|
2022-07-06 13:03:48 +00:00
|
|
|
.if ${MK_CDDL} == "no"
|
|
|
|
MK_DTRACE:= no
|
|
|
|
.endif
|
|
|
|
|
2016-05-27 17:40:29 +00:00
|
|
|
# Some modules only compile successfully if option FDT is set, due to #ifdef FDT
|
|
|
|
# wrapped around declarations. Module makefiles can optionally compile such
|
|
|
|
# things using .if !empty(OPT_FDT)
|
|
|
|
.if !defined(OPT_FDT) && defined(KERNBUILDDIR)
|
|
|
|
OPT_FDT!= sed -n '/FDT/p' ${KERNBUILDDIR}/opt_platform.h
|
|
|
|
.export OPT_FDT
|
2022-04-05 19:39:09 +00:00
|
|
|
.if empty(OPT_FDT)
|
|
|
|
MK_FDT:=no
|
|
|
|
.else
|
|
|
|
MK_FDT:=yes
|
|
|
|
.endif
|
2016-05-27 17:40:29 +00:00
|
|
|
.endif
|