Chapter 3. The Source Tree

Table of Contents

3.1 Retrieving the Sources
3.1.1 Obtaining Sources via Tarball
3.2 Tour of Your ON Workspace
3.2.1 Organization
3.2.2 Object Directories
3.2.3 Makefile Layout
3.2.4 Makefile Operation
3.2.5 ISA Dependencies
3.2.6 Understanding Kernel Module Installation
3.2.7 Finding Sources for a Module
3.2.8 Source Files not Included
3.3 Using Your Workspace
3.3.1 Getting Ready to Work
3.3.2 Editing Files
3.3.3 Modifying the ON Build System
3.4 Keeping Your Workspace in Sync

This chapter discusses obtaining, managing, and modifying OpenSolaris. As with most of this document, we focus on the ON consolidation. However, most other consolidations require very similar steps. Always consult your consolidation's release notes for the latest information. Contributions to this reference for non-ON consolidations are always welcome.

3.1 Retrieving the Sources

Most consolidations are available as tarballs; within the next few months, a few will also begin to offer read-only Subversion repositories. Regardless of the method used to obtain the source, the contents are the same.

3.1.1 Obtaining Sources via Tarball

You can obtain the tarballs for all released consolidations at http://opensolaris.org/os/downloads/. If you plan to build the source, and wish to produce complete installation sets, you may also need the closed binaries (if the consolidation of interest is not entirely open), which you can obtain from the same location. Be sure to obtain the appropriate binaries for your platform. Once you have done so, create your workspace as follows:

$ mkdir /path/to/workspace
$ cd /path/to/workspace
$ bzip2 -dc /path/to/tarball/on-src-<ver>.tar.bz2 | tar xf -
$ bzip2 -dc /path/to/tarball/on-bins-<ver>.{x86,sparc}.tar.gz | tar xf -