RELEASE(7)
π NAME π
release β release building infrastructure.
okay bestie, this is the Miscellaneous Information Manual page for release(7), and it's basically the blueprint for building full FreeBSD releases. π
β¨ DESCRIPTION β¨
FreeBSD provides a complete build environment suitable for users to make full releases of the FreeBSD operating system. All of the tools necessary to build a release are available from the FreeBSD source code repository in src/release. A complete release can be built with only a single command, including the creation of ISO images suitable for burning to CD-ROM, memory stick images, and a network install directory. This command is aptly named make release β yes, that's literally the name, and it's iconic. π
For some users, it may be desirable to provide an absolutely clean build environment, with no local modifications to the source tree or to make.conf(5), and with clean checkouts of specific versions of the doc, src, and ports trees. For this purpose, a script (src/release/release.sh) is provided to automate these checkouts and then execute make release in a clean chroot(8). clean girl build energy β¨
Before attempting to build a release, the user is expected to be familiar with the contents of build(7), and should have experience upgrading systems from source. highkey read up first, bestie.
The release build process requires that /usr/obj be populated with the output of make buildworld and make buildkernel. This is necessary to provide the object files for the release or, when using release.sh, so that the object files for a complete system can be installed into a clean chroot(8) environment.
If the target release build is for a different architecture or machine type, the TARGET and TARGET_ARCH variables must be used. See the supported release.conf variables for more information.
The release procedure on some architectures may also require that the md(4) (memory disk) device driver be present in the kernel (either by being compiled in or available as a module).
This document does not cover source code management, quality assurance, or other aspects of the release engineering process. periodt.
π CLEAN RELEASE GENERATION π
Official releases of FreeBSD are produced in a clean environment to ensure consistency between the versions of the src, ports, and doc trees and to avoid contamination from the host system (such as local patches, changes to make.conf(5), etc.). This is accomplished using the wrapper script src/release/release.sh. no cap, the clean environment is the whole point π«Ά
release.sh [-c release.conf]
release.sh checks out the src/, ports/, and doc/ trees to CHROOTDIR, then calls make buildworld and make installworld to generate a chroot(8) environment. Next, make release is run within the chroot(8) environment and places the result in $CHROOTDIR/R. slay.
The optional release.conf configuration file supports the following variables:
CHROOTDIRβ the directory within which the release will be built. Defaults to/scratch.CHROOT_MAKEENVβ additionalmake(1)arguments to pass through, which directly affect the tuning of the build chroot.NOGITβ do not explicitly require thegit(1)port to be installed.GITROOTβ thegit(1)host used to check out the various trees. Defaults tohttps://git.FreeBSD.org.SRCBRANCHβ thesrc/branch to use. Defaults to-b main.PORTBRANCHβ theports/branch to use. Defaults tohead/@rHEAD.TARGETβ the target machine type for cross-building a release.TARGET_ARCHβ the target machine architecture for cross-building a release.
For the supported list of TARGET and TARGET_ARCH combinations, consult the output of make targets as documented in build(7).
KERNELβ the target kernel configuration to use. Defaults toGENERIC. MultipleKERNELentries may be specified.MAKE_CONFβ themake.conf(5)to use for the release build. Defaults to/dev/nullto prevent polluting the release with local system changes.SRC_CONFβ thesrc.conf(5)to use for the release build. Defaults to/dev/nullto prevent polluting the release with local system changes.MAKE_FLAGSβ additional flags to pass tomake(1).WORLD_FLAGSβ additional flags to pass tomake(1)during thebuildworldphase. Defaults to setting the number ofmake(1)jobs (-j) to the number of CPUs available on a SMP-capable system.KERNEL_FLAGSβ additional flags to pass tomake(1)during thebuildkernelphase. Defaults to setting the number ofmake(1)jobs (-j) to half the number of CPUs available on a SMP-capable system.NOPORTSβ set to a non-empty value to skip theports/tree checkout. When set,NOPORTSwill prevent theports.txzdistribution package from being created.WITH_DVDβ set to a non-empty value to include thedvdromtarget.WITH_COMPRESSED_IMAGESβ set to a non-empty value to compress the release images withxz(1). The original (uncompressed) images are not removed.XZ_THREADS(int) β set to the number of threadsxz(1)should use when compressing images. By default,XZ_THREADSis set to0, which uses all available cores on the system.VCSCMDβ the command run to obtain the source trees. Defaults to"git clone -q".CHROOTBUILD_SKIPβ if defined, thebuildworld,installworld, anddistributionstages of thechroot(8)build environment setup are skipped. This is intended solely for cases where thechroot(8)userland are provided by alternate means.SRC_UPDATE_SKIPβ set to a non-empty value to prevent checkout or update of/usr/srcwithin thechroot(8). This is intended for use only when/usr/srcis expected to exist by alternative means.PORTS_UPDATE_SKIPβ set to a non-empty value to prevent checkout or update of/usr/portswithin thechroot(8). This is intended for use only when/usr/portsis expected to exist by alternative means.PKGBASEβ include base system packages for use withpkg(8)on the install media, instead of legacy tarball distribution sets.PKG_CMDβ a path to thepkg(8)executable to use when installing packages in release images as a non-root user.PKG_REPOS_DIRβ an optional path to a directory containingpkg(8)repository configuration files. These configuration files will be used when installing packages in release images as a non-root user.PKG_REPO_NAMEβ the name of the repository configuration to use when installing packages in release images as a non-root user.
π§ EMBEDDED BUILDS π§
The following release.conf variables are relevant only to release builds for embedded systems:
EMBEDDEDBUILDβ set to a non-null value to enable functionality for embedded device release builds.
When set, WITH_DVD is unset. Additionally, EMBEDDED_TARGET and EMBEDDED_TARGET_ARCH must also be defined. When the build environment is created, release.sh runs a separate build script located in an architecture-specific directory in src/release/${EMBEDDED_TARGET}/.
EMBEDDEDPORTSβ set to the list of any ports that are required for the target device in the format ofcategory/port.EMBEDDED_TARGETβ when set, its value is passed tomake(1)to set theTARGET(value ofuname -m) to cross build the target userland.EMBEDDED_TARGET_ARCHβ when set, its value is passed tomake(1)to set theTARGET_ARCH(value ofuname -p) to cross build the target userland.
πΈ VIRTUAL MACHINE DISK IMAGES πΈ
The following release.conf variables are relevant only to virtual machine disk image builds:
WITH_VMIMAGESβ set to a non-null value to build virtual machine disk images as part of the release build.WITH_VMIMAGESmay also be specified as an environment variable passed tomake(1).WITH_COMPRESSED_VMIMAGESβ set to a non-null value to compress the virtual machine disk images withxz(1)as part of the installmake(1)target. Note that compressing virtual machine disk images may take a very long time on some systems. πVMBASEβ set to change the name of the resulting virtual machine disk image file. The default value isvm.VMSIZEβ set to change the size of the virtual machine disk capacity. The default value is20g. Seemakefs(8)for valid values.
Virtual machine disk images are, by default, created as sparse images. When WITH_COMPRESSED_VMIMAGES is used, the resulting files compressed with xz(1) compress to roughly the same size, regardless of the specified disk image size.
VMFSβ (Deprecated.) Set to specify which of the filesystem(s) listed inVMFSLISTis linked to the historical non-filesystem-labelled file name. Valid values areufsandzfs. The default value isufs.
π¨ Deprecated alert: VMFS is deprecated, bestie β it's giving legacy vibes.
VMFSLISTβ set to specify the list of file system types to build images for. Valid values are one or both ofufsandzfs. The default value isufs zfs.VMFORMATSβ set to the target virtual disk image format(s) to create. By default, thevhdf,vmdk,qcow2, andrawformats are created. Seemkimg(1)for valid format values.
For a list of supported VMFORMATS values (including cloud hosting provider formats) along with a brief description, run:
cd /usr/src
make -C release list-vmtargets
βοΈ CLOUD HOSTING MACHINE IMAGES βοΈ
okay so the FreeBSD release build tools are not just out here making one generic image β they literally support building virtual machine images for a whole bunch of cloud hosting providers, and each one has its own specific configuration so that provider's support is baked in by default. iconic behavior honestly π
The following make(1) environment variables are supported:
CLOUDWAREβ set this to a list of one or more cloud hosting providers, wrapped in quotes. bestie, it requiresWITH_CLOUDWAREto also be set.WITH_CLOUDWAREβ set this to a non-empty value to enable building virtual machine images for the various cloud hosting providers. it requiresCLOUDWAREto also be set.
Also!! both CLOUDWARE and WITH_CLOUDWARE can be dropped into release.conf and used together with release.sh. teamwork π«Ά
For a list of supported CLOUDWARE values, run:
cd /usr/src
make -C release list-cloudware
π³ OCI IMAGES π³
The FreeBSD release build tools have experimental support for building Open Container Initiative (OCI) format container base images. ngl, experimental means experimental, so go in knowing that. This is enabled using a release.conf variable:
WITH_OCIIMAGESβ set to a non-null value to build OCI base images.
π οΈ MAKEFILE TARGETS π οΈ
So the release makefile (src/release/Makefile) is, and I'm quoting the vibes here, fairly abstruse. Most developers will only ever care about the release and install targets. that's it, that's the whole relationship π
releaseβ meta-target to build all release media and distributions applicable to this platform. the main character πinstallβ copy all produced release media to${DESTDIR}.cdromβ builds installation CD-ROM images. This may require themd(4)(memory disk) device driver be present in the kernel (either by being compiled in or available as a module). This target produces files calleddisc1.isoandbootonly.isoas its output.dvdromβ builds installation DVD-ROM images. This may require themd(4)(memory disk) device driver be present in the kernel (either by being compiled in or available as a module). This target produces thedvd1.isofile as its output.memstickβ builds an installation memory stick image namedmemstick.img. Not applicable on all platforms. Requires that themd(4)(memory disk) device driver be present in the kernel (either by being compiled in or available as a module).mini-memstickβ similar tomemstick, with the exception that the installation distribution sets are not included. the low-key version πftpβ creates a directory namedftpcontaining the distribution files used in network installations and suitable for upload to an FTP mirror.vm-imageβ creates virtual machine disk images in various formats. Thevm-imagetarget requires theWITH_VMIMAGESmake(1)environment variable to be set to a non-null value.vm-cloudwareβ builds FreeBSD virtual machine images for various cloud hosting providers. See "CLOUD HOSTING MACHINE IMAGES" for implementation details.list-cloudwareβ displays the list of validCLOUDWAREvalues.list-vmtargetsβ displays the list of validVMFORMATSandCLOUDWAREvalues.
β¨ Major subtargets called by targets above β¨
packagesystemβ generates all the distribution archives (base,kernel,ports,doc) applicable on this platform.disc1β builds a bootable installation system containing all the distribution files packaged by thepackagesystemtarget, and suitable for imaging by thecdrom,dvdromandmemsticktargets.reldocβ builds the release documentation. This includes the release notes, hardware guide, and installation instructions. Other documentation, such as the Handbook, is built during thebase.txztarget invoked bypackagesystem.
heads up bestie: reldoc gets removed later on in this page β see COMPATIBILITY. yes i'm being serious, keep scrolling π
π± ENVIRONMENT π±
Optional variables, all of them, no skips:
OSRELEASEβ optional base name for generated media images when invoking theinstalltarget (e.g.,FreeBSD-12.1-RELEASE-amd64). Defaults to the output ofuname -s-uname -r-uname -pwithin the chroot.WORLDDIRβ location of a directory containing the src tree. By default, the directory above the one containing the makefile (src).PORTSDIRβ location of a directory containing the ports tree. By default,/usr/ports. If it is unset or cannot be found, ports will not be included in the release.NOPORTSβ if defined, the Ports Collection will be omitted from the release.NOSRCβ if set, do not include system source code in the release.TARGETβ the target hardware platform. This is analogous to the "uname -m" output. This is necessary to cross-build some target architectures. For example, cross-building for ARM64 machines requiresTARGET_ARCH=aarch64andTARGET=arm64. If not set,TARGETdefaults to the current hardware platform.TARGET_ARCHβ the target machine processor architecture. This is analogous to the "uname -p" output. Set this to cross-build for a different architecture. If not set,TARGET_ARCHdefaults to the current machine architecture, unlessTARGETis also set, in which case it defaults to the appropriate value for that platform. Typically, one only needs to setTARGET.
π FILES π
the whole lineup, every single one πΈ
/scratch/usr/doc/Makefile/usr/doc/share/mk/doc.project.mk/usr/ports/Mk/bsd.port.mk/usr/ports/Mk/bsd.sites.mk/usr/share/examples/etc/make.conf/usr/src/Makefile/usr/src/Makefile.inc1/usr/src/release/Makefile/usr/src/release/Makefile.vm/usr/src/release/release.sh/usr/src/release/release.conf.sample/usr/src/release/tools/*.conf/usr/src/release/tools/vmimage.subr
π§ͺ EXAMPLES π§ͺ
okay this is the part where it gets good. The following sequence of commands can be used to build a "-CURRENT snapshot":
cd /usr
git clone -b main https://git.freebsd.org/src.git src
cd src
make buildworld buildkernel
cd release
make obj
make release
make install DESTDIR=/var/freebsd-snapshot
After running these commands, all produced distribution files (tarballs for FTP, CD-ROM images, etc.) are available in the /var/freebsd-snapshot directory. slay π
The following sequence of commands can be used to build a "-CURRENT snapshot" in a clean environment, including ports and documentation:
cd /usr/src/release
sh release.sh
Optionally, a configuration file can be used to customize the release build:
cd /usr/src/release
sh release.sh -c $HOME/release.conf
Configuration files specific to various supported embedded systems, such as the Raspberry Pi, exist in the directory corresponding to the TARGET make(1) variable. For example, to build an image for 64-bit Raspberry Pis:
cd /usr/src/release
sh release.sh -c arm64/RPI.conf
After running these commands, all prepared release files are available in the /scratch directory. The target directory can be changed by specifying the CHROOTDIR variable in release.conf. cute and configurable π
β οΈ COMPATIBILITY β οΈ
The reldoc target was removed in commit f61e92ca5a23, and DOCDIR, DOCBRANCH, DOC_UPDATE_SKIP, and NODOC are therefore no longer supported. rip to those, they're gone gone πͺ¦
π SEE ALSO π
cc(1), git(1) (ports/devel/git), install(1), make(1), mkimg(1), uname(1), md(4), make.conf(5), build(7), ports(7), chroot(8), mtree(8), sysctl(8)
FreeBSD Release Engineering, https://docs.freebsd.org/en/articles/freebsd-releng/.
FreeBSD Developers' Handbook, https://docs.freebsd.org/en/books/developers-handbook/.
π HISTORY π
FreeBSD 1.x used a manual checklist, compiled by 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. literally torture, no cap π
As part of the FreeBSD 2.0 release engineering effort, significant effort was spent getting src/release/Makefile into a shape where it could at least automate most of the tediousness of building a release in a sterile environment.
For the FreeBSD 9.0 release, src/release/Makefile was overhauled and the wrapper script src/release/generate-release.sh introduced to support the introduction of a new installer.
For the FreeBSD 9.2 release, src/release/release.sh was introduced to support per-build configuration files. src/release/release.sh is heavily based on the src/release/generate-release.sh script.
At near 1000 revisions spread over multiple branches, the git(1) log of src/release/Makefile contains a vivid historical record of some of the hardships release engineers go through. nearly a thousand revisions of pure struggle, i respect it deeply π«‘
π AUTHORS π
src/release/Makefile was originally written by Rod Grimes, Jordan Hubbard, and Poul-Henning Kamp.
This manual page was originally written by Murray Stokely <murray@FreeBSD.org>.
It was updated by Nathan Whitehorn <nwhitehorn@FreeBSD.org> to include the generate-release.sh script used for the FreeBSD 9.0 release cycle.
It was later updated by Glen Barber <gjb@FreeBSD.org> to include the release.sh script used for the FreeBSD 9.2 release cycle.
and that's the whole page bestie, you ate that π
β¨ this lil writeup came to you from the Debian source, version matching RELEASE(7), dated October 13, 2025 β screenshot the date, it's iconic, bye π¦π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- π the page's license: BSD-2-Clause
- Copyright (c) 2002 Murray Stokely <murray@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms