RELEASE(7) | MidnightBSD Miscellaneous Information Manual | RELEASE(7) |
release
— release
building infrastructure
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
”.
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).
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.
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.
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.
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.
The optional release.conf configuration file supports the following variables:
src/
branch to use. Defaults to
head/@rHEAD.doc/
branch to use. Defaults to
head/@rHEAD.ports/
branch to use. Defaults to
head/@rHEAD.For the supported list of TARGET and TARGET_ARCH combinations, consult the output of “make targets” as documented in build(7).
doc/
tree
checkout. When set, NODOC will prevent the
doc.txz distribution package from being
created.ports/
tree
checkout. When set, NOPORTS will prevent the
ports.txz distribution package from being created.
Setting this also sets NODOC.dvdrom
target.svn checkout
".buildworld
,
installworld
, and
distribution
stages of the
chroot(8) build
environment setup are skipped. This is intended solely for cases where the
chroot(8) userland are
provided by alternate means.The following release.conf variables are relevant only to release builds for embedded systems:
When set, WITH_DVD is unset, and NODOC is defined. 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}/.
uname
-m
) to cross build the target userland.uname
-p
) to cross build the target userland.The following release.conf variables are relevant only to virtual machine disk image builds:
The option requires mkimg(1) version 20140927 or later.
install
make(1) target. Note that
compressing virtual machine disk images may take a very long time on some
systems.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.
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
The FreeBSD 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.
The following make(1) environment variables are supported:
Additionally, the CLOUDWARE and WITH_CLOUDWARE variables can be added to release.conf, and used in conjunction with release.sh.
For a list of supported CLOUDWARE values, run:
cd /usr/src make -C release list-cloudware
The release makefile
(src/release/Makefile) is fairly abstruse. Most
developers will only be concerned with the release
and install
targets.
release
install
cdrom
dvdrom
memstick
mini-memstick
memstick
, with the exception that the
installation distribution sets are not included.ftp
vm-image
vm-image
target requires the
WITH_VMIMAGES
make(1) environment
variable to be set to a non-null value.vm-cloudware
list-cloudware
list-vmtargets
Major subtargets called by targets above:
packagesystem
disc1
packagesystem
target, and
suitable for imaging by the cdrom
,
dvdrom
and memstick
targets.reldoc
base.txz
target invoked by packagesystem
.Optional variables:
OSRELEASE
install
target (e.g., FreeBSD-12.1-RELEASE-amd64).
Defaults to the output of `uname -s`-`uname -r`-`uname
-p`
within the chroot.WORLDDIR
PORTSDIR
DOCDIR
NODOC
below.NOPORTS
NOSRC
NODOC
TARGET
uname
-m
”
output. This is necessary to cross-build some target architectures. For
example, cross-building for ARM64 machines requires
TARGET_ARCH
=aarch64
and
TARGET
=arm64
. If not set,
TARGET
defaults to the current hardware
platform.TARGET_ARCH
uname
-p
”
output. Set this to cross-build for a different architecture. If not set,
TARGET_ARCH
defaults to the current machine
architecture, unless TARGET
is also set, in which
case it defaults to the appropriate value for that platform. Typically,
one only needs to set TARGET
.The following sequence of commands can be used to build a “-CURRENT snapshot”:
cd /usr svn co svn://svn.freebsd.org/base/head 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.
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 customize the release
build, such as the subversion revision to use, the branch of the subversion
tree for src/
, ports/
, and
doc/
.
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 the Raspberry Pi:
cd /usr/src/release sh release.sh -c arm/RPI-B.conf
To build an image for the Raspberry Pi 3:
cd /usr/src/release sh release.sh -c arm64/RPI3.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
.
cc(1), install(1), make(1), svn(1) (ports/devel/subversion), uname(1), md(4), make.conf(5), build(7), ports(7), chroot(8), mtree(8), sysctl(8)
FreeBSD Release Engineering, https://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/freebsd-releng/.
FreeBSD Developers' Handbook, https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/.
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.
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 svn(1) log of src/release/Makefile contains a vivid historical record of some of the hardships release engineers go through.
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.
September 1, 2020 | midnightbsd-3.1 |