1 .\" Copyright (c) 2002 Murray Stokely <murray@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd "release building infrastructure"
35 provides a complete build environment suitable for users to make
39 All of the tools necessary to build a release are available from the
41 source code repository in
43 A complete release can actually be built with only a single command,
44 including the creation of ISO images suitable for burning to CD-ROM,
45 memory stick images, and an FTP install directory.
46 This command is aptly named
47 .Dq Li "make release" .
49 For some users, it may be desirable to provide an absolutely clean
50 build environment, with no local modifications to the source tree or to
52 and with clean checkouts of specific versions of the doc, src, and ports
54 For this purpose, a script
55 .Pq Pa src/release/release.sh
56 is provided to automate these checkouts and then execute
61 Before attempting to build a release, the user is expected to be
62 familiar with the contents of
64 and should have experience upgrading systems from source.
66 The release build process requires that
68 be populated with the output of
69 .Dq Li "make buildworld"
71 .Dq Li "make buildkernel" .
72 This is necessary to provide the object files for the release or, when
75 so that the object files for a complete system can be installed into a clean
79 If the target release build is for a different architecture or machine type,
84 variables must be used.
87 variables for more information.
89 The release procedure on some architectures may also require that the
91 (memory disk) device driver be present in the kernel
92 .Pq either by being compiled in or available as a module .
94 This document does not cover source code management, quality
95 assurance, or other aspects of the release engineering process.
96 .Sh CLEAN RELEASE GENERATION
99 are produced in a totally clean environment to
100 ensure consistency between the versions of the src, ports, and doc trees
101 and to avoid contamination from the host system
102 .Po such as local patches, changes
107 This is accomplished using the wrapper script
108 .Pa src/release/release.sh .
111 .Op Fl c Ar release.conf
122 .Dq Li "make buildworld"
124 .Dq Li "make installworld"
129 .Dq Li "make release"
132 environment and places the result in
137 configuration file supports the following variables:
140 The directory within which the release will be built.
141 .It Va CHROOT_MAKEENV
144 arguments to pass through, which directly affect the
145 tuning of the build chroot.
149 host used to check out the various trees.
151 .Pa svn://svn.FreeeBSD.org .
171 The target machine type for cross-building a release.
173 The target machine architecture for cross-building a release.
175 For the supported list of
179 combinations, consult the output of
184 The target kernel configuration to use.
189 entries may be specified.
193 to use for the release build.
196 to prevent polluting the release with local system changes.
200 to use for the release build.
203 to prevent polluting the release with local system changes.
205 Additional flags to pass to
208 Additional flags to pass to
213 Defaults to setting the number of
217 to the number of CPUs available on a SMP-capable system.
219 Additional flags to pass to
224 Defaults to setting the number of
228 to half the number of CPUs available on a SMP-capable system.
230 Set to a non-empty value to skip the
237 distribution package from being created.
239 Set to a non-empty value to skip the
246 distribution package from being created.
247 Setting this also sets
250 Set to a non-empty value to include the
253 .It Va WITH_COMPRESSED_IMAGES
254 Set to a non-empty value to compress the release images with
258 images are not removed.
259 .It Va XZ_THREADS Pq Vt int
260 Set to the number of threads
262 should use when compressing images.
267 which uses all available cores on the system.
269 The command run to obtain the source trees.
271 .Qq Cm svn checkout .
272 .It Va CHROOTBUILD_SKIP
280 build environment setup are skipped.
281 This is intended solely for cases where the
283 userland are provided by alternate means.
284 .It Va SRC_UPDATE_SKIP
285 Set to a non-empty value to prevent checkout or update of
289 This is intended for use only when
291 is expected to exist by alternative means.
292 .It Va DOC_UPDATE_SKIP
293 Set to a non-empty value to prevent checkout or update of
297 This is intended for use only when
299 is expected to exist by alternative means.
300 .It Va PORTS_UPDATE_SKIP
301 Set to a non-empty value to prevent checkout or update of
305 This is intended for use only when
307 is expected to exist by alternative means.
312 variables are relevant only to release builds for embedded systems:
315 Set to a non-null value to enable functionality for embedded device
317 .Pq This option is considered highly experimental.
328 must also be defined.
329 When the build environment is created,
331 runs a separate build script located in an architecture-specific
333 .Pa src/release/${XDEV}/ .
335 Set to the list of any ports that are required for the target device
340 port is built by default.
342 Set to the source URL for the Crochet build tool.
344 Set to the subversion branch from
350 Set to the source URL of u-boot, if required.
352 Set to the subversion branch from
358 Set to the target directory within
361 .Va ${UBOOTSRC}/${UBOOTBRANCH} .
363 .Sh VIRTUAL MACHINE DISK IMAGES
366 variables are relevant only to virtual machine disk image builds:
369 Set to a non-null value to build virtual machine disk images as part
370 of the release build.
372 may also be specified as an environment variable passed to
377 version 20140927 or later.
378 .It Va WITH_COMPRESSED_VMIMAGES
379 Set to a non-null value to compress the virtual machine disk images with
385 Note that compressing virtual machine disk images may take a very long
386 time on some systems.
388 Set to change the name of the resulting virtual machine disk image file.
392 Set to change the size of the virtual machine disk capacity.
399 Virtual machine disk images are, by default, created as sparse images.
401 .Va WITH_COMPRESSED_VMIMAGES
402 is used, the resulting files compressed with
404 compress to roughly the same size, regardless of the specified disk image
407 Set to the target virtual disk image format(s) to create.
409 .Va vhdf , Va vmdk , Va qcow2 ,
415 for valid format values
416 .Pq requires version 20140927 or later .
419 For a list of supported
422 .Pq including cloud hosting provider formats
423 along with a brief description, run:
424 .Bd -literal -offset indent
426 make -C release list-vmtargets
428 .Sh CLOUD HOSTING MACHINE IMAGES
431 release build tools support building virtual machine images for various
432 cloud hosting providers, each with their own specific configuration to
433 include support for each hosting provider by default.
437 environment variables are supported:
440 Set to a list of one or more cloud hosting providers, enclosed in quotes.
444 .It Va WITH_CLOUDWARE
445 Set to a non-empty value to enable building virtual machine images
446 for various cloud hosting providers.
456 variables can be added to
458 and used in conjunction with
461 For a list of supported
464 .Bd -literal -offset indent
466 make -C release list-cloudware
470 .Pq Pa src/release/Makefile
472 Most developers will only be concerned with the
477 .\" XXX: Some sort of introduction to this list? All the others have one.
478 .Bl -tag -width ".Cm packagesystem"
480 Meta-target to build all release media and distributions applicable to this
483 Copy all produced release media to
486 Builds installation CD-ROM images.
489 (memory disk) device driver be present in the kernel
490 (either by being compiled in or available as a module).
491 This target produces files called
497 Builds installation DVD-ROM images.
500 (memory disk) device driver be present in the kernel
501 (either by being compiled in or available as a module).
502 This target produces the
506 Builds an installation memory stick image named
508 Not applicable on all platforms.
512 device driver be present in the kernel
513 .Pq either by being compiled in or available as a module .
517 with the exception that the installation distribution sets
520 Creates a directory named
522 containing the distribution files used in network installations
523 and suitable for upload to an FTP mirror.
525 Creates virtual machine disk images in various formats.
531 environment variable to be set to a non-null value.
535 virtual machine images for various cloud hosting providers.
537 .Qq CLOUD HOSTING MACHINE IMAGES
538 for implementation details.
539 .It Cm list-cloudware
540 Displays the list of valid
543 .It Cm list-vmtargets
544 Displays the list of valid
551 Major subtargets called by targets above:
552 .Bl -tag -width ".Cm packagesystem"
554 Generates all the distribution archives
555 .Pq base, kernel, ports, doc
556 applicable on this platform.
558 Builds a bootable installation system containing all the distribution files
561 target, and suitable for imaging by the
568 Builds the release documentation.
569 This includes the release notes,
570 hardware guide, and installation instructions.
571 Other documentation, such as the Handbook,
579 .Bl -tag -width ".Ev TARGET_ARCH"
581 Optional base name for generated media images
582 .Pq e.g., FreeBSD-9.0-RC2-amd64 .
583 Defaults to the output of
584 .Ic `uname -s`-`uname -r`-`uname -p`
587 Location of a directory containing the src tree.
588 By default, the directory
589 above the one containing the makefile
592 Location of a directory containing the ports tree.
595 If it is unset or cannot be found, ports will not be included in the release.
597 Location of a directory containing the doc tree.
600 If it is unset or cannot be found, most documentation will not be included in
605 If defined, the Ports Collection will be omitted from the release.
607 If set, do not include system source code in the release.
609 If defined, the XML-based documentation from the
611 Documentation Project will not be built.
614 distribution will still be created with the minimal documentation set
618 The target hardware platform.
619 This is analogous to the
622 This is necessary to cross-build some target architectures.
623 For example, cross-building for PC98 machines requires
624 .Ev TARGET_ARCH Ns = Ns Li i386
626 .Ev TARGET Ns = Ns Li pc98 .
629 defaults to the current hardware platform.
631 The target machine processor architecture.
632 This is analogous to the
635 Set this to cross-build for a different architecture.
638 defaults to the current machine architecture, unless
640 is also set, in which case it defaults to the appropriate
641 value for that platform.
642 Typically, one only needs to set
646 .Bl -tag -compact -width Pa
647 .It Pa /usr/doc/Makefile
648 .It Pa /usr/doc/share/mk/doc.project.mk
649 .It Pa /usr/ports/Mk/bsd.port.mk
650 .It Pa /usr/ports/Mk/bsd.sites.mk
651 .It Pa /usr/share/examples/etc/make.conf
652 .It Pa /usr/src/Makefile
653 .It Pa /usr/src/Makefile.inc1
654 .It Pa /usr/src/release/Makefile
655 .It Pa /usr/src/release/Makefile.vm
656 .It Pa /usr/src/release/release.sh
657 .It Pa /usr/src/release/release.conf.sample
658 .It Pa /usr/src/release/tools/*.conf
659 .It Pa /usr/src/release/tools/vmimage.subr
662 The following sequence of commands can be used to build a
663 .Dq "-CURRENT snapshot":
664 .Bd -literal -offset indent
666 svn co svn://svn.freebsd.org/base/head src
668 make buildworld buildkernel
671 make install DESTDIR=/var/freebsd-snapshot
674 After running these commands, all produced distribution files (tarballs
675 for FTP, CD-ROM images, etc.) are available in the
676 .Pa /var/freebsd-snapshot
679 The following sequence of commands can be used to build a
680 .Dq "-CURRENT snapshot"
681 in a clean environment, including ports and documentation:
682 .Bd -literal -offset indent
687 Optionally, a configuration file can be used customize the release build,
688 such as the subversion revision to use, the branch of the subversion tree for
693 .Bd -literal -offset indent
695 sh release.sh -c $HOME/release.conf
698 After running these commands, all prepared release files are available in the
701 The target directory can be changed by specifying the
709 .Xr svn 1 Pq Pa ports/devel/subversion ,
719 .%T "FreeBSD Release Engineering"
720 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/
723 .%T "FreeBSD Developers' Handbook"
724 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/
729 used a manual checklist, compiled by
731 to produce a release.
732 Apart from being incomplete, the list put a lot of specific demands on
733 available file systems and was quite torturous to execute.
737 release engineering effort, significant
738 effort was spent getting
739 .Pa src/release/Makefile
740 into a shape where it could at least automate most of the tediousness
741 of building a release in a sterile environment.
746 .Pa src/release/Makefile
747 was overhauled and the wrapper script
748 .Pa src/release/generate-release.sh
749 introduced to support the introduction of a new installer.
754 .Pa src/release/release.sh
755 was introduced to support per-build configuration files.
756 .Pa src/release/release.sh
757 is heavily based on the
758 .Pa src/release/generate-release.sh
761 At near 1000 revisions spread over multiple branches, the
764 .Pa src/release/Makefile
765 contains a vivid historical record of some
766 of the hardships release engineers go through.
768 .Pa src/release/Makefile
769 was originally written by
774 .An Poul-Henning Kamp .
776 This manual page was originally written by
777 .An Murray Stokely Aq Mt murray@FreeBSD.org .
780 .An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org
782 .Fa generate-release.sh
787 It was later updated by
788 .An Glen Barber Aq Mt gjb@FreeBSD.org