- Update the wrapper script to 'release.sh', as used by the FreeBSD

Release Engineering Team as of 9.2-RELEASE.

- Document that a cross-build release is possible by setting the
  TARGET and TARGET_ARCH variables.

- Include an example of using release.sh with and without the
  optional configuration file.

- Document the supported release.sh configuration file variables.

- Update the 'cdrom' target output file to disc1.iso.

- Update the 'memstick' target output file to memstick.img.

- Add attributions for the last major updates to this manual page.

- Fix some mdoc(7) style nits:
  - Sentences should begin on a new line
  - Use .Pq to enclose full lines in parenthesis
This commit is contained in:
Glen Barber 2013-08-11 18:57:27 +00:00
parent a790431ec0
commit ebe2785690

View File

@ -24,7 +24,7 @@
.\" .\"
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd February 3, 2013 .Dd August 11, 2013
.Dt RELEASE 7 .Dt RELEASE 7
.Os .Os
.Sh NAME .Sh NAME
@ -50,8 +50,9 @@ For some users, it may be desirable to provide an absolutely clean
build environment, with no local modifications to the source tree or to build environment, with no local modifications to the source tree or to
.Xr make.conf 5 , .Xr make.conf 5 ,
and with clean checkouts of specific versions of the doc, src, and ports and with clean checkouts of specific versions of the doc, src, and ports
trees. For this purpose, a script trees.
.Pq Pa src/release/generate-release.sh For this purpose, a script
.Pq Pa src/release/release.sh
is provided to automate these checkouts and then execute is provided to automate these checkouts and then execute
.Dq Li "make release" .Dq Li "make release"
in a clean in a clean
@ -70,86 +71,194 @@ and
.Dq Li "make buildkernel" . .Dq Li "make buildkernel" .
This is necessary to provide the object files for the release or, when This is necessary to provide the object files for the release or, when
using using
.Pa generate-release.sh , .Pa release.sh ,
so that the object files for a complete system can be installed into a clean so that the object files for a complete system can be installed into a clean
.Xr chroot 8 .Xr chroot 8
environment. In this second case, the built world must be capable of running environment.
on the build system (i.e. it must be for the same architecture and be .Pp
compatible with the installed kernel). If the target release build is for a different architecture or machine type,
the
.Va TARGET
and
.Va TARGET_ARCH
variables must be used.
See the supported
.Fa release.conf
variables for more information.
.Pp
The release procedure on some architectures may also require that the The release procedure on some architectures may also require that the
.Xr md 4 .Xr md 4
(memory disk) device driver be present in the kernel (memory disk) device driver be present in the kernel
(either by being compiled in or available as a module). .Pq either by being compiled in or available as a module .
.Pp .Pp
This document does not cover source code management, quality This document does not cover source code management, quality
assurance, or other aspects of the release engineering process. assurance, or other aspects of the release engineering process.
.Sh CLEAN RELEASE GENERATION .Sh CLEAN RELEASE GENERATION
Official releases of FreeBSD are produced in a totally clean environment to Official releases of
.Fx
are produced in a totally clean environment to
ensure consistency between the versions of the src, ports, and doc trees ensure consistency between the versions of the src, ports, and doc trees
and to avoid contamination from the host system (e.g. local patches, changes and to avoid contamination from the host system
.Po such as local patches, changes
to to
.Xr make.conf 5 , .Xr make.conf 5 ,
etc.). This is accomplished using the wrapper script etc.
.Pa src/release/generate-release.sh . .Pc .
This is accomplished using the wrapper script
.Pa src/release/release.sh .
.Pp .Pp
.Ic generate-release.sh .Ic release.sh
svn-branch scratch-dir .Op Fl c Ar release.conf
.Pp .Pp
.Ic generate-release.sh .Ic release.sh
calls checks out the
.Li src/ ,
.Li ports/ ,
and
.Li doc/
trees to
.Va CHROOTDIR ,
then calls
.Dq Li "make buildworld"
and
.Dq Li "make installworld" .Dq Li "make installworld"
to generate a to generate a
.Xr chroot 8 .Xr chroot 8
environment in environment.
.Ar scratch-dir . Next,
It then checks out the src tree specified by
.Ar svn-branch
using
.Xr svn 1 .
Once the various source trees have been obtained, it executes
.Dq Li "make release" .Dq Li "make release"
within the is run within the
.Xr chroot 8 .Xr chroot 8
environment and places the result in environment and places the result in
.Pa $scratch-dir/R . .Pa $CHROOTDIR/R .
Note that because this uses a chroot, it cannot be used to cross-build
.Fx
release media.
.Pp .Pp
Optional environment variables: The optional
.Bl -tag -width ".Cm WORLD_FLAGS" .Fa release.conf
.It Ev WORLD_FLAGS configuration file supports the following variables:
This environment variable can be set to pass flags (e.g. -j) to .Bl -tag -width Ev
.It Va CHROOTDIR
The directory within which the release will be built.
.It Va SVNROOT
The
.Xr svn 1
host used to check out the various trees.
Defaults to
.Pa svn://svn.FreeeBSD.org .
.It Va SRCBRANCH
The
.Li src/
branch to use.
Defaults to
.Va head/ .
.It Va DOCBRANCH
The
.Li doc/
branch to use.
Defaults to
.Va head/ .
.It Va PORTBRANCH
The
.Li ports/
branch to use.
Defaults to
.Va head/ .
.It Va SRCREVISION
The revision of the
.Li src/
tree to use.
Defaults to the current top of tree revision.
.It Va DOCREVISION
The revision of the
.Li doc/
tree to use.
Defaults to the current top of tree revision.
.It Va PORTREVISION
The revision of the
.Li ports/
tree to use.
Defaults to the current top of tree revision.
.It Va TARGET
The target machine type for the release.
Defaults to the current machine type.
.It Va TARGET_ARCH
The target machine architecture for the release.
Defaults to the value of
.Va TARGET .
.Pp
For the supported list of
.Va TARGET
and
.Va TARGET_ARCH
combinations, consult the output of
.Dq make targets
as documented in
.Xr build 7 .
.It Va KERNEL
The target kernel configuration to use.
Defaults to
.Va GENERIC .
Multiple
.Va KERNEL
entries may be specified.
.It Va MAKE_CONF
The
.Xr make.conf 5
to use for the release build.
Defaults to
.Fa /dev/null
to prevent polluting the release with local system changes.
.It Va SRC_CONF
The
.Xr src.conf 5
to use for the release build.
Defaults to
.Fa /dev/null
to prevent polluting the release with local system changes.
.It Va MAKE_FLAGS
Additional flags to pass to
.Xr make 1 .
.It Va WORLD_FLAGS
Additional flags to pass to
.Xr make 1 .Xr make 1
when invoked to build a world by the script. during the
.It Ev KERNEL_FLAGS .Dq buildworld
This environment variable can be set to pass flags (e.g. -j) to phase.
Defaults to setting the number of
.Xr make 1 .Xr make 1
when invoked to build a kernel by the script. jobs
.It Ev SVNROOTBASE .Pq Ar -j
The base part of URL of the FreeBSD SVN repositories. to the number of CPUs available on the system.
Defaults to .It Va KERNEL_FLAGS
.Pa svn://svn.freebsd.org . Additional flags to pass to
.It Ev SVNROOTSRC .Xr make 1
The URL of the FreeBSD SVN source repository. during the
Defaults to .Dq buildkernel
.Pa ${SVNROOTBASE}/base . phase.
.It Ev SVNROOTDOC Defaults to setting the number of
The URL of the FreeBSD SVN doc repository. .Xr make 1
Defaults to jobs
.Pa ${SVNROOTBASE}/doc . .Pq Ar -j
.It Ev SVNROOTPORTS to half the number of CPUs available on the system.
The URL of the FreeBSD SVN ports repository. .It Va NODOC
Defaults to Set to a non-empty value to skip the
.Pa ${SVNROOTBASE}/ports . .Li doc/
.It Ev BRANCHDOC tree checkout.
The branch name of the FreeBSD SVN doc repository. When set,
Defaults to .Va NODOC
.Pa head . will prevent the
.It Ev BRANCHPORTS .Fa doc.txz
The branch name of the FreeBSD SVN ports repository. distribution package from being created.
Defaults to .It Va NOPORTS
.Pa head . Set to a non-empty value to skip the
.Li ports/
tree checkout.
When set,
.Va NOPORTS
will prevent the
.Fa ports.txz
distribution package from being created.
Setting this also sets
.Va NODOC .
.El .El
.Sh MAKEFILE TARGETS .Sh MAKEFILE TARGETS
The release makefile The release makefile
@ -175,18 +284,19 @@ This may require the
(memory disk) device driver be present in the kernel (memory disk) device driver be present in the kernel
(either by being compiled in or available as a module). (either by being compiled in or available as a module).
This target produces files called This target produces files called
.Pa release.iso .Pa disc1.iso
and and
.Pa bootonly.iso .Pa bootonly.iso
as its output. as its output.
.It Cm memstick .It Cm memstick
Builds an installation memory stick image named Builds an installation memory stick image named
.Pa memstick . .Pa memstick.img .
Not applicable on all platforms. Not applicable on all platforms.
Requires that the Requires that the
.Xr md 4 .Xr md 4
(memory disk) device driver be present in the kernel .Pq memory disk
(either by being compiled in or available as a module). device driver be present in the kernel
.Pq either by being compiled in or available as a module .
.It Cm ftp .It Cm ftp
Creates a directory named Creates a directory named
.Pa ftp .Pa ftp
@ -197,7 +307,8 @@ and suitable for upload to an FTP mirror.
Major subtargets called by targets above: Major subtargets called by targets above:
.Bl -tag -width ".Cm packagesystem" .Bl -tag -width ".Cm packagesystem"
.It Cm packagesystem .It Cm packagesystem
Generates all the distribution archives (e.g. base, kernel, ports, doc) Generates all the distribution archives
.Pq base, kernel, ports, doc
applicable on this platform. applicable on this platform.
.It Cm system .It Cm system
Builds a bootable installation system containing all the distribution files Builds a bootable installation system containing all the distribution files
@ -211,8 +322,9 @@ targets.
.It Cm reldoc .It Cm reldoc
Builds the release documentation. Builds the release documentation.
This includes the release notes, This includes the release notes,
hardware guide, and installation instructions. Other documentation (e.g. hardware guide, and installation instructions.
the Handbook) is built during the Other documentation, such as the Handbook,
is built during the
.Cm base.txz .Cm base.txz
target invoked by target invoked by
.Cm packagesystem . .Cm packagesystem .
@ -221,20 +333,24 @@ target invoked by
Optional variables: Optional variables:
.Bl -tag -width ".Ev TARGET_ARCH" .Bl -tag -width ".Ev TARGET_ARCH"
.It Ev OSRELEASE .It Ev OSRELEASE
Optional base name for generated media images (e.g. FreeBSD-9.0-RC2-amd64). Optional base name for generated media images
.Pq e.g., FreeBSD-9.0-RC2-amd64 .
Defaults to the output of Defaults to the output of
.Ic `uname -s`-`uname -r`-`uname -p` .Ic `uname -s`-`uname -r`-`uname -p`
within the chroot. within the chroot.
.It Ev WORLDDIR .It Ev WORLDDIR
Location of a directory containing the src tree. By default, the directory Location of a directory containing the src tree.
By default, the directory
above the one containing the makefile above the one containing the makefile
.Pq Pa src . .Pq Pa src .
.It Ev PORTSDIR .It Ev PORTSDIR
Location of a directory containing the ports tree. By default, Location of a directory containing the ports tree.
By default,
.Pa /usr/ports . .Pa /usr/ports .
If it is unset or cannot be found, ports will not be included in the release. If it is unset or cannot be found, ports will not be included in the release.
.It Ev DOCDIR .It Ev DOCDIR
Location of a directory containing the doc tree. By default, Location of a directory containing the doc tree.
By default,
.Pa /usr/doc . .Pa /usr/doc .
If it is unset or cannot be found, most documentation will not be included in If it is unset or cannot be found, most documentation will not be included in
the release; see the release; see
@ -291,7 +407,8 @@ Typically, one only needs to set
.It Pa /usr/src/Makefile .It Pa /usr/src/Makefile
.It Pa /usr/src/Makefile.inc1 .It Pa /usr/src/Makefile.inc1
.It Pa /usr/src/release/Makefile .It Pa /usr/src/release/Makefile
.It Pa /usr/src/release/generate-release.sh .It Pa /usr/src/release/release.sh
.It Pa /usr/src/release/release.conf.sample
.El .El
.Sh EXAMPLES .Sh EXAMPLES
The following sequence of commands can be used to build a The following sequence of commands can be used to build a
@ -316,12 +433,27 @@ The following sequence of commands can be used to build a
in a clean environment, including ports and documentation: in a clean environment, including ports and documentation:
.Bd -literal -offset indent .Bd -literal -offset indent
cd /usr/src/release cd /usr/src/release
sh generate-release.sh head /local3/release sh release.sh
.Ed
.Pp
Optionally, a configuration file can be used customize the release build,
such as the subversion revision to use, the branch of the subversion tree for
.Li src/ ,
.Li ports/ ,
and
.Li doc/ .
.Bd -literal -offset indent
cd /usr/src/release
sh release.sh -c $HOME/release.conf
.Ed .Ed
.Pp .Pp
After running these commands, all prepared release files are available in the After running these commands, all prepared release files are available in the
.Pa /local3/release/R .Pa /scratch
directory. directory.
The target directory can be changed by specifying the
.Va CHROOTDIR
variable in
.Li release.conf .
.Sh SEE ALSO .Sh SEE ALSO
.Xr cc 1 , .Xr cc 1 ,
.Xr install 1 , .Xr install 1 ,
@ -372,6 +504,16 @@ was overhauled and the wrapper script
.Pa src/release/generate-release.sh .Pa src/release/generate-release.sh
introduced to support the introduction of a new installer. introduced to support the introduction of a new installer.
.Pp .Pp
For the
.Fx 9.2
release,
.Pa src/release/release.sh
was introduced to support per-build configuration files.
.Pa src/release/release.sh
is heavily based on the
.Pa src/release/generate-release.sh
script.
.Pp
At near 1000 revisions spread over multiple branches, the At near 1000 revisions spread over multiple branches, the
.Xr svn 1 .Xr svn 1
log of log of
@ -386,5 +528,22 @@ was originally written by
.An Jordan Hubbard , .An Jordan Hubbard ,
and and
.An Poul-Henning Kamp . .An Poul-Henning Kamp .
This manual page was written by .Pp
This manual page was originally written by
.An Murray Stokely Aq murray@FreeBSD.org . .An Murray Stokely Aq murray@FreeBSD.org .
.Pp
It was updated by
.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org
to include the
.Fa generate-release.sh
script used for the
.Fx 9.0
release cycle.
.Pp
It was later updated by
.An Glen Barber Aq gjb@FreeBSD.org
to include the
.Fa release.sh
script used for the
.Fx 9.2
release cycle.