Index: head/share/man/man7/build.7 =================================================================== --- head/share/man/man7/build.7 (revision 312937) +++ head/share/man/man7/build.7 (revision 312938) @@ -1,693 +1,693 @@ .\" Copyright (c) 2000 .\" Mike W. Meyer .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd July 20, 2016 +.Dd January 28, 2017 .Dt BUILD 7 .Os .Sh NAME .Nm build .Nd information on how to build the system .Sh DESCRIPTION The sources for the .Fx system and its applications are contained in three different directories, normally .Pa /usr/src , .Pa /usr/doc , and .Pa /usr/ports . These directories may be initially empty or non-existent until updated with .Xr svn 1 or .Xr portsnap 8 . Directory .Pa /usr/src contains the .Dq "base system" sources, which is loosely defined as the things required to rebuild the system to a useful state. Directory .Pa /usr/doc contains the source for the system documentation, excluding the manual pages. Directory .Pa /usr/ports contains a tree that provides a consistent interface for building and installing third party applications. For more information about the ports build process, see .Xr ports 7 . .Pp The .Xr make 1 command is used in each of these directories to build and install the things in that directory. Issuing the .Xr make 1 command in any directory or subdirectory of those directories has the same effect as issuing the same command in all subdirectories of that directory. With no target specified, the things in that directory are just built. .Pp A source tree is allowed to be read-only. As described in .Xr make 1 , objects are usually built in a separate object directory hierarchy specified by the environment variable .Va MAKEOBJDIRPREFIX , or under .Pa /usr/obj if variable .Va MAKEOBJDIRPREFIX is not set. For a given source directory, its canonical object directory would be .Pa ${MAKEOBJDIRPREFIX}${.CURDIR} if .Xr make 1 variable .Va MAKEOBJDIRPREFIX is set, or .Pa /usr/obj${.CURDIR} if this variable is not set. Cross-builds set the object directory as described in the documentation for the .Cm buildworld target below. .Pp The build may be controlled by defining .Xr make 1 variables described in the .Sx ENVIRONMENT section below, and by the variables documented in .Xr make.conf 5 . .Pp The following list provides the names and actions for the targets supported by the build system: .Bl -tag -width ".Cm cleandepend" .It Cm analyze Run Clang static analyzer against all objects and present output on stdout. .It Cm check Run tests for a given subdirectory. The default directory used is .Pa ${.OBJDIR} , but the check directory can be changed with .Pa ${CHECKDIR} . .It Cm checkworld Run the .Fx test suite on installed world. .It Cm clean Remove any files created during the build process. .It Cm cleandepend Remove the .Pa ${.OBJDIR}/${DEPENDFILE}* files generated by prior .Dq Li "make" and .Dq Li "make depend" steps. .It Cm cleandir Remove the canonical object directory if it exists, or perform actions equivalent to .Dq Li "make clean cleandepend" if it does not. This target will also remove an .Pa obj link in .Pa ${.CURDIR} if that exists. .Pp It is advisable to run .Dq Li "make cleandir" twice: the first invocation will remove the canonical object directory and the second one will clean up .Pa ${.CURDIR} . .It Cm depend Generate a list of build dependencies in file .Pa ${.OBJDIR}/${DEPENDFILE} . Per-object dependencies are generated at build time and stored in .Pa ${.OBJDIR}/${DEPENDFILE}.${OBJ} . .It Cm install Install the results of the build to the appropriate location in the installation directory hierarchy specified in variable .Va DESTDIR . .It Cm obj Create the canonical object directory associated with the current directory. .It Cm objlink Create a symbolic link to the canonical object directory in .Pa ${.CURDIR} . .It Cm tags Generate a tags file using the program specified in the .Xr make 1 variable .Va CTAGS . The build system supports .Xr ctags 1 and .Nm "GNU Global" . .El .Pp The other supported targets under directory .Pa /usr/src are: .Bl -tag -width ".Cm distributeworld" .It Cm buildenv Spawn an interactive shell with environment variables set up for cross-building the system. The target architecture needs to be specified with .Xr make 1 variables .Va TARGET_ARCH and .Va TARGET . .Pp This target is only useful after a complete cross-toolchain including the compiler, linker, assembler, headers and libraries has been built; see the .Cm toolchain target below. .It Cm buildworld Build everything but the kernel, configure files in .Pa etc , and .Pa release . The object directory can be changed from the default .Pa /usr/obj by setting the .Pa MAKEOBJDIRPREFIX .Xr make 1 variable. The actual build location prefix used is .Pa ${MAKEOBJDIRPREFIX}${.CURDIR} for native builds, and .Pa ${MAKEOBJDIRPREFIX}/${TARGET}${.CURDIR} for cross builds and native builds with variable .Va CROSS_BUILD_TESTING set. .It Cm cleanworld Attempt to clean up targets built by a preceding .Cm buildworld step. .It Cm distributeworld Distribute everything compiled by a preceding .Cm buildworld step. Files are placed in the directory hierarchy specified by .Xr make 1 variable .Va DISTDIR . This target is used while building a release; see .Xr release 7 . .It Cm packageworld Archive the results of .Cm distributeworld , placing the results in .Va DISTDIR . This target is used while building a release; see .Xr release 7 . .It Cm installworld Install everything built by a preceding .Cm buildworld step into the directory hierarchy pointed to by .Xr make 1 variable .Va DESTDIR . .Pp If installing onto an NFS file system and running .Xr make 1 with the .Fl j option, make sure that .Xr rpc.lockd 8 is running on both client and server. See .Xr rc.conf 5 on how to make it start at boot time. .It Cm toolchain Create the build toolchain needed to build the rest of the system. For cross-architecture builds, this step creates a cross-toolchain. .It Cm universe For each architecture, execute a .Cm buildworld followed by a .Cm buildkernel for all kernels for that architecture, including .Pa LINT . This command takes a long time. .It Cm update Get updated sources as configured in .Xr make.conf 5 . .It Cm targets Print a list of supported .Va TARGET / .Va TARGET_ARCH pairs for world and kernel targets. .It Cm tinderbox Execute the same targets as .Cm universe . In addition print a summary of all failed targets at the end and exit with an error if there were any. .It Cm toolchains Create a build toolchain for each architecture supported by the build system. .El .Pp Kernel specific build targets in .Pa /usr/src are: .Bl -tag -width ".Cm distributekernel" .It Cm buildkernel Rebuild the kernel and the kernel modules. The object directory can be changed from the default .Pa /usr/obj by setting the .Pa MAKEOBJDIRPREFIX .Xr make 1 variable. .It Cm installkernel Install the kernel and the kernel modules to directory .Pa ${DESTDIR}/boot/kernel , renaming any pre-existing directory with this name to .Pa kernel.old if it contained the currently running kernel. The target directory under .Pa ${DESTDIR} may be modified using the .Va INSTKERNNAME and .Va KODIR .Xr make 1 variables. .It Cm distributekernel Install the kernel to the directory .Pa ${DISTDIR}/kernel/boot/kernel . This target is used while building a release; see .Xr release 7 . .It Cm packagekernel Archive the results of .Cm distributekernel , placing the results in .Va DISTDIR . This target is used while building a release; see .Xr release 7 . .It Cm kernel Equivalent to .Cm buildkernel followed by .Cm installkernel .It Cm kernel-toolchain Rebuild the tools needed for kernel compilation. Use this if you did not do a .Cm buildworld first. .It Cm reinstallkernel Reinstall the kernel and the kernel modules, overwriting the contents of the target directory. As with the .Cm installkernel target, the target directory can be specified using the .Xr make 1 variable .Va INSTKERNNAME . .El .Pp Convenience targets for cleaning up the install destination directory denoted by variable .Va DESTDIR include: .Bl -tag -width ".Cm delete-old-libs" .It Cm check-old Print a list of old files and directories in the system. .It Cm delete-old Delete obsolete base system files and directories interactively. When .Li -DBATCH_DELETE_OLD_FILES is specified at the command line, the delete operation will be non-interactive. The variables .Va DESTDIR , .Va TARGET_ARCH and .Va TARGET should be set as with .Dq Li "make installworld" . .It Cm delete-old-libs Delete obsolete base system libraries interactively. This target should only be used if no third party software uses these libraries. When .Li -DBATCH_DELETE_OLD_FILES is specified at the command line, the delete operation will be non-interactive. The variables .Va DESTDIR , .Va TARGET_ARCH and .Va TARGET should be set as with .Dq Li "make installworld" . .El .Sh ENVIRONMENT Variables that influence all builds include: .Bl -tag -width ".Va MAKEOBJDIRPREFIX" .It Va DEBUG_FLAGS Defines a set of debugging flags that will be used to build all userland binaries under .Pa /usr/src . When .Va DEBUG_FLAGS is defined, the .Cm install and .Cm installworld targets install binaries from the current .Va MAKEOBJDIRPREFIX without stripping, so that debugging information is retained in the installed binaries. .It Va DESTDIR The directory hierarchy prefix where built objects will be installed. If not set, .Va DESTDIR defaults to the empty string. .It Va MAKEOBJDIRPREFIX Defines the prefix for directory names in the tree of built objects. Defaults to .Pa /usr/obj if not defined. This variable should only be set in the environment and not via .Pa /etc/make.conf or the command line. .It Va NO_WERROR If defined, compiler warnings will not cause the build to halt, even if the makefile says otherwise. .It Va WITH_CTF If defined, the build process will run the DTrace CTF conversion tools on built objects. .El .Pp Additionally, builds in .Pa /usr/src are influenced by the following .Xr make 1 variables: .Bl -tag -width ".Va SUBDIR_OVERRIDE" .It Va KERNCONF Overrides which kernel to build and install for the various kernel make targets. It defaults to .Cm GENERIC . .It Va KERNFAST If set, the build target .Cm buildkernel defaults to setting .Va NO_KERNELCLEAN , .Va NO_KERNELCONFIG , and .Va NO_KERNELOBJ . When set to a value other than .Cm 1 then .Va KERNCONF is set to the value of .Va KERNFAST . .It Va LOCAL_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the .Cm everything target. .It Va LOCAL_ITOOLS If set, this variable supplies a list of additional tools that are used by the .Cm installworld and .Cm distributeworld targets. .It Va LOCAL_LIB_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the .Cm libraries target. .It Va LOCAL_MTREE If set, this variable supplies a list of additional mtrees relative to the root of the source tree to use as part of the .Cm hierarchy target. .It Va LOCAL_TOOL_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the .Cm build-tools target. .It Va LOCAL_XTOOL_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the .Cm cross-tools target. .It Va PORTS_MODULES A list of ports with kernel modules that should be built and installed as part of the .Cm buildkernel and .Cm installkernel process. .Bd -literal -offset indent make PORTS_MODULES=emulators/kqemu-kmod kernel .Ed .It Va STRIPBIN Command to use at install time when stripping binaries. Be sure to add any additional tools required to run .Va STRIPBIN to the .Va LOCAL_ITOOLS .Xr make 1 variable before running the .Cm distributeworld or .Cm installworld targets. See .Xr install 1 for more details. .It Va SUBDIR_OVERRIDE Override the default list of sub-directories and only build the sub-directory named in this variable. If combined with .Cm buildworld then all libraries and includes, and some of the build tools will still build as well. When combined with .Cm buildworld it is necesarry to override .Va LOCAL_LIB_DIRS with any custom directories containing libraries. This allows building a subset of the system in the same way as .Cm buildworld does using its sysroot handling. This variable can also be useful when debugging failed builds. .Bd -literal -offset indent make some-target SUBDIR_OVERRIDE=foo/bar .Ed .It Va TARGET The target hardware platform. This is analogous to the .Dq Nm uname Fl m output. This is necessary to cross-build some target architectures. -For example, cross-building for PC98 machines requires -.Va TARGET_ARCH Ns = Ns Li i386 +For example, cross-building for ARM64 machines requires +.Va TARGET_ARCH Ns = Ns Li aarch64 and -.Va TARGET Ns = Ns Li pc98 . +.Va TARGET Ns = Ns Li arm64 . If not set, .Va TARGET defaults to the current hardware platform. .It Va TARGET_ARCH The target machine processor architecture. This is analogous to the .Dq Nm uname Fl p output. Set this to cross-build for a different architecture. If not set, .Va TARGET_ARCH defaults to the current machine architecture, unless .Va TARGET is also set, in which case it defaults to the appropriate value for that platform. Typically, one only needs to set .Va TARGET . .El .Pp Builds under directory .Pa /usr/src are also influenced by defining one or more of the following symbols, using the .Fl D option of .Xr make 1 : .Bl -tag -width ".Va -DNO_KERNELCONFIG" .It Va NO_CLEANDIR If set, the build targets that clean parts of the object tree use the equivalent of .Dq make clean instead of .Dq make cleandir . .It Va NO_CLEAN If set, no object tree files are cleaned at all. This is the default when .Va WITH_META_MODE is used with .Xr filemon 4 loaded. See .Xr src.conf 5 for more details. Setting .Va NO_CLEAN implies .Va NO_KERNELCLEAN , so when .Va NO_CLEAN is set no kernel objects are cleaned either. .It Va NO_CTF If set, the build process does not run the DTrace CTF conversion tools on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share subdirectory (i.e., manual pages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). .It Va NO_KERNELCLEAN If set, the build process does not run .Dq make clean as part of the .Cm buildkernel target. .It Va NO_KERNELCONFIG If set, the build process does not run .Xr config 8 as part of the .Cm buildkernel target. .It Va NO_KERNELOBJ If set, the build process does not run .Dq make obj as part of the .Cm buildkernel target. .It Va NO_DOCUPDATE If set, the update process does not update the source of the .Fx documentation as part of the .Dq make update target. .It Va NO_PORTSUPDATE If set, the update process does not update the Ports tree as part of the .Dq make update target. .It Va NO_WWWUPDATE If set, the update process does not update the www tree as part of the .Dq make update target. .El .Pp Builds under directory .Pa /usr/doc are influenced by the following .Xr make 1 variables: .Bl -tag -width ".Va DOC_LANG" .It Va DOC_LANG If set, restricts the documentation build to the language subdirectories specified as its content. The default action is to build documentation for all languages. .El .Pp Builds using the .Cm universe target are influenced by the following .Xr make 1 variables: .Bl -tag -width ".Va MAKE_JUST_KERNELS" .It Va JFLAG Pass the value of this variable to each .Xr make 1 invocation used to build worlds and kernels. This can be used to enable multiple jobs within a single architecture's build while still building each architecture serially. .It Va MAKE_JUST_KERNELS Only build kernels for each supported architecture. .It Va MAKE_JUST_WORLDS Only build worlds for each supported architecture. .It Va UNIVERSE_TARGET Execute the specified .Xr make 1 target for each supported architecture instead of the default action of building a world and one or more kernels. .El .Sh FILES .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact .It Pa /usr/doc/Makefile .It Pa /usr/doc/share/mk/doc.project.mk .It Pa /usr/ports/Mk/bsd.port.mk .It Pa /usr/ports/Mk/bsd.sites.mk .It Pa /usr/share/examples/etc/make.conf .It Pa /usr/src/Makefile .It Pa /usr/src/Makefile.inc1 .El .Sh EXAMPLES For an .Dq approved method of updating your system from the latest sources, please see the .Sx COMMON ITEMS section in .Pa src/UPDATING . .Pp The following sequence of commands can be used to cross-build the system for the sparc64 architecture on an i386 host: .Bd -literal -offset indent cd /usr/src make TARGET=sparc64 buildworld make TARGET=sparc64 DESTDIR=/clients/sparc64 installworld .Ed .Sh SEE ALSO .Xr cc 1 , .Xr install 1 , .Xr make 1 , .Xr svn 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr ports 7 , .Xr release 7 , .Xr config 8 , .Xr mergemaster 8 , .Xr portsnap 8 , .Xr reboot 8 , .Xr shutdown 8 , .Xr tests 7 .Sh AUTHORS .An Mike W. Meyer Aq Mt mwm@mired.org Index: head/share/man/man7/release.7 =================================================================== --- head/share/man/man7/release.7 (revision 312937) +++ head/share/man/man7/release.7 (revision 312938) @@ -1,793 +1,793 @@ .\" Copyright (c) 2002 Murray Stokely .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd November 20, 2015 +.Dd January 28, 2017 .Dt RELEASE 7 .Os .Sh NAME .Nm release .Nd "release building infrastructure" .Sh DESCRIPTION .Fx provides a complete build environment suitable for users to make full releases of the .Fx operating system. All of the tools necessary to build a release are available from the .Fx source code repository in .Pa src/release . A complete release can actually be built with only a single command, including the creation of ISO images suitable for burning to CD-ROM, memory stick images, and an FTP install directory. This command is aptly named .Dq Li "make release" . .Pp For some users, it may be desirable to provide an absolutely clean build environment, with no local modifications to the source tree or to .Xr make.conf 5 , and with clean checkouts of specific versions of the doc, src, and ports trees. For this purpose, a script .Pq Pa src/release/release.sh is provided to automate these checkouts and then execute .Dq Li "make release" in a clean .Xr chroot 8 . .Pp Before attempting to build a release, the user is expected to be familiar with the contents of .Xr build 7 , and should have experience upgrading systems from source. .Pp The release build process requires that .Pa /usr/obj be populated with the output of .Dq Li "make buildworld" and .Dq Li "make buildkernel" . This is necessary to provide the object files for the release or, when using .Pa release.sh , so that the object files for a complete system can be installed into a clean .Xr chroot 8 environment. .Pp If the target release build is for a different architecture or machine type, the .Va TARGET and .Va TARGET_ARCH variables must be used. See the supported .Fa release.conf variables for more information. .Pp The release procedure on some architectures may also require that the .Xr md 4 (memory disk) device driver be present in the kernel .Pq either by being compiled in or available as a module . .Pp This document does not cover source code management, quality assurance, or other aspects of the release engineering process. .Sh CLEAN RELEASE GENERATION Official releases of .Fx are produced in a totally clean environment to ensure consistency between the versions of the src, ports, and doc trees and to avoid contamination from the host system .Po such as local patches, changes to .Xr make.conf 5 , etc. .Pc . This is accomplished using the wrapper script .Pa src/release/release.sh . .Pp .Ic release.sh .Op Fl c Ar release.conf .Pp .Ic release.sh checks out the .Li src/ , .Li ports/ , and .Li doc/ trees to .Va CHROOTDIR , then calls .Dq Li "make buildworld" and .Dq Li "make installworld" to generate a .Xr chroot 8 environment. Next, .Dq Li "make release" is run within the .Xr chroot 8 environment and places the result in .Pa $CHROOTDIR/R . .Pp The optional .Fa release.conf configuration file supports the following variables: .Bl -tag -width Ev .It Va CHROOTDIR The directory within which the release will be built. .It Va CHROOT_MAKEENV Additional .Xr make 1 arguments to pass through, which directly affect the tuning of the build chroot. .It Va SVNROOT The .Xr svn 1 host used to check out the various trees. Defaults to .Pa svn://svn.FreeeBSD.org . .It Va SRCBRANCH The .Li src/ branch to use. Defaults to .Va head/@rHEAD . .It Va DOCBRANCH The .Li doc/ branch to use. Defaults to .Va head/@rHEAD . .It Va PORTBRANCH The .Li ports/ branch to use. Defaults to .Va head/@rHEAD . .It Va TARGET The target machine type for cross-building a release. .It Va TARGET_ARCH The target machine architecture for cross-building a release. .Pp For the supported list of .Va TARGET and .Va TARGET_ARCH combinations, consult the output of .Dq make targets as documented in .Xr build 7 . .It Va KERNEL The target kernel configuration to use. Defaults to .Va GENERIC . Multiple .Va KERNEL entries may be specified. .It Va MAKE_CONF The .Xr make.conf 5 to use for the release build. Defaults to .Fa /dev/null to prevent polluting the release with local system changes. .It Va SRC_CONF The .Xr src.conf 5 to use for the release build. Defaults to .Fa /dev/null to prevent polluting the release with local system changes. .It Va MAKE_FLAGS Additional flags to pass to .Xr make 1 . .It Va WORLD_FLAGS Additional flags to pass to .Xr make 1 during the .Dq buildworld phase. Defaults to setting the number of .Xr make 1 jobs .Pq Ar -j to the number of CPUs available on a SMP-capable system. .It Va KERNEL_FLAGS Additional flags to pass to .Xr make 1 during the .Dq buildkernel phase. Defaults to setting the number of .Xr make 1 jobs .Pq Ar -j to half the number of CPUs available on a SMP-capable system. .It Va NODOC Set to a non-empty value to skip the .Li doc/ tree checkout. When set, .Va NODOC will prevent the .Fa doc.txz distribution package from being created. .It Va NOPORTS Set to a non-empty value to skip the .Li ports/ tree checkout. When set, .Va NOPORTS will prevent the .Fa ports.txz distribution package from being created. Setting this also sets .Va NODOC . .It Va WITH_DVD Set to a non-empty value to include the .Cm dvdrom target. .It Va WITH_COMPRESSED_IMAGES Set to a non-empty value to compress the release images with .Xr xz 1 . The original .Pq uncompressed images are not removed. .It Va XZ_THREADS Pq Vt int Set to the number of threads .Xr xz 1 should use when compressing images. By default, .Va XZ_THREADS is set to .Va 0 , which uses all available cores on the system. .It Va VCSCMD The command run to obtain the source trees. Defaults to .Qq Cm svn checkout . .It Va CHROOTBUILD_SKIP If defined, the .Li buildworld , .Li installworld , and .Li distribution stages of the .Xr chroot 8 build environment setup are skipped. This is intended solely for cases where the .Xr chroot 8 userland are provided by alternate means. .It Va SRC_UPDATE_SKIP Set to a non-empty value to prevent checkout or update of .Fa /usr/src within the .Xr chroot 8 . This is intended for use only when .Fa /usr/src is expected to exist by alternative means. .It Va DOC_UPDATE_SKIP Set to a non-empty value to prevent checkout or update of .Fa /usr/doc within the .Xr chroot 8 . This is intended for use only when .Fa /usr/doc is expected to exist by alternative means. .It Va PORTS_UPDATE_SKIP Set to a non-empty value to prevent checkout or update of .Fa /usr/ports within the .Xr chroot 8 . This is intended for use only when .Fa /usr/ports is expected to exist by alternative means. .El .Sh EMBEDDED BUILDS The following .Fa release.conf variables are relevant only to release builds for embedded systems: .Bl -tag -width Ev .It Va EMBEDDEDBUILD Set to a non-null value to enable functionality for embedded device release builds. .Pq This option is considered highly experimental. .Pp When set, .Va WITH_DVD is unset, and .Va NODOC is defined. Additionally, .Va XDEV and .Va XDEV_ARCH must also be defined. When the build environment is created, .Fa release.sh runs a separate build script located in an architecture-specific directory in .Pa src/release/${XDEV}/ . .It Va EMBEDDEDPORTS Set to the list of any ports that are required for the target device in the format of .Fa category/port . The .Fa devel/subversion port is built by default. .It Va CROCHETSRC Set to the source URL for the Crochet build tool. .It Va CROCHETBRANCH Set to the subversion branch from .Va ${CROCHETSRC} to use. Defaults to .Pa trunk . .It Va UBOOTSRC Set to the source URL of u-boot, if required. .It Va UBOOTBRANCH Set to the subversion branch from .Va ${UBOOTSRC} to use. Defaults to .Pa trunk . .It Va UBOOTDIR Set to the target directory within .Va ${CHROOTDIR} to check out .Va ${UBOOTSRC}/${UBOOTBRANCH} . .El .Sh VIRTUAL MACHINE DISK IMAGES The following .Fa release.conf variables are relevant only to virtual machine disk image builds: .Bl -tag -width Ev .It Va WITH_VMIMAGES Set to a non-null value to build virtual machine disk images as part of the release build. .Va WITH_VMIMAGES may also be specified as an environment variable passed to .Xr make 1 . .Pp The option requires .Xr mkimg 1 version 20140927 or later. .It Va WITH_COMPRESSED_VMIMAGES Set to a non-null value to compress the virtual machine disk images with .Xr xz 1 as part of the .Cm install .Xr make 1 target. Note that compressing virtual machine disk images may take a very long time on some systems. .It Va VMBASE Set to change the name of the resulting virtual machine disk image file. The default value is .Va vm . .It Va VMSIZE Set to change the size of the virtual machine disk capacity. The default value is .Va 20G . See .Xr truncate 1 for valid values. .Pp Virtual machine disk images are, by default, created as sparse images. When .Va WITH_COMPRESSED_VMIMAGES is used, the resulting files compressed with .Xr xz 1 compress to roughly the same size, regardless of the specified disk image size. .It Va VMFORMATS Set to the target virtual disk image format(s) to create. By default, the .Va vhdf , Va vmdk , Va qcow2 , and .Va raw formats are created. See .Xr mkimg 1 for valid format values .Pq requires version 20140927 or later . .El .Pp For a list of supported .Va VMFORMATS values .Pq including cloud hosting provider formats along with a brief description, run: .Bd -literal -offset indent cd /usr/src make -C release list-vmtargets .Ed .Sh CLOUD HOSTING MACHINE IMAGES The .Fx release build tools support building virtual machine images for various cloud hosting providers, each with their own specific configuration to include support for each hosting provider by default. .Pp The following .Xr make 1 environment variables are supported: .Bl -tag -width Ev .It Va CLOUDWARE Set to a list of one or more cloud hosting providers, enclosed in quotes. Requires .Va WITH_CLOUDWARE to also be set. .It Va WITH_CLOUDWARE Set to a non-empty value to enable building virtual machine images for various cloud hosting providers. Requires .Va CLOUDWARE to also be set. .El .Pp Additionally, the .Va CLOUDWARE and .Va WITH_CLOUDWARE variables can be added to .Pa release.conf , and used in conjunction with .Pa release.sh . .Pp For a list of supported .Va CLOUDWARE values, run: .Bd -literal -offset indent cd /usr/src make -C release list-cloudware .Ed .Sh MAKEFILE TARGETS The release makefile .Pq Pa src/release/Makefile is fairly abstruse. Most developers will only be concerned with the .Cm release and .Cm install targets. .\" XXX: Some sort of introduction to this list? All the others have one. .Bl -tag -width ".Cm packagesystem" .It Cm release Meta-target to build all release media and distributions applicable to this platform. .It Cm install Copy all produced release media to .Pa ${DESTDIR} . .It Cm cdrom Builds installation CD-ROM images. This may require the .Xr md 4 (memory disk) device driver be present in the kernel (either by being compiled in or available as a module). This target produces files called .Pa disc1.iso and .Pa bootonly.iso as its output. .It Cm dvdrom Builds installation DVD-ROM images. This may require the .Xr md 4 (memory disk) device driver be present in the kernel (either by being compiled in or available as a module). This target produces the .Pa dvd1.iso file as its output. .It Cm memstick Builds an installation memory stick image named .Pa memstick.img . Not applicable on all platforms. Requires that the .Xr md 4 .Pq memory disk device driver be present in the kernel .Pq either by being compiled in or available as a module . .It Cm mini-memstick Similar to .Cm memstick , with the exception that the installation distribution sets are not included. .It Cm ftp Creates a directory named .Pa ftp containing the distribution files used in network installations and suitable for upload to an FTP mirror. .It Cm vm-image Creates virtual machine disk images in various formats. The .Cm vm-image target requires the .Va WITH_VMIMAGES .Xr make 1 environment variable to be set to a non-null value. .It Cm vm-cloudware Builds .Fx virtual machine images for various cloud hosting providers. See .Qq CLOUD HOSTING MACHINE IMAGES for implementation details. .It Cm list-cloudware Displays the list of valid .Va CLOUDWARE values. .It Cm list-vmtargets Displays the list of valid .Va VMFORMAT and .Va CLOUDWARE values. .El .Pp Major subtargets called by targets above: .Bl -tag -width ".Cm packagesystem" .It Cm packagesystem Generates all the distribution archives .Pq base, kernel, ports, doc applicable on this platform. .It Cm disc1 Builds a bootable installation system containing all the distribution files packaged by the .Cm packagesystem target, and suitable for imaging by the .Cm cdrom , .Cm dvdrom and .Cm memstick targets. .It Cm reldoc Builds the release documentation. This includes the release notes, hardware guide, and installation instructions. Other documentation, such as the Handbook, is built during the .Cm base.txz target invoked by .Cm packagesystem . .El .Sh ENVIRONMENT Optional variables: .Bl -tag -width ".Ev TARGET_ARCH" .It Ev OSRELEASE Optional base name for generated media images .Pq e.g., FreeBSD-9.0-RC2-amd64 . Defaults to the output of .Ic `uname -s`-`uname -r`-`uname -p` within the chroot. .It Ev WORLDDIR Location of a directory containing the src tree. By default, the directory above the one containing the makefile .Pq Pa src . .It Ev PORTSDIR Location of a directory containing the ports tree. By default, .Pa /usr/ports . If it is unset or cannot be found, ports will not be included in the release. .It Ev DOCDIR Location of a directory containing the doc tree. By default, .Pa /usr/doc . If it is unset or cannot be found, most documentation will not be included in the release; see .Ev NODOC below. .It Ev NOPORTS If defined, the Ports Collection will be omitted from the release. .It Ev NOSRC If set, do not include system source code in the release. .It Ev NODOC If defined, the XML-based documentation from the .Fx Documentation Project will not be built. However, the .Dq doc distribution will still be created with the minimal documentation set provided in .Pa src/share/doc . .It Ev TARGET The target hardware platform. This is analogous to the .Dq Nm uname Fl m output. This is necessary to cross-build some target architectures. -For example, cross-building for PC98 machines requires -.Ev TARGET_ARCH Ns = Ns Li i386 +For example, cross-building for ARM64 machines requires +.Ev TARGET_ARCH Ns = Ns Li aarch64 and -.Ev TARGET Ns = Ns Li pc98 . +.Ev TARGET Ns = Ns Li arm64 . If not set, .Ev TARGET defaults to the current hardware platform. .It Ev TARGET_ARCH The target machine processor architecture. This is analogous to the .Dq Nm uname Fl p output. Set this to cross-build for a different architecture. If not set, .Ev TARGET_ARCH defaults to the current machine architecture, unless .Ev TARGET is also set, in which case it defaults to the appropriate value for that platform. Typically, one only needs to set .Ev TARGET . .El .Sh FILES .Bl -tag -compact -width Pa .It Pa /usr/doc/Makefile .It Pa /usr/doc/share/mk/doc.project.mk .It Pa /usr/ports/Mk/bsd.port.mk .It Pa /usr/ports/Mk/bsd.sites.mk .It Pa /usr/share/examples/etc/make.conf .It Pa /usr/src/Makefile .It Pa /usr/src/Makefile.inc1 .It Pa /usr/src/release/Makefile .It Pa /usr/src/release/Makefile.vm .It Pa /usr/src/release/release.sh .It Pa /usr/src/release/release.conf.sample .It Pa /usr/src/release/tools/*.conf .It Pa /usr/src/release/tools/vmimage.subr .El .Sh EXAMPLES The following sequence of commands can be used to build a .Dq "-CURRENT snapshot": .Bd -literal -offset indent cd /usr svn co svn://svn.freebsd.org/base/head src cd src make buildworld buildkernel cd release make release make install DESTDIR=/var/freebsd-snapshot .Ed .Pp After running these commands, all produced distribution files (tarballs for FTP, CD-ROM images, etc.) are available in the .Pa /var/freebsd-snapshot directory. .Pp The following sequence of commands can be used to build a .Dq "-CURRENT snapshot" in a clean environment, including ports and documentation: .Bd -literal -offset indent cd /usr/src/release sh release.sh .Ed .Pp Optionally, a configuration file can be used customize the release build, such as the subversion revision to use, the branch of the subversion tree for .Li src/ , .Li ports/ , and .Li doc/ . .Bd -literal -offset indent cd /usr/src/release sh release.sh -c $HOME/release.conf .Ed .Pp After running these commands, all prepared release files are available in the .Pa /scratch directory. The target directory can be changed by specifying the .Va CHROOTDIR variable in .Li release.conf . .Sh SEE ALSO .Xr cc 1 , .Xr install 1 , .Xr make 1 , .Xr svn 1 Pq Pa ports/devel/subversion , .Xr uname 1 , .Xr md 4 , .Xr make.conf 5 , .Xr build 7 , .Xr ports 7 , .Xr chroot 8 , .Xr mtree 8 , .Xr sysctl 8 .Rs .%T "FreeBSD Release Engineering" .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/ .Re .Rs .%T "FreeBSD Developers' Handbook" .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/ .Re .Sh HISTORY .Fx 1.x used a manual checklist, compiled by .An Rod Grimes , to produce a release. Apart from being incomplete, the list put a lot of specific demands on available file systems and was quite torturous to execute. .Pp As part of the .Fx 2.0 release engineering effort, significant effort was spent getting .Pa src/release/Makefile into a shape where it could at least automate most of the tediousness of building a release in a sterile environment. .Pp For the .Fx 9.0 release, .Pa src/release/Makefile was overhauled and the wrapper script .Pa src/release/generate-release.sh introduced to support the introduction of a new installer. .Pp For the .Fx 9.2 release, .Pa src/release/release.sh was introduced to support per-build configuration files. .Pa src/release/release.sh is heavily based on the .Pa src/release/generate-release.sh script. .Pp At near 1000 revisions spread over multiple branches, the .Xr svn 1 log of .Pa src/release/Makefile contains a vivid historical record of some of the hardships release engineers go through. .Sh AUTHORS .Pa src/release/Makefile was originally written by .An -nosplit .An Rod Grimes , .An Jordan Hubbard , and .An Poul-Henning Kamp . .Pp This manual page was originally written by .An Murray Stokely Aq Mt murray@FreeBSD.org . .Pp It was updated by .An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org to include the .Fa generate-release.sh script used for the .Fx 9.0 release cycle. .Pp It was later updated by .An Glen Barber Aq Mt gjb@FreeBSD.org to include the .Fa release.sh script used for the .Fx 9.2 release cycle.