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
53 trees. For this purpose, a script
54 .Pq Pa src/release/generate-release.sh
55 is provided to automate these checkouts and then execute
60 Before attempting to build a release, the user is expected to be
61 familiar with the contents of
63 and should have experience upgrading systems from source.
65 The release build process requires that
67 be populated with the output of
68 .Dq Li "make buildworld"
70 .Dq Li "make buildkernel" .
71 This is necessary to provide the object files for the release or, when
73 .Pa generate-release.sh ,
74 so that the object files for a complete system can be installed into a clean
76 environment. In this second case, the built world must be capable of running
77 on the build system (i.e. it must be for the same architecture and be
78 compatible with the installed kernel).
79 The release procedure on some architectures may also require that the
81 (memory disk) device driver be present in the kernel
82 (either by being compiled in or available as a module).
84 This document does not cover source code management, quality
85 assurance, or other aspects of the release engineering process.
86 .Sh CLEAN RELEASE GENERATION
87 Official releases of FreeBSD are produced in a totally clean environment to
88 ensure consistency between the versions of the src, ports, and doc trees
89 and to avoid contamination from the host system (e.g. local patches, changes
92 etc.). This is accomplished using the wrapper script
93 .Pa src/release/generate-release.sh .
95 .Ic generate-release.sh
96 svn-branch scratch-dir
98 .Ic generate-release.sh
100 .Dq Li "make installworld"
105 It then checks out the src tree specified by
109 Once the various source trees have been obtained, it executes
110 .Dq Li "make release"
113 environment and places the result in
115 Note that because this uses a chroot, it cannot be used to cross-build
119 Environment variables:
120 .Bl -tag -width ".Cm MAKE_FLAGS"
122 This environment variable can be set to pass flags (e.g. -j) to
124 when invoked by the script.
126 The location of the FreeBSD SVN source, doc, and ports repositories.
128 .Pa svn://svn.freebsd.org/base
130 .Pa svn://svn.freebsd.org/ports/head
131 for the Ports Collection, and
132 .Pa svn://svn.freebsd.org/doc/head
133 for the Documentation Project source.
135 Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64).
136 Defaults to the output of
137 .Ic `uname -s`-`uname -r`-`uname -p`
142 .Pq Pa src/release/Makefile
144 Most developers will only be concerned with the
149 .\" XXX: Some sort of introduction to this list? All the others have one.
150 .Bl -tag -width ".Cm packagesystem"
152 Meta-target to build all release media and distributions applicable to this
155 Copy all produced release media to
158 Builds installation CD-ROM images. On some systems, this may require that
161 .Pq Pa sysutils/cdrtools
162 and possibly that the
164 (memory disk) device driver be present in the kernel
165 (either by being compiled in or available as a module). This target
166 produces files called
172 Builds an installation memory stick image named
174 Not applicable on all platforms. Requires that the
176 (memory disk) device driver be present in the kernel
177 (either by being compiled in or available as a module).
181 with the exception that the installation distribution sets
184 Creates a directory named
186 containing the distribution files used in network installations
187 and suitable for upload to an FTP mirror.
190 Major subtargets called by targets above:
191 .Bl -tag -width ".Cm packagesystem"
193 Generates all the distribution archives (e.g. base, kernel, ports, doc)
194 applicable on this platform.
196 Builds a bootable installation system containing all the distribution files
199 target, and suitable for imaging by the
205 Builds the release documentation.
206 This includes the release notes,
207 hardware guide, and installation instructions. Other documentation (e.g.
208 the Handbook) is built during the
215 .Bl -tag -width ".Va TARGET_ARCH"
217 Location of a directory containing the src tree. By default, the directory
218 above the one containing the makefile
221 Location of a directory containing the ports tree. By default,
223 If it is unset or cannot be found, ports will not be included in the release.
225 Location of a directory containing the doc tree. By default,
227 If it is unset or cannot be found, most documentation will not be included in
232 If defined, the Ports Collection will be omitted from the release.
234 If set, do not include system source code in the release.
236 If defined, the XML-based documentation from the
238 Documentation Project will not be built.
241 distribution will still be created with the minimal documentation set
245 The target hardware platform.
246 This is analogous to the
249 This is necessary to cross-build some target architectures.
250 For example, cross-building for PC98 machines requires
251 .Va TARGET_ARCH Ns = Ns Li i386
253 .Va TARGET Ns = Ns Li pc98 .
256 defaults to the current hardware platform.
258 The target machine processor architecture.
259 This is analogous to the
262 Set this to cross-build for a different architecture.
265 defaults to the current machine architecture, unless
267 is also set, in which case it defaults to the appropriate
268 value for that platform.
269 Typically, one only needs to set
274 .It Pa /usr/doc/Makefile
275 .It Pa /usr/doc/share/mk/doc.project.mk
276 .It Pa /usr/ports/Mk/bsd.port.mk
277 .It Pa /usr/ports/Mk/bsd.sites.mk
278 .It Pa /usr/share/examples/etc/make.conf
279 .It Pa /usr/src/Makefile
280 .It Pa /usr/src/Makefile.inc1
281 .It Pa /usr/src/release/Makefile
282 .It Pa /usr/src/release/generate-release.sh
285 The following sequence of commands can be used to build a
286 .Dq "-CURRENT snapshot":
287 .Bd -literal -offset indent
289 svn co svn://svn.freebsd.org/base/head src
291 make buildworld buildkernel
294 make install DESTDIR=/var/freebsd-snapshot
297 After running these commands, all produced distribution files (tarballs
298 for FTP, CD-ROM images, etc.) are available in the
299 .Pa /var/freebsd-snapshot
302 The following sequence of commands can be used to build a
303 .Dq "-CURRENT snapshot"
304 in a clean environment, including ports and documentation:
305 .Bd -literal -offset indent
307 export SVNROOT=svn://svn.freebsd.org/base
308 sh generate-release.sh head /local3/release
311 After running these commands, all prepared release files are available in the
312 .Pa /local3/release/R
318 .Xr svn 1 Pq Pa ports/devel/subversion ,
328 .%T "FreeBSD Release Engineering"
329 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/
332 .%T "FreeBSD Release Engineering of Third Party Packages"
333 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng-packages/
336 .%T "FreeBSD Developers' Handbook"
337 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/
342 used a manual checklist, compiled by
344 to produce a release.
345 Apart from being incomplete, the list put a lot of specific demands on
346 available file systems and was quite torturous to execute.
350 release engineering effort, significant
351 effort was spent getting
352 .Pa src/release/Makefile
353 into a shape where it could at least automate most of the tediousness
354 of building a release in a sterile environment.
359 .Pa src/release/Makefile
360 was overhauled and the wrapper script
361 .Pa src/release/generate-release.sh
362 introduced to support the introduction of a new installer.
364 At near 1000 revisions spread over multiple branches, the
367 .Pa src/release/Makefile
368 contains a vivid historical record of some
369 of the hardships release engineers go through.
371 .Pa src/release/Makefile
372 was originally written by
377 .An Poul-Henning Kamp .
378 This manual page was written by
379 .An Murray Stokely Aq murray@FreeBSD.org .