]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - share/man/man7/release.7
MFC r262810, r262862, r264105, r264107:
[FreeBSD/stable/9.git] / share / man / man7 / release.7
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 5, 2014
28 .Dt RELEASE 7
29 .Os
30 .Sh NAME
31 .Nm release
32 .Nd "release building infrastructure"
33 .Sh DESCRIPTION
34 .Fx
35 provides a complete build environment suitable for users to make
36 full releases of the
37 .Fx
38 operating system.
39 All of the tools necessary to build a release are available from the
40 .Fx
41 source code repository in
42 .Pa src/release .
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" .
48 .Pp
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
51 .Xr make.conf 5 ,
52 and with clean checkouts of specific versions of the doc, src, and ports
53 trees.
54 For this purpose, a script
55 .Pq Pa src/release/release.sh
56 is provided to automate these checkouts and then execute
57 .Dq Li "make release"
58 in a clean
59 .Xr chroot 8 .
60 .Pp
61 Before attempting to build a release, the user is expected to be
62 familiar with the contents of
63 .Xr build 7 ,
64 and should have experience upgrading systems from source.
65 .Pp
66 The release build process requires that
67 .Pa /usr/obj
68 be populated with the output of
69 .Dq Li "make buildworld"
70 and
71 .Dq Li "make buildkernel" .
72 This is necessary to provide the object files for the release or, when
73 using
74 .Pa release.sh ,
75 so that the object files for a complete system can be installed into a clean
76 .Xr chroot 8
77 environment.
78 .Pp
79 If the target release build is for a different architecture or machine type,
80 the
81 .Va TARGET
82 and
83 .Va TARGET_ARCH
84 variables must be used.
85 See the supported
86 .Fa release.conf
87 variables for more information.
88 .Pp
89 The release procedure on some architectures may also require that the
90 .Xr md 4
91 (memory disk) device driver be present in the kernel
92 .Pq either by being compiled in or available as a module .
93 .Pp
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
97 Official releases of
98 .Fx
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
103 to
104 .Xr make.conf 5 ,
105 etc.
106 .Pc .
107 This is accomplished using the wrapper script
108 .Pa src/release/release.sh .
109 .Pp
110 .Ic release.sh
111 .Op Fl c Ar release.conf
112 .Pp
113 .Ic release.sh
114 checks out the
115 .Li src/ ,
116 .Li ports/ ,
117 and
118 .Li doc/
119 trees to
120 .Va CHROOTDIR ,
121 then calls
122 .Dq Li "make buildworld"
123 and
124 .Dq Li "make installworld"
125 to generate a
126 .Xr chroot 8
127 environment.
128 Next,
129 .Dq Li "make release"
130 is run within the
131 .Xr chroot 8
132 environment and places the result in
133 .Pa $CHROOTDIR/R .
134 .Pp
135 The optional
136 .Fa release.conf
137 configuration file supports the following variables:
138 .Bl -tag -width Ev
139 .It Va CHROOTDIR
140 The directory within which the release will be built.
141 .It Va CHROOT_MAKEENV
142 Additional
143 .Xr make 1
144 arguments to pass through, which directly affect the
145 tuning of the build chroot.
146 .It Va SVNROOT
147 The
148 .Xr svn 1
149 host used to check out the various trees.
150 Defaults to
151 .Pa svn://svn.FreeeBSD.org .
152 .It Va SRCBRANCH
153 The
154 .Li src/
155 branch to use.
156 Defaults to
157 .Va head/@rHEAD .
158 .It Va DOCBRANCH
159 The
160 .Li doc/
161 branch to use.
162 Defaults to
163 .Va head/@rHEAD .
164 .It Va PORTBRANCH
165 The
166 .Li ports/
167 branch to use.
168 Defaults to
169 .Va head/@rHEAD .
170 .It Va TARGET
171 The target machine type for cross-building a release.
172 .It Va TARGET_ARCH
173 The target machine architecture for cross-building a release.
174 .Pp
175 For the supported list of
176 .Va TARGET
177 and
178 .Va TARGET_ARCH
179 combinations, consult the output of
180 .Dq make targets
181 as documented in
182 .Xr build 7 .
183 .It Va KERNEL
184 The target kernel configuration to use.
185 Defaults to
186 .Va GENERIC .
187 Multiple
188 .Va KERNEL
189 entries may be specified.
190 .It Va MAKE_CONF
191 The
192 .Xr make.conf 5
193 to use for the release build.
194 Defaults to
195 .Fa /dev/null
196 to prevent polluting the release with local system changes.
197 .It Va SRC_CONF
198 The
199 .Xr src.conf 5
200 to use for the release build.
201 Defaults to
202 .Fa /dev/null
203 to prevent polluting the release with local system changes.
204 .It Va MAKE_FLAGS
205 Additional flags to pass to
206 .Xr make 1 .
207 .It Va WORLD_FLAGS
208 Additional flags to pass to
209 .Xr make 1
210 during the
211 .Dq buildworld
212 phase.
213 Defaults to setting the number of
214 .Xr make 1
215 jobs
216 .Pq Ar -j
217 to the number of CPUs available on a SMP-capable system.
218 .It Va KERNEL_FLAGS
219 Additional flags to pass to
220 .Xr make 1
221 during the
222 .Dq buildkernel
223 phase.
224 Defaults to setting the number of
225 .Xr make 1
226 jobs
227 .Pq Ar -j
228 to half the number of CPUs available on a SMP-capable system.
229 .It Va NODOC
230 Set to a non-empty value to skip the
231 .Li doc/
232 tree checkout.
233 When set,
234 .Va NODOC
235 will prevent the
236 .Fa doc.txz
237 distribution package from being created.
238 .It Va NOPORTS
239 Set to a non-empty value to skip the
240 .Li ports/
241 tree checkout.
242 When set,
243 .Va NOPORTS
244 will prevent the
245 .Fa ports.txz
246 distribution package from being created.
247 Setting this also sets
248 .Va NODOC .
249 .It Va WITH_DVD
250 Set to a non-empty value to include the
251 .Cm dvdrom
252 target.
253 .It Va VCSCMD
254 The command run to obtain the source trees.
255 Defaults to
256 .Qq Cm svn checkout .
257 .It Va CHROOTBUILD_SKIP
258 If defined, the
259 .Li buildworld ,
260 .Li installworld ,
261 and
262 .Li distribution
263 stages of the
264 .Xr chroot 8
265 build environment setup are skipped.
266 This is intended solely for cases where the
267 .Xr chroot 8
268 userland are provided by alternate means.
269 .El
270 .Sh EMBEDDED BUILDS
271 The following
272 .Fa release.conf
273 variables are relevant only to release builds for embedded systems:
274 .Bl -tag -width Ev
275 .It Va EMBEDDEDBUILD
276 Set to a non-null value to enable functionality for embedded device
277 release builds.
278 .Pq This option is considered highly experimental.
279 .Pp
280 When set,
281 .Va WITH_DVD
282 is unset, and
283 .Va NODOC
284 is defined.
285 Additionally,
286 .Va XDEV
287 and
288 .Va XDEV_ARCH
289 must also be defined.
290 When the build environment is created,
291 .Fa release.sh
292 runs a separate build script located in an architecture-specific
293 directory in
294 .Pa src/release/${XDEV}/ .
295 .It Va EMBEDDEDPORTS
296 Set to the list of any ports that are required for the target device
297 in the format of
298 .Fa category/port .
299 The
300 .Fa devel/subversion
301 port is built by default.
302 .It Va CROCHETSRC
303 Set to the source URL for the Crochet build tool.
304 .It Va CROCHETBRANCH
305 Set to the subversion branch from
306 .Va ${CROCHETSRC}
307 to use.
308 Defaults to
309 .Pa trunk .
310 .It Va UBOOTSRC
311 Set to the source URL of u-boot, if required.
312 .It Va UBOOTBRANCH
313 Set to the subversion branch from
314 .Va ${UBOOTSRC}
315 to use.
316 Defaults to
317 .Pa trunk .
318 .It Va UBOOTDIR
319 Set to the target directory within
320 .Va ${CHROOTDIR}
321 to check out
322 .Va ${UBOOTSRC}/${UBOOTBRANCH} .
323 .El
324 .Sh MAKEFILE TARGETS
325 The release makefile
326 .Pq Pa src/release/Makefile
327 is fairly abstruse.
328 Most developers will only be concerned with the
329 .Cm release
330 and
331 .Cm install
332 targets.
333 .\" XXX: Some sort of introduction to this list?  All the others have one.
334 .Bl -tag -width ".Cm packagesystem"
335 .It Cm release
336 Meta-target to build all release media and distributions applicable to this
337 platform.
338 .It Cm install
339 Copy all produced release media to
340 .Pa ${DESTDIR} .
341 .It Cm cdrom
342 Builds installation CD-ROM images. On some systems, this may require that
343 .Xr mkisofs 8
344 be installed
345 .Pq Pa sysutils/cdrtools
346 and possibly that the
347 .Xr md 4
348 (memory disk) device driver be present in the kernel
349 (either by being compiled in or available as a module). This target
350 produces files called
351 .Pa disc1.iso
352 and
353 .Pa bootonly.iso
354 as its output.
355 .It Cm dvdrom
356 Builds installation DVD-ROM images.
357 This may require the
358 .Xr md 4
359 (memory disk) device driver be present in the kernel
360 (either by being compiled in or available as a module).
361 This target produces the
362 .Pa dvd1.iso
363 file as its output.
364 .It Cm memstick
365 Builds an installation memory stick image named
366 .Pa memstick.img .
367 Not applicable on all platforms. Requires that the
368 .Xr md 4
369 .Pq memory disk
370 device driver be present in the kernel
371 .Pq either by being compiled in or available as a module .
372 .It Cm mini-memstick
373 Similar to
374 .Cm memstick ,
375 with the exception that the installation distribution sets
376 are not included.
377 .It Cm ftp
378 Creates a directory named
379 .Pa ftp
380 containing the distribution files used in network installations
381 and suitable for upload to an FTP mirror.
382 .El
383 .Pp
384 Major subtargets called by targets above:
385 .Bl -tag -width ".Cm packagesystem"
386 .It Cm packagesystem
387 Generates all the distribution archives
388 .Pq base, kernel, ports, doc
389 applicable on this platform.
390 .It Cm system
391 Builds a bootable installation system containing all the distribution files
392 packaged by the
393 .Cm packagesystem
394 target, and suitable for imaging by the
395 .Cm cdrom ,
396 .Cm dvdrom
397 and
398 .Cm memstick
399 targets.
400 .It Cm reldoc
401 Builds the release documentation.
402 This includes the release notes,
403 hardware guide, and installation instructions.
404 Other documentation, such as the Handbook,
405 is built during the
406 .Cm base.txz
407 target invoked by
408 .Cm packagesystem.
409 .El
410 .Sh ENVIRONMENT
411 Optional variables:
412 .Bl -tag -width ".Ev TARGET_ARCH"
413 .It Ev OSRELEASE
414 Optional base name for generated media images
415 .Pq e.g., FreeBSD-9.0-RC2-amd64 .
416 Defaults to the output of
417 .Ic `uname -s`-`uname -r`-`uname -p`
418 within the chroot.
419 .It Ev WORLDDIR
420 Location of a directory containing the src tree.
421 By default, the directory
422 above the one containing the makefile
423 .Pq Pa src .
424 .It Va PORTSDIR
425 Location of a directory containing the ports tree.
426 By default,
427 .Pa /usr/ports .
428 If it is unset or cannot be found, ports will not be included in the release.
429 .It Va DOCDIR
430 Location of a directory containing the doc tree.
431 By default,
432 .Pa /usr/doc .
433 If it is unset or cannot be found, most documentation will not be included in
434 the release; see
435 .Ev NODOC
436 below.
437 .It Va NOPORTS
438 If defined, the Ports Collection will be omitted from the release.
439 .It Va NOSRC
440 If set, do not include system source code in the release.
441 .It Va NODOC
442 If defined, the XML-based documentation from the
443 .Fx
444 Documentation Project will not be built.
445 However, the
446 .Dq doc
447 distribution will still be created with the minimal documentation set
448 provided in
449 .Pa src/share/doc .
450 .It Va TARGET
451 The target hardware platform.
452 This is analogous to the
453 .Dq Nm uname Fl m
454 output.
455 This is necessary to cross-build some target architectures.
456 For example, cross-building for PC98 machines requires
457 .Va TARGET_ARCH Ns = Ns Li i386
458 and
459 .Va TARGET Ns = Ns Li pc98 .
460 If not set,
461 .Va TARGET
462 defaults to the current hardware platform.
463 .It Va TARGET_ARCH
464 The target machine processor architecture.
465 This is analogous to the
466 .Dq Nm uname Fl p
467 output.
468 Set this to cross-build for a different architecture.
469 If not set,
470 .Va TARGET_ARCH
471 defaults to the current machine architecture, unless
472 .Va TARGET
473 is also set, in which case it defaults to the appropriate
474 value for that platform.
475 Typically, one only needs to set
476 .Va TARGET .
477 .El
478 .Sh FILES
479 .Bl -tag -compact
480 .It Pa /usr/doc/Makefile
481 .It Pa /usr/doc/share/mk/doc.project.mk
482 .It Pa /usr/ports/Mk/bsd.port.mk
483 .It Pa /usr/ports/Mk/bsd.sites.mk
484 .It Pa /usr/share/examples/etc/make.conf
485 .It Pa /usr/src/Makefile
486 .It Pa /usr/src/Makefile.inc1
487 .It Pa /usr/src/release/Makefile
488 .It Pa /usr/src/release/release.sh
489 .It Pa /usr/src/release/release.conf.sample
490 .El
491 .Sh EXAMPLES
492 The following sequence of commands can be used to build a
493 .Dq "-CURRENT snapshot":
494 .Bd -literal -offset indent
495 cd /usr
496 svn co svn://svn.freebsd.org/base/head src
497 cd src
498 make buildworld buildkernel
499 cd release
500 make release
501 make install DESTDIR=/var/freebsd-snapshot
502 .Ed
503 .Pp
504 After running these commands, all produced distribution files (tarballs
505 for FTP, CD-ROM images, etc.) are available in the
506 .Pa /var/freebsd-snapshot
507 directory.
508 .Pp
509 The following sequence of commands can be used to build a
510 .Dq "-CURRENT snapshot"
511 in a clean environment, including ports and documentation:
512 .Bd -literal -offset indent
513 cd /usr/src/release
514 sh release.sh
515 .Ed
516 .Pp
517 Optionally, a configuration file can be used customize the release build,
518 such as the subversion revision to use, the branch of the subversion tree for
519 .Li src/ ,
520 .Li ports/ ,
521 and
522 .Li doc/ .
523 .Bd -literal -offset indent
524 cd /usr/src/release
525 sh release.sh -c $HOME/release.conf
526 .Ed
527 .Pp
528 After running these commands, all prepared release files are available in the
529 .Pa /scratch
530 directory.
531 The target directory can be changed by specifying the
532 .Va CHROOTDIR
533 variable in
534 .Li release.conf .
535 .Sh SEE ALSO
536 .Xr cc 1 ,
537 .Xr install 1 ,
538 .Xr make 1 ,
539 .Xr svn 1 Pq Pa ports/devel/subversion ,
540 .Xr uname 1 ,
541 .Xr md 4 ,
542 .Xr make.conf 5 ,
543 .Xr build 7 ,
544 .Xr ports 7 ,
545 .Xr chroot 8 ,
546 .Xr mtree 8 ,
547 .Xr sysctl 8
548 .Rs
549 .%T "FreeBSD Release Engineering"
550 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/
551 .Re
552 .Rs
553 .%T "FreeBSD Release Engineering of Third Party Packages"
554 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng-packages/
555 .Re
556 .Rs
557 .%T "FreeBSD Developers' Handbook"
558 .%U http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/developers-handbook/
559 .Re
560 .Sh HISTORY
561 .Fx
562 1.x
563 used a manual checklist, compiled by
564 .An Rod Grimes ,
565 to produce a release.
566 Apart from being incomplete, the list put a lot of specific demands on
567 available file systems and was quite torturous to execute.
568 .Pp
569 As part of the
570 .Fx 2.0
571 release engineering effort, significant
572 effort was spent getting
573 .Pa src/release/Makefile
574 into a shape where it could at least automate most of the tediousness
575 of building a release in a sterile environment.
576 .Pp
577 For the
578 .Fx 9.0
579 release,
580 .Pa src/release/Makefile
581 was overhauled and the wrapper script
582 .Pa src/release/generate-release.sh
583 introduced to support the introduction of a new installer.
584 .Pp
585 For the
586 .Fx 9.2
587 release,
588 .Pa src/release/release.sh
589 was introduced to support per-build configuration files.
590 .Pa src/release/release.sh
591 is heavily based on the
592 .Pa src/release/generate-release.sh
593 script.
594 .Pp
595 At near 1000 revisions spread over multiple branches, the
596 .Xr svn 1
597 log of
598 .Pa src/release/Makefile
599 contains a vivid historical record of some
600 of the hardships release engineers go through.
601 .Sh AUTHORS
602 .Pa src/release/Makefile
603 was originally written by
604 .An -nosplit
605 .An Rod Grimes ,
606 .An Jordan Hubbard ,
607 and
608 .An Poul-Henning Kamp .
609 .Pp
610 This manual page was originally written by
611 .An Murray Stokely Aq murray@FreeBSD.org .
612 .Pp
613 It was updated by
614 .An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
615 to include the
616 .Fa generate-release.sh
617 script used for the
618 .Fx 9.0
619 release cycle.
620 .Pp
621 It was later updated by
622 .An Glen Barber Aq gjb@FreeBSD.org
623 to include the
624 .Fa release.sh
625 script used for the
626 .Fx 9.2
627 release cycle.