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.
144 host used to check out the various trees.
146 .Pa svn://svn.FreeeBSD.org .
166 The target machine type for cross-building a release.
168 The target machine architecture for cross-building a release.
170 For the supported list of
174 combinations, consult the output of
179 The target kernel configuration to use.
184 entries may be specified.
188 to use for the release build.
191 to prevent polluting the release with local system changes.
195 to use for the release build.
198 to prevent polluting the release with local system changes.
200 Additional flags to pass to
203 Additional flags to pass to
208 Defaults to setting the number of
212 to the number of CPUs available on a SMP-capable system.
214 Additional flags to pass to
219 Defaults to setting the number of
223 to half the number of CPUs available on a SMP-capable system.
225 Set to a non-empty value to skip the
232 distribution package from being created.
234 Set to a non-empty value to skip the
238 Set to a non-empty value to skip the
245 distribution package from being created.
246 Setting this also sets
251 .Pq Pa src/release/Makefile
253 Most developers will only be concerned with the
258 .\" XXX: Some sort of introduction to this list? All the others have one.
259 .Bl -tag -width ".Cm packagesystem"
261 Meta-target to build all release media and distributions applicable to this
264 Copy all produced release media to
267 Builds installation CD-ROM images.
270 (memory disk) device driver be present in the kernel
271 (either by being compiled in or available as a module).
272 This target produces files called
278 Builds installation DVD-ROM images.
281 (memory disk) device driver be present in the kernel
282 (either by being compiled in or available as a module).
283 This target produces the
287 Builds an installation memory stick image named
289 Not applicable on all platforms.
293 device driver be present in the kernel
294 .Pq either by being compiled in or available as a module .
296 Creates a directory named
298 containing the distribution files used in network installations
299 and suitable for upload to an FTP mirror.
302 Major subtargets called by targets above:
303 .Bl -tag -width ".Cm packagesystem"
305 Generates all the distribution archives
306 .Pq base, kernel, ports, doc
307 applicable on this platform.
309 Builds a bootable installation system containing all the distribution files
312 target, and suitable for imaging by the
319 Builds the release documentation.
320 This includes the release notes,
321 hardware guide, and installation instructions.
322 Other documentation, such as the Handbook,
330 .Bl -tag -width ".Ev TARGET_ARCH"
332 Optional base name for generated media images
333 .Pq e.g., FreeBSD-9.0-RC2-amd64 .
334 Defaults to the output of
335 .Ic `uname -s`-`uname -r`-`uname -p`
338 Location of a directory containing the src tree.
339 By default, the directory
340 above the one containing the makefile
343 Location of a directory containing the ports tree.
346 If it is unset or cannot be found, ports will not be included in the release.
348 Location of a directory containing the doc tree.
351 If it is unset or cannot be found, most documentation will not be included in
356 If defined, the Ports Collection will be omitted from the release.
358 If set, do not include system source code in the release.
360 If defined, the XML-based documentation from the
362 Documentation Project will not be built.
365 distribution will still be created with the minimal documentation set
369 The target hardware platform.
370 This is analogous to the
373 This is necessary to cross-build some target architectures.
374 For example, cross-building for PC98 machines requires
375 .Ev TARGET_ARCH Ns = Ns Li i386
377 .Ev TARGET Ns = Ns Li pc98 .
380 defaults to the current hardware platform.
382 The target machine processor architecture.
383 This is analogous to the
386 Set this to cross-build for a different architecture.
389 defaults to the current machine architecture, unless
391 is also set, in which case it defaults to the appropriate
392 value for that platform.
393 Typically, one only needs to set
397 .Bl -tag -compact -width Pa
398 .It Pa /usr/doc/Makefile
399 .It Pa /usr/doc/share/mk/doc.project.mk
400 .It Pa /usr/ports/Mk/bsd.port.mk
401 .It Pa /usr/ports/Mk/bsd.sites.mk
402 .It Pa /usr/share/examples/etc/make.conf
403 .It Pa /usr/src/Makefile
404 .It Pa /usr/src/Makefile.inc1
405 .It Pa /usr/src/release/Makefile
406 .It Pa /usr/src/release/release.sh
407 .It Pa /usr/src/release/release.conf.sample
410 The following sequence of commands can be used to build a
411 .Dq "-CURRENT snapshot":
412 .Bd -literal -offset indent
414 svn co svn://svn.freebsd.org/base/head src
416 make buildworld buildkernel
419 make install DESTDIR=/var/freebsd-snapshot
422 After running these commands, all produced distribution files (tarballs
423 for FTP, CD-ROM images, etc.) are available in the
424 .Pa /var/freebsd-snapshot
427 The following sequence of commands can be used to build a
428 .Dq "-CURRENT snapshot"
429 in a clean environment, including ports and documentation:
430 .Bd -literal -offset indent
435 Optionally, a configuration file can be used customize the release build,
436 such as the subversion revision to use, the branch of the subversion tree for
441 .Bd -literal -offset indent
443 sh release.sh -c $HOME/release.conf
446 After running these commands, all prepared release files are available in the
449 The target directory can be changed by specifying the
457 .Xr svn 1 Pq Pa ports/devel/subversion ,
467 .%T "FreeBSD Release Engineering"
468 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/
471 .%T "FreeBSD Release Engineering of Third Party Packages"
472 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng-packages/
475 .%T "FreeBSD Developers' Handbook"
476 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/
481 used a manual checklist, compiled by
483 to produce a release.
484 Apart from being incomplete, the list put a lot of specific demands on
485 available file systems and was quite torturous to execute.
489 release engineering effort, significant
490 effort was spent getting
491 .Pa src/release/Makefile
492 into a shape where it could at least automate most of the tediousness
493 of building a release in a sterile environment.
498 .Pa src/release/Makefile
499 was overhauled and the wrapper script
500 .Pa src/release/generate-release.sh
501 introduced to support the introduction of a new installer.
506 .Pa src/release/release.sh
507 was introduced to support per-build configuration files.
508 .Pa src/release/release.sh
509 is heavily based on the
510 .Pa src/release/generate-release.sh
513 At near 1000 revisions spread over multiple branches, the
516 .Pa src/release/Makefile
517 contains a vivid historical record of some
518 of the hardships release engineers go through.
520 .Pa src/release/Makefile
521 was originally written by
526 .An Poul-Henning Kamp .
528 This manual page was originally written by
529 .An Murray Stokely Aq murray@FreeBSD.org .
532 .An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
534 .Fa generate-release.sh
539 It was later updated by
540 .An Glen Barber Aq gjb@FreeBSD.org