version 1.62, 2007/04/13 19:43:38 |
version 1.67.4.1, 2008/03/24 07:14:28 |
Line 3 BUILDING(8) NetBSD System Ma |
|
Line 3 BUILDING(8) NetBSD System Ma |
|
NAME |
NAME |
BUILDING -- Procedure for building NetBSD from source code. |
BUILDING -- Procedure for building NetBSD from source code. |
|
|
STATUS |
|
This document is a work-in-progress. As such, the information described |
|
here may not match the reality of the build system as of this writing. |
|
Once this document is completely in sync with reality, this paragraph |
|
will be removed. |
|
|
|
Discrepancies between this documentation and the current reality of |
|
implementation are noted specially, as with the note below: |
|
|
|
Note: This document applies only to platforms which use the new toolchain |
|
as indicated by the default setting of TOOLCHAIN_MISSING in <bsd.own.mk>. |
|
Platforms which have not yet been switched to the new toolchain should |
|
continue building traditionally, using the notes specified in the file |
|
UPDATING. |
|
|
|
REQUIREMENTS |
REQUIREMENTS |
NetBSD is designed to be buildable on most POSIX-compliant host systems. |
NetBSD is designed to be buildable on most POSIX-compliant host systems. |
The basic build procedure is the same whether compiling natively (on the |
The basic build procedure is the same whether compiling natively (on the |
|
|
Additional make(1) targets are usable specifically from the top source |
Additional make(1) targets are usable specifically from the top source |
level to facilitate building the entire NetBSD source tree. |
level to facilitate building the entire NetBSD source tree. |
|
|
build Build the entire NetBSD system. This orders portions of |
build Build the entire NetBSD system (except the kernel). This |
the source tree such that prerequisites will be built in |
orders portions of the source tree such that prerequisites |
the proper order. |
will be built in the proper order. |
|
|
distribution Do a ``make build'', and then install a full distribution |
distribution Do a ``make build'', and then install a full distribution |
into DESTDIR, including files in DESTDIR/dev, DESTDIR/etc, |
(which does not include a kernel) into DESTDIR, including |
DESTDIR/root and DESTDIR/var. |
files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and |
|
DESTDIR/var. |
|
|
buildworld As per ``make distribution'', except that it ensures that |
buildworld As per ``make distribution'', except that it ensures that |
DESTDIR is not the root directory. |
DESTDIR is not the root directory. |
|
|
to fix them). |
to fix them). |
|
|
sets Create distribution sets from DESTDIR into |
sets Create distribution sets from DESTDIR into |
RELEASEDIR/MACHINE/binary/sets. Should be run after ``make |
RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run |
distribution'' (as ``make build'' does not install all of |
after ``make distribution'' (as ``make build'' does not |
the required files). |
install all of the required files). |
|
|
sourcesets Create source sets of the source tree into |
sourcesets Create source sets of the source tree into |
RELEASEDIR/source/sets. |
RELEASEDIR/source/sets. |
|
|
syspkgs Create syspkgs from DESTDIR into |
syspkgs Create syspkgs from DESTDIR into |
RELEASEDIR/MACHINE/binary/syspkgs. Should be run after |
RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run |
``make distribution'' (as ``make build'' does not install |
after ``make distribution'' (as ``make build'' does not |
all of the required files). |
install all of the required files). |
|
|
release Do a ``make distribution'', build kernels, distribution |
release Do a ``make distribution'', build kernels, distribution |
media, and install sets (this as per ``make sets''), and |
media, and install sets (this as per ``make sets''), and |
|
|
populated by ``make release'' or equivalent. |
populated by ``make release'' or equivalent. |
|
|
Note that other, smaller, CD-ROM images may be created in |
Note that other, smaller, CD-ROM images may be created in |
the RELEASEDIR/MACHINE/installation/cdrom directory by |
the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- |
``make release''. These smaller images usually contain the |
tory by ``make release''. These smaller images usually |
same tools as the larger images in RELEASEDIR/iso, but do |
contain the same tools as the larger images in |
not contain additional content such as the distribution |
RELEASEDIR/iso, but do not contain additional content such |
sets. |
as the distribution sets. |
|
|
|
Note that the mac68k port still uses an older method of |
|
creating CD-ROM images. This requires the mkisofs(1) util- |
|
ity, which is not part of NetBSD, but which can be |
|
installed from pkgsrc/sysutils/cdrtools. |
|
|
|
iso-image-source |
|
Create a NetBSD installation CD-ROM image in the |
|
RELEASEDIR/iso directory. The CD-ROM file system will have |
|
a layout as described in release(7). It will have top |
|
level directories for the machine type and source. |
|
|
|
For most machine types, the CD-ROM will be bootable, and |
|
will automatically run the sysinst(8) menu-based installa- |
|
tion program, which can be used to install or upgrade a |
|
NetBSD system. Bootable CD-ROMs also contain tools that |
|
may be useful in repairing a damaged NetBSD installation. |
|
|
|
Before ``make iso-image-source'' is attempted, RELEASEDIR |
|
must be populated by ``make sourcesets release'' or equiva- |
|
lent. |
|
|
|
Note that other, smaller, CD-ROM images may be created in |
|
the RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom direc- |
|
tory by ``make release''. These smaller images usually |
|
contain the same tools as the larger images in |
|
RELEASEDIR/iso, but do not contain additional content such |
|
as the distribution sets. |
|
|
Note that the mac68k port still uses an older method of |
Note that the mac68k port still uses an older method of |
creating CD-ROM images. This requires the mkisofs(1) util- |
creating CD-ROM images. This requires the mkisofs(1) util- |
|
|
|
|
releasekernel=kconf |
releasekernel=kconf |
Install a gzip(1)ed copy of the kernel built by |
Install a gzip(1)ed copy of the kernel built by |
kernel=kconf into RELEASEDIR/MACHINE/binary/kernel, usually |
kernel=kconf into |
as netbsd-kconf.gz, although the ``netbsd'' prefix is |
RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as |
determined from the ``config'' directives in kconf. |
netbsd-kconf.gz, although the ``netbsd'' prefix is deter- |
|
mined from the ``config'' directives in kconf. |
|
|
sets Perform ``make sets''. |
sets Perform ``make sets''. |
|
|
|
|
|
|
iso-image Perform ``make iso-image''. |
iso-image Perform ``make iso-image''. |
|
|
|
iso-image-source |
|
Perform ``make iso-image-source''. |
|
|
The following command line options alter the behaviour of the build.sh |
The following command line options alter the behaviour of the build.sh |
operations described above: |
operations described above: |
|
|
|
|
|
|
-B buildid |
-B buildid |
Set the value of BUILDID to buildid. This will also append the |
Set the value of BUILDID to buildid. This will also append the |
build idenfitier to the name of the ``make'' wrapper script so |
build identifier to the name of the ``make'' wrapper script so |
that the resulting name is of the form |
that the resulting name is of the form |
``nbmake-MACHINE-BUILDID''. |
``nbmake-MACHINE-BUILDID''. |
|
|
|
-C cdextras |
|
Set the value of CDEXTRA to cdextras which is a space-separated |
|
list of files or directories which will be added in order to |
|
the CD-ROM image when used in conjunction with ``iso-image'' or |
|
``iso-image-source''. Files will be added to the root of the |
|
CD-ROM image, whereas directories will be copied recursively. |
|
If relative paths are specified, they will be converted to |
|
absolute paths before being used. |
|
|
-D dest Set the value of DESTDIR to dest. If a relative path is speci- |
-D dest Set the value of DESTDIR to dest. If a relative path is speci- |
fied, it will be converted to an absolute path before being |
fied, it will be converted to an absolute path before being |
used. |
used. |
|
|
BUGS |
BUGS |
A few platforms are not yet using this build system. |
A few platforms are not yet using this build system. |
|
|
NetBSD April 13, 2007 NetBSD |
NetBSD March 18, 2008 NetBSD |