![]() |
|||||
· Home of “Community Software for Solaris” ( CSW ) |
|||||
|
|
How To Build NON-debug OpenSolaris - { updated for snv_20060925 }
Introduction and Special Thanks to Alan Hargreaves
For those of you that have been downloading and building the OpenSolaris code on a regular basis this will not be news. For the rest of you this is really cutting edge stuff. Firstly we need to take our hats off and bow down low before the great and masterful work done by Alan Hargreaves!
For a long time now, a long long time, Alan has been working like mad to get us a non-debug build process for OpenSolaris and based on things that have happened its really non-trivial. Please visit his blog and let him know that he is appreciated because his work has changed the way we will build OpenSolaris from here on and forwards. Step 1 - Go and get Solaris Express Community Release
You need a recent edition of Solaris Express Community Edition.
Go get Solaris Express Community Edition
Now here comes the tough part that I will need to write a full article on, you need to install Solaris Express. If you have worked with Linux or Solaris before then it will all be easy. If you have lived your life in the Windows world then you may need some help. Drop into the #opensolaris IRC channel and call out for HELP! and you will most likely get people that are only too happy to walk you all the way through the installation. Key points to consider while installing Solaris Express Community Edition :
Step 2 - Get the Sun Studio 11 Compilers and Tools
You can download a free edition of Sun ONE Studio 11 as a compressed tarball. There are other ways to get the compiler tools but if you want to make this really easy then just get the “Download install image” that you can find at the OpenSolaris site.
The tarball files should look like so :
Let me stop you right now and let you know that I am going to focus on the AMD Opteron architecture here. You will be better than fine if you are using UltraSparc also but DO NOT EXPECT a non-debug build yet. I will come back and edit this article ( or write a new one ) when we can build non-debug builds on the UltraSparc. For now, this is AMD Opteron focused. Step 3 - Install the Sun ONE Studio 11 Tools
With the compressed tarball all we need to do is extract it into /opt/SUNWspro .
n.b.: you need to be root for this
$ su -
Password:
Sun Microsystems Inc. SunOS 5.11 snv_47 October 2007
#
# cd /opt
# mkdir SUNWspro
# cd SUNWspro
# /usr/sfw/bin/gtar -zxf $HOME/sunstudio11-ii-20060829-sol-x86.tar.Z
# ls -lap
total 30
drwxr-xr-x 14 root sys 512 Jan 27 2006 ./
drwxr-xr-x 6 root sys 512 Sep 25 21:41 ../
drwxr-xr-x 8 root sys 1024 Jan 25 2006 READMEs/
drwxr-xr-x 3 root sys 1536 Jan 25 2006 bin/
drwxr-xr-x 5 root sys 512 Jan 25 2006 contrib/
drwxr-xr-x 4 root sys 512 Jan 25 2006 docs/
drwxr-xr-x 2 root sys 512 Jan 25 2006 examples/
drwxr-xr-x 2 root sys 512 Jan 25 2006 include/
drwxr-xr-x 3 root sys 512 Jan 25 2006 inventory/
drwxr-xr-x 9 root sys 1024 Jan 25 2006 lib/
drwxr-xr-x 15 root sys 512 Jan 25 2006 man/
drwxr-xr-x 19 root sys 512 Jan 25 2006 prod/
drwxr-xr-x 5 root sys 512 Jan 25 2006 sfw/
drwxr-xr-x 2 root sys 512 Jan 25 2006 system/
#
# exit
$
Okay, now let's give that a quick test drive :
# /opt/SUNWspro/bin/cc -V
cc: Sun C 5.8 Patch 121016-02 2006/03/31
usage: cc [ options] files. Use 'cc -flags' for details
# /opt/SUNWspro/bin/CC -V
CC: Sun C++ 5.8 Patch 121018-02 2006/04/26
Most important is this little bit of information. Sun Studio 11 no longer requires a Serial Number. To learn more about Sun Studio 11 please see : Release Notes: http://developers.sun.com/prodtech/cc/documentation/ss11/release_notes.html Step 4 - Get the OpenSolaris Source !
You would think that this would be step 1 but we don't need the sources until now. I recommended that you get the SUNWonbld kit, the on-closed-bins as well as the on-src files. I get all of this from
I personally drop all of this into my HOME directory thus :
bash-3.00$ date
Thu Sep 28 22:29:59 EDT 2006
bash-3.00$ pwd
/export/home/dclarke/snv-20060925
bash-3.00$ ls -lap
total 145148
drwxr-xr-x 2 dclarke csw 512 Sep 28 22:29 ./
drwxr-xr-x 23 dclarke csw 1024 Sep 28 21:44 ../
-rw-r--r-- 1 dclarke csw 769 Sep 28 21:44 MD5SUMS
-rw-r--r-- 1 dclarke csw 11765 Sep 28 21:45 README.opensolaris
-rw-r--r-- 1 dclarke csw 950046 Sep 28 21:45 SUNWonbld-20060925.i386.tar.bz2
-rw-r--r-- 1 dclarke csw 96461 Sep 28 21:44 on-changelog-20060925.html
-rw-r--r-- 1 dclarke csw 6901295 Sep 28 21:44 on-closed-bins-20060925.i386.tar.bz2
-rw-r--r-- 1 dclarke csw 6580624 Sep 28 21:44 on-closed-bins-nd-20060925.i386.tar.bz2
-rw-r--r-- 1 dclarke csw 59693611 Sep 28 21:45 on-src-20060925.tar.bz2
bash-3.00$
Now you have MD5 sigs for a reason so use them to verify your files. The MD5SUM for the non-debug bins is c494e53dc10173cd3290801943ba099c
$ bash
bash-3.00$ /bin/digest -a md5 -v SUNWonbld-20060925.i386.tar.bz2
md5 (SUNWonbld-20060925.i386.tar.bz2) = a4a7b7ecb8342d64ab3c8f832375cb3f
bash-3.00$ /bin/digest -a md5 -v on-closed-bins-20060925.i386.tar.bz2
md5 (on-closed-bins-20060925.i386.tar.bz2) = f02ec1cf1ccd347088196622910bc043
bash-3.00$ /bin/digest -a md5 -v on-src-20060925.tar.bz2
md5 (on-src-20060925.tar.bz2) = a26556764fdee6ba57fb8aa195e6ecd3
bash-3.00$ /bin/digest -a md5 -v on-closed-bins-nd-20060925.i386.tar.bz2
md5 (on-closed-bins-nd-20060925.i386.tar.bz2) = c494e53dc10173cd3290801943ba099c
bash-3.00$ cat MD5SUMS
59681a5bc72682151b3a8b6c0385392b README.opensolaris
a4a7b7ecb8342d64ab3c8f832375cb3f SUNWonbld-20060925.i386.tar.bz2
5b048fb1eca858e473d106d568613bc0 SUNWonbld-20060925.sparc.tar.bz2
6d7bf392465de7411621a93acb47d0e3 on-bfu-20060925.i386.tar.bz2
4658029fb760c4a4a7c4d233ae5565d7 on-bfu-20060925.sparc.tar.bz2
faa8154a91b35923ba4e48e920218a35 on-changelog-20060925.html
de78423bdf97ae6d873dee425c26509a on-changelog-20060925.sparse.txt
f02ec1cf1ccd347088196622910bc043 on-closed-bins-20060925.i386.tar.bz2
7db896ab39c670336d044d4a07d359a5 on-closed-bins-20060925.sparc.tar.bz2
64d047b0e3b119706d3f5a4ee5249125 on-hg-bundle-20060925.hg
aaa299a89798f6cd407ea9c361e2ac41 on-hg-bundle_20060918-20060925.hg
a26556764fdee6ba57fb8aa195e6ecd3 on-src-20060925.tar.bz2
bash-3.00$
Step 5 - Create a Workarea for the build
Opinions differ on this step but I will show you how I go about a build of OpenSolaris. I have done this more times than I can count and sometimes over and over in one day. The notion of having a separate filesystem ( or multiple filesystems ) for the build works very well. You may choose to skip this step if you wish but I will show you how I do things.
Remember back in step 1 I asked you to create a workarea slice? Well I set aside a big chunk of space within slice 6 of my boot disk and now I need to create the workarea filesystem thus :
# prtvtoc /dev/rdsk/c0t0d0s0
* /dev/rdsk/c0t0d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 63 sectors/track
* 255 tracks/cylinder
* 16065 sectors/cylinder
* 4426 cylinders
* 4424 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 50090670 20980890 71071559 /
1 3 01 16065 8401995 8418059
2 5 00 0 71071560 71071559
4 0 00 20643525 64260 20707784
5 0 00 20707785 8401995 29109779 /opt
6 0 00 8418060 12225465 20643524
7 8 00 29109780 20980890 50090669 /export/home
8 1 01 0 16065 16064
#
# newfs -s 12225465 -b 8192 -f 2048 -i 2048 -m 3 /dev/rdsk/c0t0d0s6
newfs: construct a new file system /dev/rdsk/c0t0d0s6: (y/n)? y
Warning: 1096 sector(s) in last cylinder unallocated
/dev/rdsk/c0t0d0s6: 12225464 sectors in 1990 cylinders of 48 tracks, 128 sectors
5969.5MB in 133 cyl groups (15 c/g, 45.00MB/g, 21696 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 92320, 184608, 276896, 369184, 461472, 553760, 646048, 738336, 830624,
11343264, 11435552, 11527840, 11620128, 11712416, 11796512, 11888800,
11981088, 12073376, 12165664
#
# mkdir /export/mybuild
# mount -F ufs -o logging /dev/dsk/c0t0d0s6 /export/mybuild
# chown dclarke:csw /export/mybuild
#
Step 6 - Unpack the source into the workarea
Simply cd to the workarea filesystem and then extract the source and the non-debug closed binaries. In the example below I also clean out previous work from snv-20060918.
bash-3.00$ cd /export/mybuild
bash-3.00$ ls -lap
total 82
drwxr-xr-x 8 dclarke csw 512 Sep 26 03:14 ./
drwxr-xr-x 4 root sys 512 Sep 19 05:34 ../
-rw-r--r-- 1 dclarke csw 11765 Sep 19 10:32 README.opensolaris
drwxr-xr-x 3 dclarke csw 512 Sep 26 03:15 archives/
drwxr-xr-x 3 dclarke csw 512 Sep 19 06:50 closed/
drwxr-xr-x 3 dclarke csw 512 Sep 26 04:09 log/
drwx------ 2 root root 8192 Sep 26 00:03 lost+found/
-rw-r--r-- 1 dclarke csw 7921 Sep 26 00:52 opensolaris.sh
drwxr-xr-x 3 dclarke csw 512 Sep 26 01:18 proto/
drwxr-xr-x 3 dclarke csw 512 Sep 19 10:32 usr/
bash-3.00$ rm -rf usr proto closed archives README.opensolaris
bash-3.00$ ls -lap
total 42
drwxr-xr-x 4 dclarke csw 512 Sep 28 22:08 ./
drwxr-xr-x 4 root sys 512 Sep 19 05:34 ../
drwxr-xr-x 3 dclarke csw 512 Sep 26 04:09 log/
drwx------ 2 root root 8192 Sep 26 00:03 lost+found/
-rw-r--r-- 1 dclarke csw 7921 Sep 26 00:52 opensolaris.sh
bash-3.00$ bzcat $HOME/snv-20060925/on-src-20060925.tar.bz2 | tar -xf -
bash-3.00$ bzcat $HOME/snv-20060925/on-closed-bins-nd-20060925.i386.tar.bz2 | tar -xf -
Step 7 - Install the SUNWonbld tools.
You will need to be root for this step.
First step is to remove the older SUNWonbld if it exists on the system :
bash-3.00$ su -
Password:
Sun Microsystems Inc. SunOS 5.11 snv_20060918 Sep. 26, 2006
SunOS Internal Development: dclarke 2006-09-26 [mybuild]
bfu'ed from /export/mybuild/archives/i386/nightly on 2006-09-26
Sun Microsystems Inc. SunOS 5.11 snv_47 October 2007
# cd /tmp
# pkgrm SUNWonbld
The following package is currently installed:
SUNWonbld OS-Net Build Tools
(i386) 11.11,REV=2006.09.19.03.58
Do you want to remove this package? [y,n,?,q] y
## Removing installed package instance <SUNWonbld>
This package contains scripts which will be executed with super-user
permission during the process of removing this package.
Do you want to continue with the removal of this package [y,n,?,q] y
## Verifying package <SUNWonbld> dependencies in global zone
## Processing package information.
## Executing preremove script.
Removing 'gk' account
Removing .make.machines
## Removing pathnames in class <none>
/opt/onbld/man/man1/xref.1
/opt/onbld/man/man1/wx.1
/opt/onbld/man/man1/wsdiff.1
/opt/onbld/man/man1/ws.1
/opt/onbld/man/man1/webrev.1
.
.
.
/opt/onbld/bin/Install
/opt/onbld/bin
/opt/onbld
/opt <shared pathname not removed>
## Updating system information.
Removal of <SUNWonbld> was successful.
#
Now install the new SUNWonbld package for this release :
# cd /tmp
# mkdir foo
# cd foo
# bzcat /export/home/dclarke/snv-20060925/SUNWonbld-20060925.i386.tar.bz2 | tar -xf -
# ls
onbld
# pkgadd -d ./onbld SUNWonbld
Processing package instance <SUNWonbld> from </tmp/foo/onbld>
OS-Net Build Tools(i386) 11.11,REV=2006.09.26.14.15
Copyright 2006 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Using </> as the package base directory.
## Processing package information.
## Processing system information.
1 package pathname is already properly installed.
## Verifying package dependencies.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of <SUNWonbld> [y,n,?] y
Installing OS-Net Build Tools as <SUNWonbld>
## Installing part 1 of 1.
/opt/onbld/bin/Install
/opt/onbld/bin/SampleLinks
/opt/onbld/bin/SamplePkgLinks
/opt/onbld/bin/acr
/opt/onbld/bin/bfu
/opt/onbld/bin/bldenv
/opt/onbld/bin/bringovercheck
/opt/onbld/bin/build_cscope
/opt/onbld/bin/cddlchk
/opt/onbld/bin/check_fnames
/opt/onbld/bin/check_rtime
/opt/onbld/bin/checkpaths
/opt/onbld/bin/checkproto
/opt/onbld/bin/cstyle
/opt/onbld/bin/ctfcvtptbl
/opt/onbld/bin/ctffindmod
/opt/onbld/bin/elfcmp
/opt/onbld/bin/flg.flp
/opt/onbld/bin/genoffsets
/opt/onbld/bin/get_depend_info
/opt/onbld/bin/hdrchk
/opt/onbld/bin/i386/abi_audit
/opt/onbld/bin/i386/aw
/opt/onbld/bin/i386/bfuld
/opt/onbld/bin/i386/codereview
/opt/onbld/bin/i386/cpiotranslate
/opt/onbld/bin/i386/cscope-fast
/opt/onbld/bin/i386/ctfconvert
/opt/onbld/bin/i386/ctfdump
/opt/onbld/bin/i386/ctfmerge
/opt/onbld/bin/i386/ctfstabs
/opt/onbld/bin/i386/cw
/opt/onbld/bin/i386/fastfs
/opt/onbld/bin/i386/findunref
/opt/onbld/bin/i386/install
/opt/onbld/bin/i386/lintdump
/opt/onbld/bin/i386/pmodes
/opt/onbld/bin/i386/protocmp
/opt/onbld/bin/i386/protolist
/opt/onbld/bin/intf_check
/opt/onbld/bin/jstyle
/opt/onbld/bin/keywords
/opt/onbld/bin/make_pkg_db
/opt/onbld/bin/makebfu
/opt/onbld/bin/mkacr
/opt/onbld/bin/mkbfu
/opt/onbld/bin/nightly
/opt/onbld/bin/protocmp.terse
/opt/onbld/bin/sccscheck
/opt/onbld/bin/sccscp
/opt/onbld/bin/sccshist
/opt/onbld/bin/sccsmv
/opt/onbld/bin/sccsrm
/opt/onbld/bin/validate_flg
/opt/onbld/bin/validate_paths
/opt/onbld/bin/wdiff
/opt/onbld/bin/webrev
/opt/onbld/bin/ws
/opt/onbld/bin/wsdiff
/opt/onbld/bin/wx
/opt/onbld/bin/xref
/opt/onbld/bin/xref.mk
/opt/onbld/env/developer
/opt/onbld/env/gatekeeper
/opt/onbld/etc/abi/ABI_i386.db
/opt/onbld/etc/abi/ABI_sparc.db
/opt/onbld/etc/abi/exceptions
/opt/onbld/gk/.cshrc
/opt/onbld/gk/.login
/opt/onbld/lib/i386/libdwarf.so.1
/opt/onbld/man/man1/Install.1
/opt/onbld/man/man1/acr.1
/opt/onbld/man/man1/bldenv.1
/opt/onbld/man/man1/bringovercheck.1
/opt/onbld/man/man1/cddlchk.1
/opt/onbld/man/man1/check_rtime.1
/opt/onbld/man/man1/checkpaths.1
/opt/onbld/man/man1/codereview.1
/opt/onbld/man/man1/cstyle.1
/opt/onbld/man/man1/cw.1
/opt/onbld/man/man1/flg.flp.1
/opt/onbld/man/man1/get_depend_info.1
/opt/onbld/man/man1/intf_check.1
/opt/onbld/man/man1/lintdump.1
/opt/onbld/man/man1/make_pkg_db.1
/opt/onbld/man/man1/mkacr.1
/opt/onbld/man/man1/nightly.1
/opt/onbld/man/man1/sccscheck.1
/opt/onbld/man/man1/sccscp.1
/opt/onbld/man/man1/sccsmv.1
/opt/onbld/man/man1/sccsrm.1
/opt/onbld/man/man1/webrev.1
/opt/onbld/man/man1/ws.1
/opt/onbld/man/man1/wsdiff.1
/opt/onbld/man/man1/wx.1
/opt/onbld/man/man1/xref.1
[ verifying class <none> ]
/opt/onbld/bin/i386/install.bin <linked pathname>
## Executing postinstall script.
Installing 'gk' account
dmake concurrency set to 12.
Installation of <SUNWonbld> was successful.
# cd /tmp
# rm -rf foo
#
Step 8 - edit the opensolaris.sh script
Now we need to actually “do something” other than just extracting bits and installing bits. Now you will need to edit a script file, but only a slightly. Its so easy really thats it just silly to think that soon you will be compiling millions of lines of code. Amazing really.
$
$ cd /export/mybuild
$ cp usr/src/tools/env/opensolaris.sh .
$ chmod 644 opensolaris.sh
$ TERM=vt100;LINES=24;COLUMNS=80;EDITOR=/usr/xpg4/bin/vi
$ export TERM LINES COLUMNS EDITOR
$ /usr/xpg4/bin/vi opensolaris.sh
You will need to know how to work with vi to get this job done. Go to line 47 or thereabouts and find the GATE variable thus :
# This is a variable for the rest of the script - GATE doesn't matter to
# nightly itself
GATE=testws; export GATE
Change that to “mybuild” because that is our work area. So in this I case I am working in /export/mybuild .. thus
# This is a variable for the rest of the script - GATE doesn't matter to
# nightly itself
GATE=mybuild; export GATE
Go to line 93 or where you see this STAFFER info :
# The bringover, if any, is done as STAFFER.
# Set STAFFER to your own login as gatekeeper or developer
# The point is to use group "staff" and avoid referencing the parent
# workspace as root.
# Some scripts optionally send mail messages to MAILTO.
#
STAFFER=nobody; export STAFFER
MAILTO=$STAFFER; export MAILTO
I have no idea what a “bringover” is other than when someone can bring over some coffee to me. Just change that “nobody” to be your username like so :
# The bringover, if any, is done as STAFFER.
# Set STAFFER to your own login as gatekeeper or developer
# The point is to use group "staff" and avoid referencing the parent
# workspace as root.
# Some scripts optionally send mail messages to MAILTO.
#
STAFFER=dclarke; export STAFFER
MAILTO=$STAFFER; export MAILTO
Look at around line 124 and you may see a block that looks like this :
# build environment variables, including version info for mcs, motd,
# motd, uname and boot messages. Mostly you shouldn't change this except
# when the release slips (nah) or you move an environment file to a new
# release
#
ROOT="$CODEMGR_WS/proto/root_${MACH}"; export ROOT
SRC="$CODEMGR_WS/usr/src"; export SRC
VERSION="$GATE"; export VERSION
Let's suppose that you want you build to report the Solaris Nevada release data. In this case you would do something like this :
# build environment variables, including version info for mcs, motd,
# motd, uname and boot messages. Mostly you shouldn't change this except
# when the release slips (nah) or you move an environment file to a new
# release
#
ROOT="$CODEMGR_WS/proto/root_${MACH}"; export ROOT
SRC="$CODEMGR_WS/usr/src"; export SRC
VERSION="20060925-nd"; export VERSION
Then goto line 142 where you can put in the build date. At least the month and year at least.
# the RELEASE and RELEASE_DATE variables are set in Makefile.master;
# there might be special reasons to override them here, but that
# should not be the case in general
#
# RELEASE="5.11"; export RELEASE
# RELEASE_DATE="October 2007"; export RELEASE_DATE
RELEASE_DATE="September 2006"; export RELEASE_DATE
I really do NOT recommended that you change the “5.11” release data unless you want to see lots of scripts in your life start to fail. Just leave that alone ... for now. There are a few critical steps to take now. You need to change the options for this nightly build. Go to line 44 and change it to look like so :
#NIGHTLY_OPTIONS="-FNnaCDlmrt"; export NIGHTLY_OPTIONS
NIGHTLY_OPTIONS="-NnaClmrt"; export NIGHTLY_OPTIONS
Take a close look at the “NIGHTLY_OPTIONS” and make sure that the letter “F” and “D” are not there anymore. Now save this file and have a look at what you changed with diff :
bash-3.00$ diff opensolaris.sh usr/src/tools/env/opensolaris.sh | grep "<"
< #NIGHTLY_OPTIONS="-FNnaCDlmrt"; export NIGHTLY_OPTIONS
< NIGHTLY_OPTIONS="-NnaClmrt"; export NIGHTLY_OPTIONS
< GATE=mybuild; export GATE
< STAFFER=dclarke; export STAFFER
< VERSION="snv_20060925"; export VERSION
< RELEASE_DATE="September 2006"; export RELEASE_DATE
bash-3.00$
Looks good .. One more really important step to take. You have a few options here but I want this to be as easy as possible for you. You can either update the master Makefile or simply make a real small change to a directory name. I vote for the directory name change. If you look in the closed binaries directory you will see that the non-debug binaries extracted into a directory with “-nd” stuck on the end of it. That has to be changed such that the Makefile can point to the correct place thus :
bash-3.00$ pwd
/export/mybuild
bash-3.00$ ls -lap closed
total 64
drwxr-xr-x 3 dclarke csw 512 Sep 27 01:03 ./
drwxr-xr-x 6 dclarke csw 512 Sep 28 22:28 ../
-r--r--r-- 1 dclarke csw 8902 Sep 27 00:53 BINARYLICENSE.txt
-rw-r--r-- 1 dclarke csw 9602 Sep 27 01:03 README.ON-BINARIES.i386
-r--r--r-- 1 dclarke csw 4097 Sep 27 00:53 THIRDPARTYLICENSE.ON-BINARIES
drwxr-xr-x 8 dclarke csw 512 Sep 27 01:03 root_i386-nd/
bash-3.00$ mv closed/root_i386-nd closed/root_i386
bash-3.00$ ls -lap closed
total 64
drwxr-xr-x 3 dclarke csw 512 Sep 29 00:17 ./
drwxr-xr-x 6 dclarke csw 512 Sep 28 22:28 ../
-r--r--r-- 1 dclarke csw 8902 Sep 27 00:53 BINARYLICENSE.txt
-rw-r--r-- 1 dclarke csw 9602 Sep 27 01:03 README.ON-BINARIES.i386
-r--r--r-- 1 dclarke csw 4097 Sep 27 00:53 THIRDPARTYLICENSE.ON-BINARIES
drwxr-xr-x 8 dclarke csw 512 Sep 27 01:03 root_i386/
bash-3.00$
Step 9 - EXTRA Step from Dennis
I know that I am about to fire off a complete build of the OpenSolaris source.
That is a lot of work. Even for a killer fast machine it will take nearly two hours. So let's thin out services and processes that we just do not need right now okay ? Its easy thanks to SMF and preconfigured service profiles. As root .. do this :
# svccfg
svc:> apply /var/svc/profile/generic_limited_net.xml
svc:> exit
#
Now we can continue ... Step 10 - Build !
WARNING : If you have an old slow machine, better be prepared for a 15 hour wait.
Be sure to set some environment variables, like your PATH and also be sure that the variable CC is NOT set !
bash-3.00$ exit
exit
$
$ PATH=/opt/SUNWspro/bin:/opt/onbld/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/ccs/bin
$ export PATH
$ TERM=vt100;LINES=24;COLUMNS=80;EDITOR=vi;LANG=C;LC_ALL=C
$ export TERM LINES COLUMNS EDITOR LANG LC_ALL
$ unset CC
$ unset LS_COLORS
$ unset MANPATH
$ env
COLUMNS=80
EDITOR=vi
HOME=/export/home/dclarke
LANG=C
LC_ALL=C
LINES=24
LOGNAME=dclarke
MAIL=/var/mail//dclarke
PATH=/opt/SUNWspro/bin:/opt/onbld/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/ccs/bin
SHELL=/sbin/sh
SSH_CLIENT=192.168.35.220 1788 22
SSH_CONNECTION=192.168.35.220 1788 192.168.35.40 22
SSH_TTY=/dev/pts/2
TERM=vt100
TZ=Canada/Eastern
USER=dclarke
$ cd /export/mybuild
$
$ which nightly
/opt/onbld/bin/nightly
$
$ date
Fri Sep 29 00:32:58 EDT 2006
$ /opt/onbld/bin/nightly ./opensolaris.sh &
100588
$ vmstat 60
kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr s0 s1 s1 -- in sy cs us sy id
0 0 0 5725040 1735424 24 51 31 2 1 0 47 4 -0 -0 0 388 312 228 0 2 98
1 0 0 5610236 1579948 1301 17412 327 0 0 0 0 206 0 0 0 2776 21058 1329 39 26 35
0 0 0 5599668 1568700 1631 21799 13 1 1 0 0 121 0 0 0 2615 24760 1341 49 32 19
0 0 0 5602544 1564412 1680 23984 109 4 4 0 0 190 0 0 0 3070 22954 1438 25 35 40
0 0 0 5598804 1558952 1516 21746 91 7 7 0 0 182 0 0 0 2910 21952 1370 23 33 44
1 0 0 5600176 1564616 1237 13082 548 103 94 0 0 173 0 0 0 2045 13512 764 21 18 61
0 0 0 5594228 1548348 2029 26960 630 207 202 0 0 158 0 0 0 3081 24884 1240 14 39 47
3 0 0 5511900 1497056 800 16552 103 256 230 0 0 50 0 0 0 1071 15923 281 78 18 4
1 0 0 5502728 1497272 675 15215 54 306 279 0 0 19 0 0 0 814 13644 226 82 16 2
1 0 0 5534248 1523572 1284 21357 53 312 261 0 0 31 0 0 0 1107 20109 304 76 23 1
2 0 0 5517824 1516284 1032 18313 61 267 236 0 0 24 0 0 0 986 17509 271 79 20 1
2 0 0 5524788 1523132 1084 15851 19 284 244 0 0 24 0 0 0 2197 17046 1480 74 18 8
1 0 0 5473808 1493760 663 14402 1 294 230 0 0 17 0 0 0 890 13890 226 82 15 2
2 0 0 5508576 1527772 1469 22921 2 395 346 0 0 26 0 0 0 1115 21903 323 72 25 3
2 0 0 5494124 1512240 1296 20417 1 313 271 0 0 28 0 0 0 1087 20159 309 75 23 1
3 0 0 5507168 1509316 1010 15733 21 348 310 0 0 35 0 0 0 2290 16945 1400 73 18 8
3 0 0 5521968 1549704 1297 20479 32 376 332 0 0 51 0 0 0 1732 21224 493 70 24 5
.
.
.
At this point it is best to walk away for a while. If you have a dual processor AMD Opteron with plenty of RAM then don't wander away too far. If you have a single proc 400MHz Pentium then I suggest you go build a suspension bridge in your back yard. Step 11 - Check Results
Eventually, after a few hours or so, your machine will settle down :
.
.
.
2 0 0 5383584 1373628 727 15730 232 673 656 0 0 132 0 0 0 2568 35122 556 58 28 14
2 0 0 5366848 1370552 841 17164 447 325 316 0 0 116 0 0 0 2751 37083 529 59 29 12
1 0 0 5341420 1363660 827 16968 236 338 337 0 0 68 0 0 0 2891 40008 354 67 29 4
1 0 0 5376724 1398344 793 16777 360 282 281 0 0 105 0 0 0 2532 35893 503 66 28 6
kthr memory page disk faults cpu
r b w swap free re mf pi po fr de sr s0 s1 s1 -- in sy cs us sy id
2 0 0 5404532 1418644 1086 17828 333 130 124 0 0 65 0 0 0 1312 40000 526 55 25 20
0 0 0 5414596 1417004 834 11795 554 100 99 0 0 158 0 0 0 1781 25274 654 32 19 49
0 0 0 5423584 1402600 14 68 157 0 0 0 0 76 0 0 0 657 658 226 0 1 99
0 0 0 5424288 1402220 2 18 9 0 0 0 0 3 0 0 0 360 68 130 0 1 99
0 0 0 5424480 1402504 0 0 0 0 0 0 0 0 0 0 0 348 38 124 0 0 99
0 0 0 5424512 1402536 0 0 0 0 0 0 0 0 0 0 0 349 40 123 0 0 99
you have mail
$
The place to look for the results of this build is in the log directory.
$ ls -lap
total 82
drwxr-xr-x 8 dclarke csw 512 Sep 29 02:45 ./
drwxr-xr-x 4 root sys 512 Sep 19 05:34 ../
-rw-r--r-- 1 dclarke csw 11765 Sep 26 18:05 README.opensolaris
drwxr-xr-x 3 dclarke csw 512 Sep 29 02:46 archives/
drwxr-xr-x 3 dclarke csw 512 Sep 29 00:17 closed/
drwxr-xr-x 4 dclarke csw 512 Sep 29 03:43 log/
drwx------ 2 root root 8192 Sep 26 00:03 lost+found/
-rw-r--r-- 1 dclarke csw 7975 Sep 29 00:09 opensolaris.sh
drwxr-xr-x 3 dclarke csw 512 Sep 29 00:38 proto/
drwxr-xr-x 3 dclarke csw 512 Sep 26 18:04 usr/
$ ls -lap log
total 16
drwxr-xr-x 4 dclarke csw 512 Sep 29 03:43 ./
drwxr-xr-x 8 dclarke csw 512 Sep 29 02:45 ../
drwxr-xr-x 2 dclarke csw 512 Sep 26 04:09 log.2006-09-26/
drwxr-xr-x 2 dclarke csw 512 Sep 29 03:43 log.2006-09-29/
$ ls -lap log/log.2006-09-29/
total 127072
drwxr-xr-x 2 dclarke csw 512 Sep 29 03:43 ./
drwxr-xr-x 4 dclarke csw 512 Sep 29 03:43 ../
-rw-r--r-- 1 dclarke csw 2142 Sep 29 03:43 mail_msg
-rw-r--r-- 1 dclarke csw 63386359 Sep 29 03:43 nightly.log
-rw-r--r-- 1 dclarke csw 1612197 Sep 29 02:46 proto_list_i386
See that file mail_msg there? That is the actual message that should have been sent to you in the mail. This is why you saw the message “you have mail” above. If this is a nice small file, like you see above, then most likely its not full of error messages. Thats a good thing. Now let's see what this file says :
$ cat log/log.2006-09-29/mail_msg
==== Nightly distributed build started: Fri Sep 29 00:33:04 EDT 2006 ====
==== Nightly distributed build completed: Fri Sep 29 03:43:22 EDT 2006 ====
==== Total build time ====
real 3:10:18
==== Nightly argument issues ====
Warning: the N option (do not run protocmp) is set; it probably shouldn't be
WARNING: DEBUG build not requested, but lint will be with DEBUG enabled.
==== Build environment ====
/usr/bin/uname
SunOS phobos 5.11 snv_20060918 i86pc i386 i86pc
/opt/onbld/bin/nightly ./opensolaris.sh
nightly.sh version 1.105 2006/08/30
/opt/SUNWspro/bin/dmake
dmake: Sun Distributed Make 7.7 2005/10/13
number of concurrent jobs = 4
32-bit compiler
/opt/onbld/bin/i386/cw -_cc
cw version 1.20
primary: /opt/SUNWspro/bin/cc
cc: Sun C 5.8 Patch 121016-02 2006/03/31
shadow: /usr/sfw/bin/gcc
gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802)
64-bit compiler
/opt/onbld/bin/i386/cw -_cc
cw version 1.20
primary: /opt/SUNWspro/bin/cc
cc: Sun C 5.8 Patch 121016-02 2006/03/31
shadow: /usr/sfw/bin/gcc
gcc (GCC) 3.4.3 (csl-sol210-3_4-20050802)
/usr/java/bin/javac
java full version "1.5.0_08-b03"
/usr/ccs/bin/as
as: Sun Compiler Common 10 snv_46 08/03/2006
/usr/ccs/bin/ld
ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.548
Build project: default
Build taskid: 62
==== Build version ====
snv_20060925
==== Make clobber ERRORS ====
==== Make tools clobber ERRORS ====
==== Tools build errors ====
==== SCCS Noise (non-DEBUG) ====
==== Build errors (non-DEBUG) ====
==== Build warnings (non-DEBUG) ====
==== Elapsed build time (non-DEBUG) ====
real 2:07:21.7
user 2:31:10.7
sys 24:57.5
==== Build noise differences (non-DEBUG) ====
==== cpio archives build errors (non-DEBUG) ====
==== Check ELF runtime attributes ====
==== Diff ELF runtime attributes (since last build) ====
==== 'dmake lint' of src ERRORS ====
==== Elapsed time of 'dmake lint' of src ====
real 53:28.9
user 1:26:43.3
sys 4:28.7
==== lint warnings src ====
==== lint noise differences src ====
==== cstyle/hdrchk errors ====
==== Find core files ====
==== Impact on file permissions ====
$
That is an excellent looking build report above !
Step 12 - Perform a BFU
IF and ONLY IF ALL WENT WELL then you may proceed with a BFU.
Now, before we proceed please take a moment to note the location of the Developer's Reference at OpenSolaris.org. While it does not explain all of the mysteries of life it certainly clears the air about a great many things related to what we are doing. Thus : Let me now quote a small passage of scripture from the Developer's Reference that describes the BFU : 5.1.2 BFU is used to update all ON bits, both kernel and userland. It is capable
of updating some configuration files and is aware of the impact of the changes
that have been made to ON. BFU is more thorough than Install, and takes longer.
Also, unlike Install, the new kernel will be installed over the existing one,
so if it does not work properly you may have to boot from alternate media to
recover.
Now would be a good time for a stiff drink becuase if anything did go wrong then you will turn your machine in to a “warm brick”. This is known as &ldquo"to brickify” a server. Other language works just as well. If you feel any sense in your gut that “something bad” is about to happen then please take a moment to review section 5 of the Developer's reference that tells you all you need to know. You will need to be root for this operation.
$ su -
Password:
Sun Microsystems Inc. SunOS 5.11 snv_20060918 Sep. 26, 2006
SunOS Internal Development: dclarke 2006-09-26 [mybuild]
bfu'ed from /export/mybuild/archives/i386/nightly on 2006-09-26
Sun Microsystems Inc. SunOS 5.11 snv_47 October 2007
# cd /export/mybuild
# ls -lap archives/i386/
total 12
drwxr-xr-x 3 dclarke csw 512 Sep 29 02:45 ./
drwxr-xr-x 3 dclarke csw 512 Sep 29 02:46 ../
drwxr-xr-x 2 dclarke csw 1024 Sep 29 02:46 nightly-nd/
# ls -lap archives/i386/nightly-nd/
total 496172
drwxr-xr-x 2 dclarke csw 1024 Sep 29 02:46 ./
drwxr-xr-x 3 dclarke csw 512 Sep 29 02:45 ../
-rw-r--r-- 1 dclarke csw 65586 Sep 29 02:46 conflict_resolution.gz
-rw-r--r-- 1 dclarke csw 57228656 Sep 29 02:45 generic.kernel
-rw-r--r-- 1 dclarke csw 22154112 Sep 29 02:45 generic.lib
-rw-r--r-- 1 dclarke csw 2224228 Sep 29 02:45 generic.root
-rw-r--r-- 1 dclarke csw 1070080 Sep 29 02:45 generic.sbin
-rw-r--r-- 1 dclarke csw 164138112 Sep 29 02:46 generic.usr
-rw-r--r-- 1 dclarke csw 1100800 Sep 29 02:45 i86pc.boot
-rw-r--r-- 1 dclarke csw 4679680 Sep 29 02:45 i86pc.root
-rw-r--r-- 1 dclarke csw 1141760 Sep 29 02:45 i86pc.usr
# PATH=/opt/SUNWspro/bin:/opt/onbld/bin:/usr/ccs/bin:/usr/sbin:/usr/bin
# export PATH
# FASTFS=/opt/onbld/bin/`uname -p`/fastfs;export FASTFS
# BFULD=/opt/onbld/bin/`uname -p`/bfuld;export BFULD
# GZIPBIN=/usr/bin/gzip;export GZIPBIN
# unset LS_COLORS
# unset MANPATH
# env
BFULD=/opt/onbld/bin/i386/bfuld
FASTFS=/opt/onbld/bin/i386/fastfs
GZIPBIN=/usr/bin/gzip
HOME=/
HZ=
LANG=C
LC_ALL=C
LOGNAME=root
MAIL=/var/mail/root
PATH=/opt/SUNWspro/bin:/opt/onbld/bin:/usr/ccs/bin:/usr/sbin:/usr/bin
SHELL=/sbin/sh
TERM=vt100
TZ=Canada/Eastern
# which bfu
/opt/onbld/bin/bfu
# /opt/onbld/bin/bfu /export/mybuild/archives/i386/nightly-nd
Copying /opt/onbld/bin/bfu to /tmp/bfu.628850
Executing /tmp/bfu.628850 /export/mybuild/archives/i386/nightly-nd
Loading /export/mybuild/archives/i386/nightly-nd on /
Creating bfu execution environment ...
/tmp/bfu.628850[2428]: /net/onnv.eng/export/gate/public/bin/acr: cannot open
chmod: WARNING: can't access /tmp/bfubin/acr
Verifying archives ...
Performing basic sanity checks ...
/etc/svc/repository.db: passed integrity check
Disabling kernel module unloading ... moddebug: 0 = 0x20000
Quiescing init ...
Unmounting /lib/libc.so.1 ...
Disabling sendmail temporarily ...
Disabling remote logins ...
Disabling syslog temporarily ...
Killing httpd ...
Disabling fmd temporarily ...
Killing nscd ...
Turning on delayed i/o ...
Filesystem Mode
/ safe
/usr safe
2141 blocks
Saving configuration files in /bfu.child ... 4608 blocks
Removing init.d links ... done.
Removing obsolete rc.d scripts ... done.
Extracting ufs modules for boot block ... 2230 blocks
Extracting generic.usr ... 320583 blocks
Extracting i86pc.usr ... 2230 blocks
Extracting generic.lib ... 43270 blocks
Extracting generic.sbin ... 2090 blocks
Extracting generic.kernel ... 111774 blocks
Extracting generic.root ... 4345 blocks
Extracting i86pc.root ... 9140 blocks
Extracting i86pc.boot ... 2150 blocks
Removing duplicate kernel binaries ...
rm /kernel/drv/amd64/pci_pci
rm /kernel/drv/pci_pci
Simulating SUNWcry* installation...
Cleaning up old Kerberos GSS-API mechanisms...
Restoring configuration files.
old conflict: boot/grub/menu.lst
restore: boot/solaris/bootenv.rc
restore: boot/solaris/devicedb/master
old conflict: etc/crypto/kcf.conf
old conflict: etc/default/inetinit
old conflict: etc/default/init
restore: etc/devlink.tab
restore: etc/driver_aliases
old conflict: etc/driver_classes
restore: etc/group
old conflict: etc/inet/hosts
restore: etc/inet/inetd.conf
restore: etc/inet/netmasks
restore: etc/inet/services
restore: etc/inittab
restore: etc/krb5/krb5.conf
old conflict: etc/logadm.conf
restore: etc/logindevperm
old conflict: etc/minor_perm
old conflict: etc/name_to_major
old conflict: etc/nsswitch.conf
old conflict: etc/openwin/server/etc/OWconfig
restore: etc/passwd
old conflict: etc/path_to_inst
old conflict: etc/power.conf
old conflict: etc/remote
old conflict: etc/rmmount.conf
old conflict: etc/security/auth_attr
restore: etc/security/device_policy
old conflict: etc/security/exec_attr
old conflict: etc/security/policy.conf
old conflict: etc/security/prof_attr
old conflict: etc/shadow
old conflict: etc/user_attr
old conflict: etc/vfstab
old conflict: etc/vold.conf
restore: kernel/drv/sd.conf
preserve: kernel/misc/amd64/sysinit
preserve: kernel/misc/amd64/usbs49_fw
preserve: kernel/misc/sysinit
preserve: kernel/misc/usbs49_fw
preserve: var/adm/utmpx
preserve: var/adm/wtmpx
preserve: var/log/syslog
preserve: var/saf/zsmon/log
restore: var/spool/cron/crontabs/root
Create /platform/i86pc/boot_archive
updating /platform/i86pc/boot_archive...this may take a minute
For each file in conflict, your version has been restored.
The new versions are under /bfu.conflicts.
MAKE SURE YOU RESOLVE ALL CONFLICTS BEFORE REBOOTING.
To install resolved changes required for reboot in the boot
archive, invoke 'bootadm update-archive'
Removing obsolete smf services ...
Disabling unneeded inetd.conf entries ...
Connecting platform and name service profiles ...
Marking converted services as enabled ...
cp: cannot access /net/greenline.eng/meta0/smf/post-5090532/sysidtool.xml
bfu: could not copy /net/greenline.eng/meta0/smf/post-5090532/sysidtool.xml
cp: cannot access /net/greenline.eng/meta0/smf/post-5090532/kdmconfig.xml
bfu: could not copy /net/greenline.eng/meta0/smf/post-5090532/kdmconfig.xml
Upgrade of phobos took 5:23.
Turning off delayed i/o and syncing filesystems ...
Filesystem Mode
/ safe
/usr safe
Entering post-bfu protected environment (shell: ksh).
Edit configuration files as necessary, then reboot.
bfu#
bfu#
bfu# ksh /opt/onbld/bin/acr
No conflicts to resolve.
bfu# halt
updating /platform/i86pc/boot_archive...this may take a minute
At this point your machine should be rebooting. It is entirely possible that it may shut down to some point where it needs you to “hit any key” also. I have had that experience and needed to drive 125 Km to hit any key.
Step 13 - login
If all went well then you should have seen your machine reboot as per usual but with a new revision label. For example :
Last login: Thu Sep 28 23:46:45 2006 from 192.168.35.220
Sun Microsystems Inc. SunOS 5.11 snv_20060925 September 2006
bfu'ed from /export/mybuild/archives/i386/nightly-nd on 2006-09-29
Sun Microsystems Inc. SunOS 5.11 snv_47 October 2007
You have new mail.
$
$ uname -a
SunOS phobos 5.11 snv_20060925 i86pc i386 i86pc
$
$ su -
Password:
Sun Microsystems Inc. SunOS 5.11 snv_20060925 September 2006
bfu'ed from /export/mybuild/archives/i386/nightly-nd on 2006-09-29
Sun Microsystems Inc. SunOS 5.11 snv_47 October 2007
That may look a little messy but the output from “uname -X” will reveal all :
$ uname -X
System = SunOS
Node = phobos
Release = 5.11
KernelID = snv_20060925
Machine = i86pc
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 2
Are you done now ?
At this point you may think that you are all done. As far as the bulk of the operating system is concerned you have built a complete system, updated the kernel and then rebooted. Well done! But are you all done? Is there anything else to consider?
Please see the JDS (Java Desktop System) Consolidation. Its the last word in up to date desktop options for your fresh OpenSolaris machine. If you want KDE or GNOME or Xfce then please see Blastwave. If you want the Java Desktop System and are keen to test it yourself then look here : Before you dive in there you need to look at the vast size of that monster. Its just really staggeringly huge. The entire source of the OpenSolaris operating system will fit on a 64MB USB thumb drive. Easy. The size of the JDS (Java Desktop System) Consolidation is well up past 300 MB.
$ pwd
/export/mybuild/vermillion
$ ls -l
total 622880
-rw-r--r-- 1 dclarke csw 9545216 Sep 28 13:24 evolution-vermillion_50x.tar
-rw-r--r-- 1 dclarke csw 17486848 Sep 28 13:07 firefox-vermillion_50x.tar
-rw-r--r-- 1 dclarke csw 182740480 Sep 28 13:17 gnome-vermillion_50x.tar
-rw-r--r-- 1 dclarke csw 484352 Sep 29 06:50 hal.tar
-rw-r--r-- 1 dclarke csw 48640 Sep 28 13:17 jds-vermillion_50x.tar
-rw-r--r-- 1 dclarke csw 5114880 Sep 28 13:18 l10n-vermillion_50x.tar
-rw-r--r-- 1 dclarke csw 79276544 Sep 28 13:22 l10nmessages-vermillion_50x.tar
-rw-r--r-- 1 dclarke csw 8307200 Sep 28 13:24 testing-vermillion_50x.tar
-rw-r--r-- 1 dclarke csw 15654400 Sep 28 13:23 thunderbird-vermillion_50x.tar
$
$ ls -1 *.tar | xargs digest -v -a md5
md5 (evolution-vermillion_50x.tar) = ad74a441a49ec39de7adeba8fe286454
md5 (firefox-vermillion_50x.tar) = f8aae51182d1ff77d5939959b6fb4c92
md5 (gnome-vermillion_50x.tar) = faa9fa45143338fc2c9088b4411300a3
md5 (hal.tar) = 6e8fe0f9556ea3b809b5c75c2f2d5538
md5 (jds-vermillion_50x.tar) = 957121f2b1b83d7309c963738ab4878f
md5 (l10n-vermillion_50x.tar) = 2ed6e948cc91c17b37de7c1c6ce0754e
md5 (l10nmessages-vermillion_50x.tar) = d1f3c1a8169440e391c36862a0ad9ac3
md5 (testing-vermillion_50x.tar) = b2e9323591e9c0e4851265b955523bd1
md5 (thunderbird-vermillion_50x.tar) = c80a0f271ab353ed0581a2f187679d2d
There are fairly clear installation instructions provided but I may just walk through it for the sake of posing a pile of screenshots. I will do that in another article so watch for that update.
Thank you for reading all this and I hope that your Opterons are blazing fast and a cool wind may always be at your rack! Dennis Clarke Sat Sep 30 18:57:45 EDT 2006 |
|||||||