Child pages
  • ONNV 142 on snv_134 build notes
Skip to end of metadata
Go to start of metadata

Instructions for building ONNV 142 on snv_134.

It's necessary to get snv_134 up to a build between snv_137 and snv_143 before you can go to later builds.

Builds prior to snv_136 built SVR4 packages, 136 and later will output to an IPS pkg repo.

Create an user named openindiana
Login as openindiana
Note: You will need to have the extras repo set up on the box you are doing this for. Please see here or below for instructions.

Enable some services

pfexec svcadm enable -r autofs
pfexec svcadm enable -r nfs/client

Configure the extra repository
The extra repository provides several necessary packages, like but not limited to:
This repository is not public accessible. One must register here to obtain a certificate. The certificate is free, only registration is required.
Download and save the certificates (a public and private part) to your home directory. For the remainder of this example the base of the filenames is OpenSolaris_extras. So save them as OpenSolaris_extras.key.pem and OpenSolaris_extras.certificate.pem

Next install the certificates

pfexec mkdir -m 0755 -p /var/pkg/ssl
pfexec cp -i ~/OpenSolaris_extras.key.pem /var/pkg/ssl
pfexec cp -i ~/OpenSolaris_extras.certificate.pem /var/pkg/ssl

Add the new repository so that pkg can use it

pfexec pkg set-authority -k /var/pkg/ssl/OpenSolaris_extras.key.pem \
 -c /var/pkg/ssl/OpenSolaris_extras.certificate.pem \
 -O extra
pfexec pkg set-authority -O	

For more information on setting up the extra repositories see this page

Installation of Sun Studio

Before beginning, make sure you don't have Sun Studio installed. Multiple versions of Sun Studio exists. To prevent using to incorrect version the safest is to remove all existing versions.
Check if any Sun Studio version is installed:

pkg info | grep sunstu

If they are installed, remove them. Eg:

pfexec pkg uninstall -r pkg:// \
                 pkg:// \
                 pkg:// \
pfexec pkg uninstall -r developer/build/onbld

Keep running "pkg info | grep sunstu" and uninstalling until nothing reports back.

Then double check there is nothing under /opt related to compilers, and remove as necessary, eg:

ls -l /opt
pfexec rm -rf /opt/SUNWspro
pfexec rm -rf /opt/sunstudio12.1

Set some environment variables:

These are specific to our build environment, but you can achieve the same by obtaining those downloads and altering the environment variables.


Then install the tarballs:

pfexec mkdir /opt/SUNWspro
bzip2 -dc ${SS12} | (cd /opt/SUNWspro; pfexec tar xvf -)
gzip -dc ${SS12u1} | (cd /opt; pfexec tar xvf -)
pfexec ln -s ../sunstudio12.1 /opt/SUNWspro
Building ONNV 142

Set up your environment:

pfexec /sbin/zfs create -o atime=off -p rpool/export/builds/$GATE
pfexec chown `id -u`:`id -g` /export/builds/$GATE
cd /export/builds/$GATE

unset CC
unset CXX
PATH=/opt/onbld/bin:/opt/onbld/bin/`uname -p`:/opt/SUNWspro/bin:/usr/bin:/usr/sbin:/usr/ccs/bin
export PATH

Install mercurial to download the source

pfexec pkg install \

Grab the source for ONNV 142:

cd /export/builds/$GATE
hg clone
cd onnv-gate
hg update onnv_$SNV

Copy the closed binaries, both debug and non-debug

bzip2 -dc $DLCMIRROR/osol/on/downloads/b$SNV/on-closed-bins-nd.`uname -p`.tar.bz2 | tar xpvf -
bzip2 -dc $DLCMIRROR/osol/on/downloads/b$SNV/on-closed-bins.`uname -p`.tar.bz2 | tar xpvf -
cp $DLCMIRROR/osol/on/downloads/b$SNV/on-crypto.i386.tar.bz2 .
cp $DLCMIRROR/osol/on/downloads/b$SNV/on-crypto-nd.i386.tar.bz2 .

install build dependencies
system/management/snmp/sea -, used in:
library/libxslt - xslt.h, used in usr/src/cmd/lvm/metassist/xml
system/library/install -, used in usr/src/lib/lvm/libsvm
text/gnu-grep - ggrep

pfexec pkg install \
text/gnu-grep \
system/management/snmp/sea \
system/library/install \
library/libxslt \

NOTE: The list of ONNV dependencies varies between versions, newer ones include perl 5.10, etc.

Create a custom version of

Note: We have removed the debug flags and also the -a, -C and -l flags (create cpio archives, check for cstyle/hdrck errors, make lint respectively)

cat usr/src/tools/env/ | \
sed s/^NIGHTLY_OPTIONS=\".*\"\;/NIGHTLY_OPTIONS=\"-nmprt\"\;/ | \
sed s/GATE=testws\;/GATE=$GATE\;/ | \
sed s%CODEMGR_WS=\"/export/\$GATE\"\;%CODEMGR_WS=\"`pwd`\"\;% | \
sed s/^STAFFER=nobody\;/STAFFER=openindiana\;/ | \

Edit STAFFER and MAILTO in as appropriate, then add the following to the bottom of

cat <<EOF >>
i386_LINT=/opt/sunstudio12.1/bin/lint; export i386_LINT
amd64_LINT=/opt/sunstudio12.1/bin/lint; export amd64_LINT
sparc_LINT=/opt/sunstudio12.1/bin/lint; export sparc_LINT
sparcv9_LINT=/opt/sunstudio12.1/bin/lint; export sparcv9_LINT

The "CW_NO_SHADOW" disables shadow compilation. Shadow Compilation basically compiles everything with CC and GCC to ensure both compile cleanly.

Build the ONBLD tools:

ksh93 usr/src/tools/scripts/ \
 "cd usr/src/tools && dmake install"

From reading the comments in the Makefile it is apparent that the above is all that is needed as we are building with the closed binaries. The other make bit sets stuff up for insiders with complete source trees.

Should the above still contain the "&& dmake setup" from the blog command it copies?  If not is there any need for the "cd .."
What does "dmake setup" do? The target doesn't seem to exist.
James McPherson wrote in a post the following

$ ksh93 usr/src/tools/scripts/ envfile \
	"cd usr/src && \
	PATH= (insert PATH statement here) dmake setup && \
	cd tools && dmake install"

*What does dmake setup do?
*Why did the build succeed without issuing dmake setup
*What is the correct order? First install and than setup or reverse.

Remove any previous installed version of the ONbuild package

pfexec pkg uninstall -r developer/build/onbld

Also remove the following directory if it still exists

pfexec rm -rf /opt/onbld

Install the newly built onbld tools:

pfexec cp -r usr/src/tools/proto/root_`uname -p`-nd/opt/onbld /opt

Now build ONNV

time /opt/onbld/bin/nightly

When the build is finished please see the Build Reports page to check the results.