xref: /freebsd/share/man/man7/release.7 (revision 6ccbb635d7b228a34d0eb8bb16b767a233c21166)
1.\" Copyright (c) 2002 Murray Stokely <murray@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
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.
12.\"
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
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd March 12, 2002
28.Dt RELEASE 7
29.Os
30.Sh NAME
31.Nm release
32.Nd "release building infrastructure"
33.Sh DESCRIPTION
34.Fx
35provides a complete build environment suitable for users to make
36full releases of the
37.Fx
38operating system.
39All of the tools necessary to build a release are available from the
40CVS repository in
41.Pa src/release .
42A complete release can actually be built with only a single command,
43including the creation of ISO images suitable for burning to CD-ROM,
44installation floppies, and an FTP install directory.
45This command is aptly named
46.Dq Li "make release" .
47.Pp
48Before attempting to build a release, the user is expected to be
49familiar with the contents of
50.Xr build 7 ,
51and should have experience upgrading systems from source with
52.Dq Li "make world" .
53The release build process requires that
54.Pa /usr/obj
55be populated with the output of
56.Dq Li "make buildworld" .
57This is necessary so that the object files for a complete system can
58be installed into a clean
59.Xr chroot 8
60environment.
61The release procedure also requires that the
62.Xr md 4
63(memory disk) device driver be present in the kernel
64(either by being compiled in or available as a module).
65.Pp
66This document does not cover source code management, quality
67assurance, or other aspects of the release engineering process.
68.Sh TARGETS
69The release makefile
70.Pq Pa src/release/Makefile
71is fairly abstruse.
72Most developers will only be concerned with the
73.Cm release
74target.
75.\" XXX: Some sort of introduction to this list?  All the others have one.
76.Bl -tag -width ".Cm rerelease"
77.It Cm release
78Uses
79.Dq Li "make installworld"
80to install a clean system into a
81.Xr chroot 8
82environment on the file system.
83Checks out the specified version of the source code and then rebuilds
84the entire system in the clean environment with
85.Dq Li "make world" .
86The detailed steps that follow are then executed to package up the
87different distributions, build the installation floppy disks, build
88release documentation, and so on.
89.Pp
90This target must be built as root with the
91.Va kern.securelevel
92sysctl set to \-1 (the default).
93.It Cm rerelease
94Assumes that the output of a release build has been manually modified,
95and performs the minimal number of steps to rebuild the release using
96the intermediate output of the previous
97.Dq Li "make release" .
98.It Cm floppies
99Generate a new set of boot and fixit floppies.
100This will call the
101.Cm release.5 ,
102.Cm release.9 ,
103.Cm floppies.1 ,
104.Cm floppies.2 ,
105and
106.Cm floppies.3
107targets to re-generate the floppy images of a previous
108.Dq Li "make release" .
109This is most often used to build custom boot floppies.
110.El
111.Pp
112Targets called by
113.Dq Li "make release" :
114.Bl -tag -width ".Cm fetch-distfiles"
115.It Cm release.1
116Cleans out the
117.Pa ${CHROOTDIR}/R
118directory and uses
119.Xr mtree 8
120to build the directory hierarchy for the system.
121.It Cm release.2
122Installs the system into the distribution directories.
123.It Cm release.3
124Builds and installs into the
125.Dq base
126distribution non-crypto versions of some tools.
127.It Cm release.4
128Makes and installs the
129.Pa GENERIC
130kernel as well as any other kernels listed in
131.Va KERNELS .
132.It Cm release.5
133Uses
134.Xr crunchgen 1
135to build
136.Dq crunched
137binaries to live on the installation floppies.
138.It Cm release.6
139Builds synthetic distributions, and cleans up the previously built
140distribution trees.
141.It Cm release.7
142Creates tarballs of the assembled distribution trees.
143.It Cm release.8
144Makes source distributions.
145.It Cm release.9
146Creates the MFS root file systems.
147.It Cm floppies.1
148Creates the boot and kernel floppies.
149.It Cm floppies.2
150Creates the fixit floppy.
151.It Cm floppies.3
152Finalizes the
153.Pa ${CHROORDIR}/R/ftp/stage/floppies
154staging directory.
155.It Cm ftp.1
156Sets up a suitable area for FTP installations in
157.Pa ${CHROOTDIR}/R/ftp .
158.It Cm cdrom.1
159Sets up a suitable area to build CD-ROM images in
160.Pa ${CHROOTDIR}/R/cdrom .
161.It Cm iso.1
162Builds two ISO images (installation and
163.Dq live
164file system) from the CD-ROM release area
165(disabled by default, see
166.Va MAKE_ISOS
167below).
168.It Cm fetch-distfiles
169Fetches distfiles needed during the release build that are not already in
170.Va RELEASEDISTFILES .
171.It Cm doc.1
172Builds all of the necessary tools to turn the
173.Fx
174Documentation Project source documents (SGML, XML) into HTML
175and text documents that will accompany the release.
176Also, builds and installs the actual user documentation.
177This includes the Handbook, FAQ, articles, and so on.
178.It Cm doc.2
179Builds the release documentation.
180This includes the release notes,
181hardware guide, and installation instructions.
182.El
183.Sh ENVIRONMENT
184Variables that must be specified:
185.Bl -tag -width ".Va BUILDNAME"
186.It Va BUILDNAME
187The name of the release to be built.
188This is used to set the
189.Va RELEASE
190value in
191.Pa sys/conf/newvers.sh ,
192which affects the output of
193.Xr uname 1 .
194.It Va CHROOTDIR
195The directory to be used as the
196.Xr chroot 8
197environment for the entire release build.
198.\" XXX: I recommend against hardcoding specific numbers like "2.3" here;
199.\" XXX: perhaps it should be replaced with something to the effect of
200.\" XXX: "we don't know how much space you'll need, but make sure you have
201.\" XXX: at least 3 GB to be safe" (I know i'm still hardcoding a number,
202.\" XXX: but at least it looks less like a decree and more like an estimate.
203This file system should have at least 2.3 gigabytes of free space on the
204i386 architecture.
205.It Va CVSROOT
206The location of the
207.Fx
208CVS repository.
209This path name is in reference to the real system root,
210.Em not
211the root of the
212.Xr chroot 8
213directory tree.
214.El
215.Pp
216Optional variables:
217.Bl -tag -width ".Va NO_PREFETCHDISTFILES"
218.It Va CVSCMDARGS
219Additional arguments for
220.Xr cvs 1
221.Ic checkout
222and
223.Ic update
224commands.
225For example, setting this variable to
226.Dq Li "-D '01/01/2002 00:00:00 GMT'"
227for
228.Dq Li "make release"
229or
230.Dq Li "make rerelease"
231will ask
232.Xr cvs 1
233to check out or update sources as of 00:00:00 GMT, January 1 2002, respectively.
234.It Va DOC_LANG
235The list of languages and encodings the SGML-based documentation
236should be built for.
237If not set, the documentation is built for all available languages.
238.It Va DOCRELEASETAG
239The CVS tag to use when checking out the documentation tree.
240Usually,
241the head of the documentation tree is used by default.
242If
243.Va RELEASETAG
244specifies a release tag,
245then the associated release version is used as the default instead.
246.It Va EXTLOCALDIR
247The directory that will be copied to
248.Pa ${CHROOTDIR}/usr/local .
249.It Va KERNEL_FLAGS
250The contents of this variable are passed to
251.Xr make 1
252when building kernels during the release build.
253For example, setting this variable to
254.Dq Li "-j 4"
255will instruct
256.Xr make 1
257to execute up to four processes at a time.
258.It Va KERNELS
259Specifies a list of additional kernel configurations to compile and
260install into the
261.Dq base
262distribution.
263Each kernel is installed into
264.Pa /boot/<config>
265so that it can be booted from the loader via
266.Dq Li "boot <config>" .
267.It Va LOCAL_PATCHES
268Patch files against
269.Pa /usr/src
270that will be applied in the
271.Xr chroot 8
272environment before the release build begins.
273.It Va PATCH_FLAGS
274Arguments for the
275.Xr patch 1
276command used to apply
277.Va LOCAL_PATCHES
278patch file.
279.It Va LOCAL_SCRIPT
280A script that will be run in the
281.Xr chroot 8
282environment immediately after any local patches are applied.
283.It Va MAKE_ISOS
284If defined, bootable ISO CD-ROM images will be created from the
285contents of the CD-ROM stage directory.
286.It Va NOCDROM
287If defined, the CD-ROM stage directories will not be created.
288.It Va NODOC
289If defined, the SGML-based documentation from the
290.Fx
291Documentation Project will not be built.
292However, the
293.Dq doc
294distribution will still be created with the minimal documentation set
295provided in
296.Pa src/share/doc .
297.It Va NO_FLOPPIES
298If defined, no boot and fixit floppy disk images will be created (i386-only).
299.It Va NOPORTS
300If defined, the Ports Collection will be omitted from the release.
301.It Va NOPORTREADMES
302If defined, readme files will not be created for each individual port
303in the Ports Collection.
304The default behavior is for
305.Dq Li "make release"
306to run
307.Dq Li "make readmes"
308from
309.Pa ${CHROOTDIR}/usr/ports ,
310which can be a very time consuming operation.
311.It Va PORTSRELEASETAG
312The CVS tag to use when checking out the ports tree.
313Usually,
314the head of the ports tree is used by default.
315If
316.Va RELEASETAG
317specifies a release tag,
318then the associated release version is used as the default instead.
319.It Va NO_PREFETCHDISTFILES
320If this variable is defined,
321then distfiles needed during the release build will not be downloaded prior to
322entering the
323.Xr chroot 8
324environment.
325Note that if
326.Va NO_PREFETCHDISTFILES
327is not set,
328the fetching is done after any distfiles are obtained via
329.Va RELEASEDISTFILES .
330.It Va RELEASEDISTFILES
331The directory where the distribution files for ports required by the
332release build can be found.
333This may save a significant amount of time over downloading the
334distfiles through a slow link.
335.It Va RELEASENOUPDATE
336If this variable is defined for
337.Dq Li "make rerelease" ,
338the source code will not be updated with
339.Dq Li "cvs update" .
340.It Va RELEASETAG
341The CVS tag corresponding to the release that is to be built.
342If undefined, the release will be built from the
343.Dv HEAD
344of the CVS tree
345(a
346.Dq "-CURRENT snapshot" ) .
347.It Va TARGET_ARCH
348The target machine processor architecture.
349This is analogous to the
350.Dq Nm uname Fl p
351output.
352Set this to cross-build for a different architecture.
353.It Va TARGET
354The target hardware platform.
355This is analogous to the
356.Dq Nm uname Fl m
357output.
358This is necessary to cross-build some target architectures.
359For example, cross-building for PC98 machines requires
360.Va TARGET_ARCH Ns = Ns Li i386
361and
362.Va TARGET Ns = Ns Li pc98 .
363.It Va WORLDDIR
364The directory where
365.Dq Li "make buildworld"
366was run; defaults to
367.Pa ${.CURDIR}/..
368which usually points to
369.Pa /usr/src .
370.It Va WORLD_FLAGS
371The contents of this variable are passed to
372.Xr make 1
373when building world during the release build.
374For example, setting this variable to
375.Dq Li "-j 4"
376will instruct
377.Xr make 1
378to execute up to four processes at a time.
379.El
380.Sh FILES
381.Bl -tag -compact
382.It Pa /etc/make.conf
383.It Pa /usr/doc/Makefile
384.It Pa /usr/doc/share/mk/doc.project.mk
385.It Pa /usr/ports/Mk/bsd.port.mk
386.It Pa /usr/ports/Mk/bsd.sites.mk
387.It Pa /usr/share/examples/etc/make.conf
388.It Pa /usr/src/Makefile
389.It Pa /usr/src/Makefile.inc1
390.It Pa /usr/src/release/Makefile
391.It Pa /usr/src/release/${arch}/drivers.conf
392.It Pa /usr/src/release/${arch}/boot_crunch.conf
393.It Pa /usr/src/release/${arch}/fixit_crunch.conf
394.El
395.Sh EXAMPLES
396The following sequence of commands was used to build the
397.Fx 4.5
398release:
399.Bd -literal -offset indent
400cd /usr
401cvs co -rRELENG_4_5_0_RELEASE src
402cd src
403make buildworld
404cd release
405make release CHROOTDIR=/local3/release BUILDNAME=4.5-RELEASE \\
406  CVSROOT=/host/cvs/usr/home/ncvs RELEASETAG=RELENG_4_5_0_RELEASE
407.Ed
408.Pp
409After running these commands, a complete system suitable for FTP or
410CD-ROM distribution is available in the
411.Pa /local3/release/R
412directory.
413.Pp
414The following sequence of commands can be used to build a
415.Dq "-CURRENT snapshot"
416of a
417locally modified source tree:
418.Bd -literal -offset indent
419cd /usr/src
420cvs diff -u > /path/to/local.patch
421make buildworld
422cd release
423make release CHROOTDIR=/local3/release BUILDNAME=5.0-CURRENT \\
424  CVSROOT=/host/cvs/usr/home/ncvs LOCAL_PATCHES=/path/to/local.patch
425.Ed
426.Sh SEE ALSO
427.Xr cc 1 ,
428.Xr crunchgen 1 ,
429.Xr cvs 1 ,
430.Xr install 1 ,
431.Xr make 1 ,
432.Xr patch 1 ,
433.Xr uname 1 ,
434.Xr md 4 ,
435.Xr drivers.conf 5 ,
436.Xr make.conf 5 ,
437.Xr build 7 ,
438.Xr ports 7 ,
439.Xr chroot 8 ,
440.Xr mtree 8 ,
441.Xr sysctl 8
442.Rs
443.%T "FreeBSD Release Engineering"
444.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/
445.Re
446.Rs
447.%T "FreeBSD Release Engineering of Third Party Packages"
448.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng-packages/
449.Re
450.Rs
451.%T "FreeBSD Developers' Handbook"
452.%O http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/
453.Re
454.Sh HISTORY
455.Fx
4561.x
457used a manual checklist, compiled by
458.An Rod Grimes ,
459to produce a release.
460Apart from being incomplete, the list put a lot of specific demands on
461available file systems and was quite torturous to execute.
462.Pp
463As part of the
464.Fx 2.0
465release engineering effort, significant
466effort was spent getting
467.Pa src/release/Makefile
468into a shape where it could at least automate most of the tediousness
469of building a release in a sterile environment.
470.Pp
471With its almost 1000 revisions spread over multiple branches, the
472.Xr cvs 1
473log of
474.Pa src/release/Makefile
475contains a vivid historical record of some
476of the hardships release engineers go through.
477.Sh AUTHORS
478.Pa src/release/Makefile
479was originally written by
480.An -nosplit
481.An Rod Grimes ,
482.An Jordan Hubbard ,
483and
484.An Poul-Henning Kamp .
485This manual page was written by
486.An Murray Stokely Aq murray@FreeBSD.org .
487.Sh BUGS
488Infrastructure changes are occassionally made to the
489.Fx
490documentation set in such a way that release builds on security
491branches can fail.
492To work around this, release builds can be made to checkout the
493documentation from the last fully supported release of
494.Fx .
495For example:
496.Pp
497.Dl "make release RELEASETAG=RELENG_4_5 DOCRELEASETAG=RELEASE_4_5_0 ..."
498