和所有的开源软件一样,你可以从网络上下载OpenSolaris的源代码,然后根据自己的需求对源代码进行修改,并使用编译工具将源代码编译成可以update系统的archive文件,然后对系统进行update。下面介绍如何下载源代码,建立编译环境,以及如何编译和更新系统。本文认为读者已经安装了最新的Neveda(onnv_b71)。具体安装过程,参见“Solaris系统安装指南”
下载源代码
可以从下面的website下载各种版本的OpenSolaris源代码。
http://dlc.sun.com/osol/on/downloads/
对于在x86平台上的编译,需要下载如下文件:
ON Source – OpenSolaris系统的源代码文件包
ON Specific Build Tools - 编译OpenSolaris系统的一些辅助工具
ON Binary-Only Components - OpenSolaris中尚未开源的部分,通过二进制文件的方式进行发布,这里包含debug或none-debug两种,可以根据实际情况选择其一。
OpenSolaris使用Mercurial(http://www.genunix.org/wiki/index.php/Mercurial)作为源代码的管理工具,所以可以通过hg命令,从OpenSolaris的源代码库里面获得最新的源代码。
首先,需要建立Socks Tunnel:
# cat ~/.ssh/config
Host *.opensolaris.org
ProxyCommand /usr/lib/ssh/ssh-socks5-proxy-connect -h proxy02.xx.xxxxx.com %h %p
Compression yes
从OpenSolaris的源代码库中获取源代码:
bash-3.00# hg clone ssh://anon@hg.opensolaris.org/hg/onnv/onnv-gate
bash-3.00# cd onnv-gate
bash-3.00# hg tip
changeset: 4896:ff3edba9ce8c
tag: tip
user: jw149990
date: Sun Aug 19 18:53:09 2007 -0700
summary: 6594084 fixing of 6591973 could cause system panic.
bash-3.00# hg tags
tip 4896:ff3edba9ce8c
onnv_71 4814:57cc010c0779