Build OpenSolaris Step by Step
By colin on Oct 04, 2007
The following are steps to build OpenSolaris. My co-workers and I figured out these steps according to the documents on OpenSolaris.org. These steps are easy to follow and tested on Solaris Express build 63.
1. Download & Install Build Environment:
1.1 Download Compiler (Sun Studio is the preferred compiler, and it is free)
Install the compiler according to the instructions at the download site.
The result should have the compilers installed in /opt/SUNWspro.
1.2 Download ON build tools package (SUNWonbld.PLATFORM.tar.bz2)
# cd $TEMP
# bunzip2 -c SUNWonbld.i386.tar.bz2 |tar xvf -
# yes y | pkgadd -d ./ SUNWonbld
1.3 Fetch ON (OS & Network) source code
# hg clone ssh://firstname.lastname@example.org/hg/onnv/onnv-gate
Source tar balls have been deprecated in favour of the onnv project's Mercurial repository. Please see the onnv project page for more information on how to checkout/clone the repository to download the source.
1.4 Download Encumbered binaries tarball (on-closed-bins[-nd].PLATFORM.tar.bz2) for debug and non-debug version
Need to extract from tarball and put root_i386 and root_i386-nd under $CODEMGR_WS/closed,
If the source code is in "/export/testws/usr/src", then the binaries will be in "/export/testws/closed/root_PLATFORM"
(i.e., closed/root_i386 or closed/root_sparc). For non-debug version, it is closed/root_i386-nd or closed/root_sparc-nd.
2. Environment setup
2.2 Copy and set environment file
# cp usr/src/tools/env/opensolaris.sh /export/testws/
modify opensolaris.sh for your $CODEMGR_WS, $STAFF, $MAILTO settings
- change GATE to none or the name of the top-level directory (e.g., "testws").
- change CODEMGR_WS to the your workspace (e.g., "/export/testws").
- change STAFFER to your login (e.g., root).
- (optional) change MAILTO to you email address.
- (optional) customize VERSION. This is the string that "uname -v"
3.1 Nightly Build (build the whole ON source)
# nightly ./opensolaris.sh & tail -f log/nightly.log
- -n: no bringover (default)
- -i: incremental build (no clobber)
- -D: do a build with DEBUG on
- -F: do not do a non-DEBUG build
3.2 Single module Build
- make a single module:
bldenv opensolaris.sh; cd usr/src/uts/intel/i915; make
- A Chinese Guide of OpenSolaris build (it's for snv_23 only, but is quite workable with current builds)ON/Nevada project page
- Glossary(consolidation, gate, ON, Nevada, putback, workspace, WOS, etc.)
- ON source