Thanks to the Autobuild-System, you can easily build a new Release from the NetBSD CVS sources. I'll show you, how to build a release, sets and a bootable installation CD-ROM for i386, step by step. For this, you need a running NetBSD System and a working Internet Connection.
#Contents
[[!toc]]
#Disk space requirements
You will need a minimum of 5.1 GB of disk space to build a whole release. You need currently 1.2 GB for the sources src and 579 MB for xsrc. About 2.4 GB will reside in the obj directory after building a release.
#Short way for impatient

#Obtaining the sources via CVS
Create the directories src, xsrc and objdir as root in /usr
# cd /usr
# mkdir src xsrc objdir
We also create the following directories in /usr: tooldir, releasedir, destdir. We do this, because we want the src directory to stay clean and not polluted by the build process. We will pass options flags to build.sh, to separate the directories.
# mkdir tooldir releasedir destdir
Change the owner of the directories:
# chown john src/ xsrc/ objdir/ tooldir/ releasedir/ destdir/
The following steps from now on can be done as a non-root user:
# logout
$
Set the environment variable CVSROOT: (For that, please choose a [Mirror](http://www.de.netbsd.org/mirrors/#anoncvs) close to you)
csh users:
% setenv CVSROOT anoncvs@anoncvs.se.NetBSD.org:/cvsroot
Bourne compatible shell (sh, ksh, zsh, bash...) Users:
$ export CVSROOT=anoncvs@anoncvs.se.NetBSD.org:/cvsroot
Set the environment variable CVS_RSH:
$ export CVS_RSH=ssh
The src directory currently needs about 1500 MB disk space and the xsrc directory currently needs about 579 MB of disk space.
Now check out the current sources, like this:
$ cvs checkout -PA src
If you want to use Xorg from pkgsrc you can skip the next step.
$ cvs checkout -PA xsrc
Or you can check out a certain release, by passing -r
$ cvs checkout -rnetbsd-5-0 -PA src
$ cvs checkout -rnetbsd-5-0 -PA xsrc
#Building the toolchain
The toolchain contains the software that is needed to build NetBSD, like the GNU C-Compiler and other tools. This way, it is ensured that NetBSD can build itself on almost any Unix™. You can omit this step, if you want to build a new release, because a release always includes building the tools.

#Building the release
Variables to pass to build.sh can be found in [src/share/mk/bsd.README](http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/src/share/mk/bsd.README?rev=1.165.2.3;content-type=text%2Fx-cvsweb-markup).
In this example
We are building as a user (non-root): -U
We are building the X11R6 sources (Xservers, this is XFree 4.5.0 not Xorg): -x
We are using separate directories: -T, -D, -R, -O, -X
We are removing contents of tooldir and destdir before building: -r
We are using -j2 because we have a multiprocessor system
We are building a release: release
$ ./build.sh -T ../tooldir -D ../destdir -R ../releasedir -O ../objdir -X ../xsrc -U -x -j2 -r release
This process takes at least two hours on an high-end server, and usually much longer, depending on your computing power.

If you are using Xorg via pkgsrc (recommended), you can skip building the Xserver (-x).
If you have a multiprocessor system, add -j. The number of jobs should be equal to your number of CPU's/cores. Don't use -j on single CPU systems.
If your build fails, because of insufficient space on install flopies, you might find this useful: [[How to build install sets, when you can't build install floppies]]
#Creating an ISO-Image
to create an iso-image just add the option iso-image
$ ./build.sh -U -x -r release iso-image
the resulting iso image will reside in relasedir/platform/installation/cdrom/
This option will create an iso-image only on platforms that are bootable from such a media.
#Burning the image
If you have a CD/DVD-Writer, you can burn the iso image to a CD. For this task you need to install cdrecord, which is part of sysutils/cdrtools.
# cdrecord -dev=/dev/rcd0d -data -pad -v NetBSD-install.iso
#Building current faster
In case you don't need whole a release or a bootable iso image, the fastest way to build current is to build new tools, distribution, followed by sets and a kernel (custom or GENERIC). I recommend to build a custom kernel that fits your needs.
$ ./build.sh -U tools distribution sets kernel=MYKERNEL
Additional Information
* [cvs(1)](http://netbsd.gw.com/cgi-bin/man-cgi?cvs+1+NetBSD-current) manpage
* [Tracking NetBSD-current](http://www.netbsd.org/docs/current/)