Thursday Oct 04, 2007

Build OpenSolaris Step by Step


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)
http://dlc.sun.com/osol/on/downloads/current/
and install:

# 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://anon@hg.opensolaris.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

http://dlc.sun.com/osol/on/downloads/current/

Need to extract from tarball and put root_i386 and root_i386-nd under $CODEMGR_WS/closed,

For example:

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.1 PATH

# PATH=/opt/SUNWspro/bin:/opt/onbld/bin:/opt/onbld/bin/i386:$PATH

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"
    will print.

3. Build

3.1 Nightly Build (build the whole ON source)

# nightly ./opensolaris.sh & tail -f log/nightly.log
nightly options:

  • -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
[ Reference links]

  • ON source
  • SUNWonbld
  • on-closed-bins

About

Colin Zou is a software engineer enjoying improving operating systems. Besides sitting at a computer all day like a dull boy, he also likes hiking and the activities on the beach.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today