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