Lines Matching +full:in +full:- +full:kernel
2 .\" SPDX-License-Identifier: BSD-2-Clause
7 .\" Redistribution and use in source and binary forms, with or without
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 system and its applications are contained in three directories,
41 .Bl -tag -width "/usr/ports"
49 third-party software, with a consistent interface for building and
54 These directories may be initially empty or non-existent until updated
64 command is used in each of these directories to build and install the
65 things in that directory.
68 command in any directory issues the
70 command recursively in all subdirectories.
71 With no target specified, the items in the directories are built
74 A source tree is allowed to be read-only.
75 As described in
77 objects are usually built in a separate object directory hierarchy
85 The canonical object directory is described in the documentation for the
93 variables described in the
95 section below, and by the variables documented in
98 The default components included in the build are specified in the file
101 To override the default file, include the SRCCONF option in the make steps,
108 .Bl -tag -width ".Cm cleandepend"
138 link in
148 Generate a list of build dependencies in file
150 Per-object dependencies are generated at build time and stored in
153 Install the results of the build to the appropriate location in the
154 installation directory hierarchy specified in variable
160 Create a symbolic link to the canonical object directory in
163 Generate a tags file using the program specified in the
176 .Bl -tag -width ".Cm distributeworld"
180 For cross-building the target architecture needs to be specified with
197 This can be set to a command that does something in this build environment,
207 Build everything but the kernel, configure files in
252 Files are placed in the directory hierarchy specified by
258 .It Cm native-xtools
259 This target builds a cross-toolchain for the given
264 This is intended to be used in a jail where QEMU is used to improve
270 .It Cm native-xtools-install
276 .Pa nxb-bin .
283 .Xr freebsd-base 7
286 The repository is created in the object directory, under
299 placing the results in
304 .Xr freebsd-base 7
326 For cross-architecture builds, this step creates a cross-toolchain.
354 pairs for world and kernel targets.
363 Builds and installs a cross-toolchain and sysroot for the given
369 .Cm xdev-build
371 .Cm xdev-install .
374 The target location in
385 .Pa ${TARGET_ARCH}-freebsd .
386 .It Cm update-packages
388 .Xr freebsd-base 7
394 .It Cm xdev-build
398 .It Cm xdev-install
402 .It Cm xdev-links
403 Installs autoconf-style symlinks to
405 pointing into the xdev toolchain in
409 Kernel specific build targets in
412 .Bl -tag -width ".Cm distributekernel"
414 Rebuild the kernel and the kernel modules.
422 Install the kernel and the kernel modules to directory
423 .Pa ${DESTDIR}/boot/kernel ,
424 renaming any pre-existing directory with this name to
425 .Pa kernel.old
426 if it contained the currently running kernel.
436 Install the kernel to the directory
437 .Pa ${DISTDIR}/kernel/boot/kernel .
443 placing the results in
448 .Xr freebsd-base 7
450 .It Cm kernel
455 .It Cm kernel-toolchain
456 Rebuild the tools needed for kernel compilation.
461 Reinstall the kernel and the kernel modules, overwriting the contents
475 .Bl -tag -width ".Cm delete-old-libs"
476 .It Cm check-old
477 Print a list of old files and directories in the system.
478 .It Cm check-old-libs
480 .It Cm delete-old
483 .Li -DBATCH_DELETE_OLD_FILES
485 non-interactive.
493 .It Cm delete-old-libs
498 .Li -DBATCH_DELETE_OLD_FILES
500 non-interactive.
511 .Bl -tag -width ".Va MAKEOBJDIRPREFIX"
525 so that debugging information is retained in the installed binaries.
535 Defines the prefix for directory names in the tree of built objects.
539 This variable should only be set in the environment or
540 .Pa /etc/src-env.conf
556 Additionally, builds in
561 .Bl -tag -width ".Va LOCAL_MODULES_DIR"
563 Requests use of an external toolchain to build either the world or kernel.
565 or the base name of a file in
571 External toolchains are available in ports for both LLVM and GCC/binutils.
572 For external toolchains available in ports,
577 name ${MACHINE_ARCH}-gcc<major version>.
580 kernel make targets.
582 Overrides which kernel to build and install for the various kernel
588 building a kernel module.
589 Useful for stand-alone modules that depend on
592 Automatically set for modules built with a kernel.
594 Overrides the directory in which
617 this variable specifies an alternative directory to install the kernel.
623 The directories are built in parallel with each other,
643 The directories are built in parallel with each other,
665 .Cm bootstrap-tools
670 .Cm build-tools
675 .Cm cross-tools
684 .Xr freebsd-base 7
691 Accepted options are documented in the
694 .Xr pkg-create 8 .
696 A list of ports with kernel modules that should be built and installed
703 .Xr freebsd-base 7
708 .Bd -literal
709 PORTS_MODULES=graphics/gpu-firmware-intel-kmod@kabylake
710 PORTS_MODULES+=graphics/drm-66-kmod
713 A list of external kernel modules that should be built and installed
719 Defaults to the list of sub-directories of
722 The directory in which to search for the kernel modules specified by
724 Each kernel module should consist of a directory containing a makefile.
738 This can also be set in
739 .Xr src-env.conf 5 .
756 Override the default list of sub-directories and only build the
757 sub-directory named in this variable.
763 .Cm -DNO_LIBS ,
765 .Cm -DWORLDFAST
772 This allows building a subset of the system in the same way as
776 .Bd -literal -offset indent
777 make some-target SUBDIR_OVERRIDE=foo/bar
780 Specify the location of the kernel source to override the default
782 The kernel source is located in the
792 This is necessary to cross-build some target architectures.
793 For example, cross-building for ARM64 machines requires
801 is also set, in which case it defaults to the appropriate
808 Set this to cross-build for a different architecture.
813 is also set, in which case it defaults to the appropriate
826 .Bl -tag -width ".Va LOADER_DEFAULT_INTERP"
861 is set no kernel objects are cleaned either.
894 This should only be used if object directories were created in a
917 .Bl -tag -width ".Va DOC_LANG"
929 .Bl -tag -width ".Va USE_GCC_TOOLCHAINS"
963 In addition to the supported architectures, build the semi-supported
965 A semi-supported architecture has build support in the
971 .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
982 notable changes in each tree
992 When manual intervention is necessary, it will be mentioned in
995 .Ss Example 1: Build and upgrade system in place
999 tree, and specify the drivers in
1001 so they are built and installed automatically after the kernel:
1002 .Bd -literal -offset indent
1005 PORTS_MODULES+=graphics/drm-kmod emulators/virtualbox-ose-kmod
1011 .Bd -literal -offset indent
1016 shutdown -r now
1019 For major version upgrades, boot into single-user mode.
1023 .Bd -literal -offset indent
1025 etcupdate -p
1027 etcupdate -B
1028 make delete-old delete-old-libs
1029 shutdown -r now
1031 .Ss Example 2: Build and upgrade a custom kernel in place
1032 Create a custom kernel configuration,
1039 .Bd -literal -offset indent
1048 After creating the new kernel configuration, build a fresh toolchain,
1049 build the kernel, and install it, moving the old kernel to
1050 .Pa /boot/kernel.old/ :
1051 .Bd -literal -offset indent
1052 make kernel-toolchain
1053 make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=MYKERNEL
1054 make -DALWAYS_CHECK_MAKE installkernel KERNCONF=MYKERNEL
1055 shutdown -r now
1058 To build the kernel to an alternate location, use the
1062 .Bd -literal -offset indent
1064 nextboot -k testkernel
1065 shutdown -r now
1068 Rebuild and reinstall a single piece of userspace, in this case
1070 .Bd -literal -offset indent
1075 .Ss Example 4: Build and upgrade a loadable kernel module
1076 Rebuild and reinstall a single loadable kernel module, in this case
1078 .Bd -literal -offset indent
1080 make all install clean cleandepend KMODDIR=/boot/kernel
1082 .Ss Example 5: Quickly rebuild a kernel in place
1083 Quickly rebuild and reinstall the kernel, only recompiling the files
1085 kernel build has been completed in the past, not on a fresh source tree:
1086 .Bd -literal -offset indent
1088 make kernel KERNFAST=1
1090 .Ss Example 6: Cross-compiling for different architectures
1094 first prepare your source tree by building the cross-toolchain:
1095 .Bd -literal -offset indent
1100 The following sequence of commands can be used to cross-build the system
1103 .Bd -literal -offset indent
1110 .Bd -literal -offset indent
1116 Likewise, to quickly rebuild and reinstall the kernel, use:
1117 .Bd -literal -offset indent
1120 make kernel KERNFAST=1 DESTDIR=/armclient
1123 .Bl -diag
1127 The kernel was not updated due to incorrect build procedure.
1137 .Xr freebsd-base 7 ,
1149 manpage first appeared in
1160 .Ql env -i