diff options
Diffstat (limited to 'usr/src/tools/scripts')
| -rw-r--r-- | usr/src/tools/scripts/Makefile | 8 | ||||
| -rw-r--r-- | usr/src/tools/scripts/bfudrop.sh | 123 | ||||
| -rw-r--r-- | usr/src/tools/scripts/bindrop.sh | 506 | ||||
| -rw-r--r-- | usr/src/tools/scripts/bldenv.1 | 20 | ||||
| -rw-r--r-- | usr/src/tools/scripts/bldenv.sh | 37 | ||||
| -rw-r--r-- | usr/src/tools/scripts/checkpaths.sh | 11 | ||||
| -rw-r--r-- | usr/src/tools/scripts/mkclosed.sh | 8 | ||||
| -rw-r--r-- | usr/src/tools/scripts/mkreadme_osol.pl | 97 | ||||
| -rw-r--r-- | usr/src/tools/scripts/mktpl.pl | 129 | ||||
| -rw-r--r-- | usr/src/tools/scripts/nightly.1 | 34 | ||||
| -rw-r--r-- | usr/src/tools/scripts/nightly.sh | 568 | ||||
| -rw-r--r-- | usr/src/tools/scripts/onblddrop.sh | 91 | ||||
| -rw-r--r-- | usr/src/tools/scripts/sdrop.sh | 67 | ||||
| -rw-r--r-- | usr/src/tools/scripts/stdenv.sh | 10 |
14 files changed, 1567 insertions, 142 deletions
diff --git a/usr/src/tools/scripts/Makefile b/usr/src/tools/scripts/Makefile index 2942b19696..a481c9d0fc 100644 --- a/usr/src/tools/scripts/Makefile +++ b/usr/src/tools/scripts/Makefile @@ -20,7 +20,7 @@ # # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -30,6 +30,8 @@ SHFILES= \ Install \ acr \ bfu \ + bfudrop \ + bindrop \ bldenv \ build_cscope \ bringovercheck \ @@ -46,12 +48,14 @@ SHFILES= \ mkbfu \ mkclosed \ nightly \ + onblddrop \ protocmp.terse \ sccscheck \ sccscp \ sccshist \ sccsmv \ sccsrm \ + sdrop \ webrev \ ws \ wx \ @@ -62,6 +66,8 @@ PERLFILES= \ check_rtime \ hdrchk \ jstyle \ + mkreadme_osol \ + mktpl \ validate_flg \ validate_paths \ wdiff diff --git a/usr/src/tools/scripts/bfudrop.sh b/usr/src/tools/scripts/bfudrop.sh new file mode 100644 index 0000000000..5c0b79cca4 --- /dev/null +++ b/usr/src/tools/scripts/bfudrop.sh @@ -0,0 +1,123 @@ +#! /usr/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# Wrap up a set of BFU archives as a tarball, including binary license +# files. +# usage: bfudrop build-id +# where "build-id" is the build identifier in the archives directory +# of the current workspace (e.g., "nightly"). +# + +usage="bfudrop build-id" + +fail() { + echo $* + exit 1 +} + +[ -n "$SRC" ] || fail "Please set SRC." +[ -n "$CODEMGR_WS" ] || fail "Please set CODEMGR_WS." + +# +# Directory that we assemble everything in. Everything goes into +# $subdir so that it unpacks cleanly. +# +stagedir=$(mktemp -dt bfudropXXXXX) + +[ -n "$stagedir" ] || fail "Can't create staging directory." + +scratchdir=$stagedir/tmp + +# +# Generate README.BFU-ARCHIVES.$isa from boilerplate and the contents +# of the bfu archives. +# usage: cd archivedir; mkreadme destdir +# +mkreadme() { + destdir=$1 + readme=$destdir/README.BFU-ARCHIVES.$isa + sed -e s/@ISA@/$isa/ -e s/@DELIVERY@/BFU-ARCHIVES/ \ + $SRC/tools/opensolaris/README.binaries.tmpl > $readme + for f in *; do + echo "==== $f ====" >> $readme + # + # The cpio table of contents includes directories, and + # we just want files. So unpack the cpio file into a + # temp directory, do a find(1) to get the table of + # contents, and remove the temp directory. + # + mkdir -p $scratchdir || fail "can't create $scratchdir." + case $f in + *.gz) cat=gzcat;; + *.Z|*.bz2) + fail "$f: compression type not supported" + ;; + *) cat=cat;; + esac + $cat $f | (cd $scratchdir; cpio -id) + if [ $? -ne 0 ]; then + fail "can't extract $f" + fi + (cd $scratchdir; find * -type f -print) | sort >> $readme + rm -rf $scratchdir + done +} + +if [ $# -ne 1 ]; then + fail "usage: $usage" +fi +build=$1 +subdir="archives-$build" + +isa=`uname -p` +tarfile=$CODEMGR_WS/on-bfu-$build.$isa.tar + +mkdir -p $stagedir/$subdir/$isa || \ + fail "Can't create $stagedir/$subdir/$isa." + +cd $CODEMGR_WS + +archvdir=archives/$isa/$build +[ -d $archvdir ] || fail "Can't find $archvdir." + +# copy archives +(cd $archvdir; tar cf - .) | (cd $stagedir/$subdir/$isa; tar xf -) + +# Insert binary license files. +cp -p $SRC/tools/opensolaris/BINARYLICENSE.txt $stagedir/$subdir || \ + fail "Can't add BINARYLICENSE.txt" +(cd $archvdir; mkreadme $stagedir/$subdir) +cp -p $CODEMGR_WS/THIRDPARTYLICENSE.BFU-ARCHIVES $stagedir/$subdir || \ + fail "Can't add THIRDPARTYLICENSE.BFU-ARCHIVES." + +(cd $stagedir; tar cf $tarfile $subdir) || fail "Can't create $tarfile." +bzip2 -f $tarfile || fail "Can't compress $tarfile". + +rm -rf $stagedir diff --git a/usr/src/tools/scripts/bindrop.sh b/usr/src/tools/scripts/bindrop.sh new file mode 100644 index 0000000000..7ea4cdd032 --- /dev/null +++ b/usr/src/tools/scripts/bindrop.sh @@ -0,0 +1,506 @@ +#! /usr/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +#ident "%Z%%M% %I% %E% SMI" +# +# Create an encumbered binaries tarball from a full build proto area, +# less the contents of an OpenSolaris proto area. Special handling +# for crypto binaries that need to be signed by Sun Release +# Engineering. +# + +usage="bindrop [-n] full-root open-root" + +isa=`uname -p` +if [ $isa = sparc ]; then + isa_short=s +else + isa_short=x +fi + +# +# Netinstall server and path to RE-signed packages (for crypto). +# It might be better to mechanically derive the "Solaris_11" part of +# the path from RELEASE. But it's not clear that such a derivation +# would be reliable. +# +nisrv=${NISRV:-jurassic.eng} +nipath=/net/$nisrv/export/ni-2/nv/${isa_short}/latest/Solaris_11/Product + +# URL to Encryption Kit binaries. +ekurl=http://nana.eng/pub/nv + +PATH="$PATH:/usr/bin:/usr/sfw/bin" + +fail() { + echo $* + exit 1 +} + +[ -n "$SRC" ] || fail "Please set SRC." +[ -n "$CODEMGR_WS" ] || fail "Please set CODEMGR_WS." +[ -d $nipath ] || fail "Can't find RE-signed packages ($nipath)." + +# +# Create the README from boilerplate and the contents of the closed +# binary tree. +# +# usage: mkreadme targetdir +# +mkreadme () { + targetdir=$1 + readme=README.ON-BINARIES.$isa + sed -e s/@ISA@/$isa/ -e s/@DELIVERY@/ON-BINARIES/ \ + $SRC/tools/opensolaris/README.binaries.tmpl > $targetdir/$readme + (cd $targetdir; find $dir -type f -print | \ + sort >> $targetdir/$readme) +} + +nondebug=n +while getopts n flag; do + case $flag in + n) + nondebug=y + ;; + ?) + echo "usage: $usage" + exit 1 + ;; + esac +done +shift $(($OPTIND - 1)) + +[ $# -eq 2 ] || fail "usage: $usage" + +full=$1 +open=$2 + +dir=root_$isa +if [ $nondebug = y ]; then + dir=root_$isa-nd +fi + +[ -d "$full" ] || fail "bindrop: can't find $full." +[ -d "$open" ] || fail "bindrop: can't find $open." + +tmpdir=$(mktemp -dt bindropXXXXX) +[ -n "$tmpdir" ] || fail "Can't create temporary directory." +mkdir -p $tmpdir/closed/$dir || exit 1 + +# +# This will hold a temp list of directories that must be kept, even if +# empty. +# +needdirs=$(mktemp -t needdirsXXXXX) +[ -n "$needdirs" ] || fail "Can't create temporary directory list file." + +# +# Copy the full tree into a temp directory. +# +(cd $full; tar cf - .) | (cd $tmpdir/closed/$dir; tar xpf -) + +# +# Remove internal ON crypto signing certs +# +delete=" + etc/certs/SUNWosnetSE + etc/certs/SUNWosnetSolaris + etc/crypto/certs/SUNWosnet + etc/crypto/certs/SUNWosnetLimited + etc/crypto/certs/SUNWosnetCF + etc/crypto/certs/SUNWosnetCFLimited + " + +# +# Remove miscellaneous files that we don't want to ship. +# + +# SUNWsvvs (SVVS test drivers). +delete="$delete + usr/include/sys/lo.h + usr/include/sys/tidg.h + usr/include/sys/tivc.h + usr/include/sys/tmux.h + usr/kernel/drv/amd64/lo + usr/kernel/drv/amd64/tidg + usr/kernel/drv/amd64/tivc + usr/kernel/drv/amd64/tmux + usr/kernel/drv/lo + usr/kernel/drv/lo.conf + usr/kernel/drv/sparcv9/lo + usr/kernel/drv/sparcv9/tidg + usr/kernel/drv/sparcv9/tivc + usr/kernel/drv/sparcv9/tmux + usr/kernel/drv/tidg + usr/kernel/drv/tidg.conf + usr/kernel/drv/tivc + usr/kernel/drv/tivc.conf + usr/kernel/drv/tmux + usr/kernel/drv/tmux.conf + usr/kernel/strmod/amd64/lmodb + usr/kernel/strmod/amd64/lmode + usr/kernel/strmod/amd64/lmodr + usr/kernel/strmod/amd64/lmodt + usr/kernel/strmod/lmodb + usr/kernel/strmod/lmode + usr/kernel/strmod/lmodr + usr/kernel/strmod/lmodt + usr/kernel/strmod/sparcv9/lmodb + usr/kernel/strmod/sparcv9/lmode + usr/kernel/strmod/sparcv9/lmodr + usr/kernel/strmod/sparcv9/lmodt +" +# encumbered binaries and associated files +delete="$delete + etc/dmi/ + etc/smartcard/ + kernel/drv/amd64/audioens + kernel/drv/amd64/pcn + kernel/drv/audioens + kernel/drv/audioens.conf + kernel/drv/ifp.conf + kernel/drv/pcn + kernel/drv/pcn.conf + kernel/drv/sparcv9/audioens + kernel/drv/sparcv9/ifp + kernel/drv/sparcv9/isp + kernel/drv/spwr + kernel/drv/spwr.conf + kernel/kmdb/sparcv9/isp + kernel/misc/amd64/phx + kernel/misc/phx + kernel/misc/sparcv9/phx + platform/SUNW,Sun-Blade-100/kernel/drv/grppm.conf + platform/SUNW,Sun-Blade-100/kernel/drv/sparcv9/grfans + platform/SUNW,Sun-Blade-100/kernel/drv/sparcv9/grppm + platform/i86pc/kernel/drv/amd64/bmc + platform/i86pc/kernel/drv/bmc + platform/i86pc/kernel/drv/bmc.conf + platform/i86pc/kernel/drv/sbpro + platform/i86pc/kernel/drv/sbpro.conf + platform/sun4u/kernel/drv/sparcv9/scmi2c + platform/sun4u/kernel/misc/sparcv9/i2c_svc + usr/bin/ksh + usr/bin/pfksh + usr/bin/rksh + usr/bin/smartcard + usr/ccs/bin/dis + usr/include/smartcard/ + usr/include/sys/audio/audioens.h + usr/include/sys/phx.h + usr/include/sys/sbpro.h + usr/include/sys/scsi/adapters/ifpcmd.h + usr/include/sys/scsi/adapters/ifpio.h + usr/include/sys/scsi/adapters/ifpmail.h + usr/include/sys/scsi/adapters/ifpreg.h + usr/include/sys/scsi/adapters/ifpvar.h + usr/include/sys/scsi/adapters/ispcmd.h + usr/include/sys/scsi/adapters/ispmail.h + usr/include/sys/scsi/adapters/ispreg.h + usr/include/sys/scsi/adapters/ispvar.h + usr/lib/mdb/disasm/sparc.so + usr/lib/mdb/disasm/sparcv9/sparc.so + usr/lib/mdb/kvm/sparcv9/isp.so + usr/lib/smartcard/ + usr/platform/SUNW,Netra-T12/ + usr/platform/sun4u/include/sys/i2c/clients/scmi2c.h + usr/platform/sun4u/include/sys/i2c/misc/i2c_svc.h + usr/platform/sun4u/include/sys/memtestio.h + usr/platform/sun4u/include/sys/memtestio_ch.h + usr/platform/sun4u/include/sys/memtestio_chp.h + usr/platform/sun4u/include/sys/memtestio_ja.h + usr/platform/sun4u/include/sys/memtestio_jg.h + usr/platform/sun4u/include/sys/memtestio_sf.h + usr/platform/sun4u/include/sys/memtestio_sr.h + usr/platform/sun4u/include/sys/memtestio_u.h + usr/platform/sun4u/include/sys/memtestio_pn.h + usr/platform/sun4v/include/sys/memtestio.h + usr/platform/sun4v/include/sys/memtestio_ni.h + usr/platform/sun4v/include/sys/memtestio_v.h + usr/share/javadoc/smartcard/ + usr/share/lib/smartcard/ +" +# memory fault injector test framework +delete="$delete + usr/bin/mtst + platform/sun4u/kernel/drv/sparcv9/memtest + platform/sun4u/kernel/drv/memtest.conf + platform/sun4v/kernel/drv/sparcv9/memtest + platform/sun4v/kernel/drv/memtest.conf + platform/i86pc/kernel/drv/memtest.conf + platform/i86pc/kernel/drv/memtest + platform/i86pc/kernel/drv/amd64/memtest + usr/platform/i86pc/lib/mtst/mtst_AuthenticAMD_15.so +" +# pci test tool +delete="$delete + usr/share/man/man1m/pcitool.1m + usr/sbin/pcitool +" +for f in $delete; do + rm -rf $tmpdir/closed/$dir/$f +done + +# +# Remove files that the open tree already has. +# +rmfiles=`(cd $open; find . -type f -print -o -type l -print)` +(cd $tmpdir/closed/$dir; rm -f $rmfiles) + +# +# Remove any header files. If they're in the closed tree, they're +# probably not freely redistributable. +# +(cd $tmpdir/closed/$dir; find . -name \*.h -exec rm -f {} \;) + +# +# Remove empty directories that the open tree doesn't need. +# +# Step 1: walk the usr/src/pkgdefs files to find out which directories +# are specified in the open packages; save that list to a temporary +# file $needdirs. +# +(cd $SRC/pkgdefs; \ + find . -name prototype\* -exec grep "^d" {} \; | awk '{print $3}' > \ + $needdirs) +# +# Step 2: go to our closed directory, and find all the subdirectories, +# filtering out the ones needed by the open packages (saved in that +# temporary file). Sort in reverse order, so that parent directories +# come after any subdirectories, and pipe that to rmdir. If there are +# still any lingering files, rmdir will complain. That's fine--we +# only want to delete empty directories--so redirect the complaints to +# /dev/null. +# +(cd $tmpdir/closed/$dir; \ + find * -type d -print | /usr/xpg4/bin/grep -xv -f $needdirs | \ + sort -r | xargs -l rmdir 2>/dev/null ) + +rm $needdirs + +# +# Up above we removed the files that were already in the open tree. +# But that blew away the minimal closed binaries that are needed to do +# an open build, so restore them here. +# + +mkclosed $isa $full $tmpdir/closed/$dir || \ + fail "Can't restore minimal binaries." + +# +# Replace the crypto binaries with ones that have been signed by RE. +# Get these from a local netinstall server. +# + +# List of files to copy, in the form "pkgname file [file ...]" +# common files +cfiles=" + SUNWcsl + usr/lib/security/pkcs11_kernel.so.1 + usr/lib/security/pkcs11_softtoken.so.1 +" +# sparc-only +csfiles=" + SUNWcakr.u + platform/sun4u-us3/kernel/crypto/sparcv9/aes + platform/sun4u/kernel/crypto/sparcv9/arcfour + platform/sun4u/kernel/crypto/sparcv9/des + SUNWckr + kernel/crypto/sparcv9/aes + kernel/crypto/sparcv9/arcfour + kernel/crypto/sparcv9/blowfish + kernel/crypto/sparcv9/des + SUNWcsl + usr/lib/security/sparcv9/pkcs11_kernel.so.1 + usr/lib/security/sparcv9/pkcs11_softtoken.so.1 + SUNWdcar + kernel/drv/sparcv9/dca +" +# x86-only +cxfiles=" + SUNWckr + kernel/crypto/aes + kernel/crypto/arcfour + kernel/crypto/blowfish + kernel/crypto/des + kernel/crypto/amd64/aes + kernel/crypto/amd64/arcfour + kernel/crypto/amd64/blowfish + kernel/crypto/amd64/des + SUNWcsl + usr/lib/security/amd64/pkcs11_kernel.so.1 + usr/lib/security/amd64/pkcs11_softtoken.so.1 + SUNWdcar + kernel/drv/dca + kernel/drv/amd64/dca +" +# These all have hard links from crypto/foo to misc/foo. +linkedfiles=" + platform/sun4u/kernel/crypto/sparcv9/des + kernel/crypto/des + kernel/crypto/amd64/des + kernel/crypto/sparcv9/des +" + +if [ $isa = sparc ]; then + cfiles="$cfiles $csfiles" +else + cfiles="$cfiles $cxfiles" +fi + +# Extract $pkgfiles from $pkg (no-op if they're empty). +pkgextract() +{ + [ -d $nipath/$pkg ] || fail "$nipath/$pkg doesn't exist." + if [[ -n "$pkg" && -n "$pkgfiles" ]]; then + archive=$nipath/$pkg/archive/none.bz2 + bzcat $archive | \ + (cd $tmpdir/closed/$dir; cpio -idum $pkgfiles) + # Doesn't look like we can rely on $? here. + for f in $pkgfiles; do + [ -f $tmpdir/closed/$dir/$f ] || + echo "Warning: can't extract $f from $archive." + done + fi +} + +pkg="" +pkgfiles="" +for cf in $cfiles; do + if [[ $cf = SUNW* ]]; then + pkgextract + pkg=$cf + pkgfiles="" + continue + else + pkgfiles="$pkgfiles $cf" + fi +done +pkgextract # last package in $cfiles + +# Patch up the crypto hard links. +for f in $linkedfiles; do + [ -f $tmpdir/closed/$dir/$f ] || continue + link=`echo $f | sed -e s=crypto=misc=` + (cd $tmpdir/closed/$dir; rm $link; ln $f $link) +done + +# +# Copy over the EK (Encryption Kit) binaries. This is a slightly different +# procedure than the above code for handling the other crypto binaries, as +# SUNWcry & SUNWcryr aren't accessible by NFS. +# We might want to add an option to let the user pick a different +# (e.g., older) Encryption Kit. +# +wgeterrs=/tmp/wget$$ +latest_RE_signed_EK=`wget -O - $ekurl 2>$wgeterrs | \ + nawk -F "\"" \ +'/HREF=\"crypt.nv.crypt_[^m]+\"/ { name = $2 } +END {print name}'` + +if [ -z "$latest_RE_signed_EK" ]; then + echo "Can't find RE-signed Encryption Kit binaries." + echo "wget errors:" + cat $wgeterrs + rm $wgeterrs + exit 1 +fi +rm $wgeterrs + +echo "latest RE signed EK cpio archive: $latest_RE_signed_EK" + +mkdir $tmpdir/EK +(cd $tmpdir/EK; \ + wget -O - $ekurl/$latest_RE_signed_EK 2>/dev/null | cpio -idum) + +cfiles=" + SUNWcry + usr/bin/des + usr/lib/security/pkcs11_softtoken_extra.so.1 +" +cxfiles=" + SUNWcry + usr/lib/security/amd64/pkcs11_softtoken_extra.so.1 + SUNWcryr + kernel/crypto/aes256 + kernel/crypto/arcfour2048 + kernel/crypto/blowfish448 + kernel/crypto/amd64/aes256 + kernel/crypto/amd64/arcfour2048 + kernel/crypto/amd64/blowfish448 +" +csfiles=" + SUNWcry + usr/lib/security/sparcv9/pkcs11_softtoken_extra.so.1 + SUNWcryr + kernel/crypto/sparcv9/aes256 + kernel/crypto/sparcv9/arcfour2048 + kernel/crypto/sparcv9/blowfish448 + platform/sun4u-us3/kernel/crypto/sparcv9/aes256 + platform/sun4u/kernel/crypto/sparcv9/arcfour2048 + platform/sun4v/kernel/crypto/sparcv9/arcfour2048 +" + +if [ $isa = sparc ]; then + cfiles="$cfiles $csfiles" +else + cfiles="$cfiles $cxfiles" +fi + +nipath="$tmpdir/EK/Encryption_11/$isa/Packages" +pkg="" +pkgfiles="" +for cf in $cfiles; do + if [[ $cf = SUNW* ]]; then + pkgextract + pkg=$cf + pkgfiles="" + continue + else + pkgfiles="$pkgfiles $cf" + fi +done +pkgextract # last package in $cfiles + +# +# Add binary license files. +# + +cp -p $SRC/tools/opensolaris/BINARYLICENSE.txt $tmpdir/closed || \ + fail "Can't add BINARYLICENSE.txt" +mkreadme $tmpdir/closed +cp -p $CODEMGR_WS/THIRDPARTYLICENSE.ON-BINARIES $tmpdir/closed || \ + fail "Can't add THIRDPARTYLICENSE.BFU-ARCHIVES." + +tarfile=on-closed-bins.$isa.tar +if [ $nondebug = y ] ; then + tarfile=on-closed-bins-nd.$isa.tar +fi +tarfile=$CODEMGR_WS/$tarfile +(cd $tmpdir; tar cf $tarfile closed) || fail "Can't create $tarfile." +bzip2 -f $tarfile || fail "Can't compress $tarfile". + +rm -rf $tmpdir diff --git a/usr/src/tools/scripts/bldenv.1 b/usr/src/tools/scripts/bldenv.1 index 3fe6c277ea..14e50feea2 100644 --- a/usr/src/tools/scripts/bldenv.1 +++ b/usr/src/tools/scripts/bldenv.1 @@ -18,10 +18,10 @@ .\" " .\" " CDDL HEADER END .\" " -.\" "Copyright 2006 Sun Microsystems, Inc." +.\" "Copyright 2007 Sun Microsystems, Inc." .\" "All rights reserved" .\" "Use is subject to license terms." -.TH bldenv 1 "19 Sep 2006" +.TH bldenv 1 "21 Mar 2007" .SH NAME .I bldenv \- spawn shell for interactive incremental OS-Net consolidation builds @@ -52,6 +52,18 @@ appropriately. is particularly useful for testing Makefile targets like clobber, install and _msg, which otherwise require digging through large build logs to figure out what is being done. +.LP +.I bldenv +is also useful if you run into build issues with +the source product or when generating OpenSolaris deliverables. If a +source product build is flagged, the environment is set up for +building the indicated source product tree, which is assumed to have +already been created. If the OpenSolaris deliverables flag +(\fB\-O\fR) is set in NIGHTLY_OPTIONS, the environment is set up for +building just the open source. This includes using an alternate proto +area, as well as using the closed binaries in +$CODEMGR_WS/closed.skel (which is assumed to already exist). +.LP By default, bldenv will invoke the shell specified in $SHELL. If $SHELL isn't set or is invalid, csh will be used. .SH OPTIONS @@ -142,3 +154,7 @@ to create SUNWonbld with a single command: .PD 0 .LP example% bldenv onnv_06 'cd $SRC/tools && make pkg' +.PD +.LP +.SH SEE ALSO +.BR nightly (1) diff --git a/usr/src/tools/scripts/bldenv.sh b/usr/src/tools/scripts/bldenv.sh index 20f8a19354..af8d1cbd71 100644 --- a/usr/src/tools/scripts/bldenv.sh +++ b/usr/src/tools/scripts/bldenv.sh @@ -19,8 +19,9 @@ # # CDDL HEADER END # + # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -46,6 +47,7 @@ Where: c_FLAG=n f_FLAG=n d_FLAG=n +O_FLAG=n o_FLAG=n t_FLAG=n SE_FLAG=n @@ -163,16 +165,18 @@ shift # must match the getopts in nightly.sh OPTIND=1 NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-} -while getopts ABDFMNCGIRafinlmoptuUxdrtwzWS:X FLAG $NIGHTLY_OPTIONS +while getopts AaBCDdFfGIilMmNnOopRrS:tUuWwXxz FLAG $NIGHTLY_OPTIONS do case $FLAG in + O) O_FLAG=y + ;; + o) o_FLAG=y + ;; t ) t_FLAG=y ;; S ) set_S_flag $OPTARG ;; - o) o_FLAG=y - ;; *) ;; esac done @@ -193,6 +197,15 @@ else unset EXTRA_CFLAGS fi +if [ $O_FLAG = "y" ]; then + export MULTI_PROTO=yes + if [ "$CLOSED_IS_PRESENT" = "yes" ]; then + echo "CLOSED_IS_PRESENT is 'no' (because of '-O')" + fi + export CLOSED_IS_PRESENT=no + export ON_CLOSED_BINS=$CODEMGR_WS/closed.skel +fi + # update build-type variables CPIODIR=${CPIODIR}${SUFFIX} PKGARCHIVE=${PKGARCHIVE}${SUFFIX} @@ -225,12 +238,6 @@ if [ "${SUNWSPRO}" != "" ]; then export PATH fi -if [[ "$SO_FLAG" = "y" && "$CLOSED_IS_PRESENT" = "yes" ]]; then - echo "CLOSED_IS_PRESENT is 'no' (because of '-S O')" - CLOSED_IS_PRESENT=no - export CLOSED_IS_PRESENT -fi - if [ -z "$CLOSED_IS_PRESENT" ]; then if [ -d $SRC/../closed ]; then CLOSED_IS_PRESENT="yes" @@ -291,6 +298,16 @@ ENVCPPFLAGS3= ENVCPPFLAGS4= PARENT_ROOT= +[ "$O_FLAG" = "y" ] && export ROOT=$ROOT-open + +if [ "$MULTI_PROTO" != "yes" -a "$MULTI_PROTO" != "no" ]; then + echo "WARNING: invalid value for MULTI_PROTO ($MULTI_PROTO);" \ + "setting to \"no\"." + export MULTI_PROTO=no +fi + +[ "$MULTI_PROTO" = "yes" ] && export ROOT=$ROOT$SUFFIX + ENVLDLIBS1="-L$ROOT/lib -L$ROOT/usr/lib" ENVCPPFLAGS1="-I$ROOT/usr/include" MAKEFLAGS=e diff --git a/usr/src/tools/scripts/checkpaths.sh b/usr/src/tools/scripts/checkpaths.sh index 723ee14219..0ec887157d 100644 --- a/usr/src/tools/scripts/checkpaths.sh +++ b/usr/src/tools/scripts/checkpaths.sh @@ -19,8 +19,9 @@ # # CDDL HEADER END # + # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" @@ -67,8 +68,12 @@ fi for ROOT in $rootlist do case "$ROOT" in - *sparc) arch=sparc;; - *i386) arch=i386;; + *sparc|*sparc-nd) + arch=sparc + ;; + *i386|*i386-nd) + arch=i386 + ;; *) echo "$ROOT has unknown architecture." >&2 exit 1 diff --git a/usr/src/tools/scripts/mkclosed.sh b/usr/src/tools/scripts/mkclosed.sh index a30c511a94..55f1f82e4f 100644 --- a/usr/src/tools/scripts/mkclosed.sh +++ b/usr/src/tools/scripts/mkclosed.sh @@ -21,7 +21,7 @@ # # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -32,7 +32,7 @@ # when building just the open tree. # -usage="mkclosed isa proto closed" +usage="mkclosed isa root closed-root" if [ $# -ne 3 ]; then print -u2 "usage: $usage" @@ -48,8 +48,8 @@ sparc) plat64=sparcv9;; ;; esac -protoroot=$2/root_$isa -closedroot=$3/root_$isa +protoroot=$2 +closedroot=$3 # # Make closedroot an absolute path if it isn't already. This is diff --git a/usr/src/tools/scripts/mkreadme_osol.pl b/usr/src/tools/scripts/mkreadme_osol.pl new file mode 100644 index 0000000000..cc0dfd07c8 --- /dev/null +++ b/usr/src/tools/scripts/mkreadme_osol.pl @@ -0,0 +1,97 @@ +#! /usr/perl5/bin/perl +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# Generate README.opensolaris from a template for inclusion in a +# delivery wad. +# Usage: mkreadme_osol README.opensolaris < template +# + +use strict; +use warnings; + +# +# Timeout and retry settings for wget. Allow one retry for the +# occasional glitch, but don't wait longer than 5 minutes (so as not +# to hold up the build). +# +my $timeout = 150; +my $tries = 2; + +# +# Markers in the web pages that we download. +# +my $begin_data = qr/<!-- begin_data --><pre>/; +my $end_data = qr/<\/pre><!-- end_data -->/; + +my $readme_fn = shift || die "missing README filepath\n"; +open(README_OUT, ">$readme_fn") || die "couldn't open $readme_fn\n"; +my @lines = <STDIN>; + +my %content; + +if (! $ENV{"HTTP_PROXY"}) { + if ($ENV{"http_proxy"}) { + $ENV{"HTTP_PROXY"} = $ENV{"http_proxy"}; + } else { + $ENV{"HTTP_PROXY"} = "http://webcache.sfbay:8080"; + } +} +if (! $ENV{"http_proxy"}) { + $ENV{"http_proxy"} = $ENV{"HTTP_PROXY"}; +} + +foreach (@lines) { + chomp; + if (/^<!-- #include (.+) -->$/) { + my $url = $1; + print "Getting $url\n"; + $content{$url} = + `/usr/sfw/bin/wget -q -O - -T $timeout -t $tries $url`; + if (! $content{$url}) { + die "$url: invalid or empty URI.\n"; + } + $content{$url} =~ s/\r//g; + my @c = split /\n/, $content{$url}; + while ((my $l = shift @c) !~ /$begin_data/) {}; + while ((pop @c) !~ /$end_data/) {}; + $content{$url} = join "\n", @c; + } +} + +foreach (@lines) { + if (/^<!-- #include (.+) -->$/ && exists($content{$1})) { + print README_OUT $content{$1}; + } else { + print README_OUT "$_\n"; + } +} + +print README_OUT "\n\n"; +close(README_OUT); diff --git a/usr/src/tools/scripts/mktpl.pl b/usr/src/tools/scripts/mktpl.pl new file mode 100644 index 0000000000..2515aeb2f0 --- /dev/null +++ b/usr/src/tools/scripts/mktpl.pl @@ -0,0 +1,129 @@ +#! /usr/bin/perl -w +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# Create THIRDPARTYLICENSE files using the index file in $CODEMGR_WS. +# + +use Cwd; +use Env; +use strict; + +my $usage = "mktpl license-list-file"; + +my $top = $ENV{"CODEMGR_WS"}; +if (! $top) { + die "CODEMGR_WS must be set.\n"; +} + +if (@ARGV != 1) { + die "usage: $usage\n"; +} + +my $indexfile = $ARGV[0]; + +my $exitstatus = 0; + +# create a THIRDPARTYLICENSE file from the given license list and suffix. +sub maketpl { + my ($suffix, @tpllist) = @_; + my $licnum = 1; + my $tplname = "$top/THIRDPARTYLICENSE.$suffix"; + + open(TPL, ">$tplname") or die "Can't create $tplname: $!\n"; + + print TPL "DO NOT TRANSLATE OR LOCALIZE.\n\n"; + + foreach my $licfile (@tpllist) { + my $descrip = `cat "$licfile.descrip"`; + if (! $descrip) { + warn "Missing description for $licfile\n"; + $exitstatus = 1; + $descrip = "(MISSING DESCRIPTION for $licfile)\n"; + } + print TPL "$licnum) The following software may be included ", + "in this product:\n\n"; + print TPL "\t$descrip\n"; + print TPL " Use of this software is governed by the ", + "terms of the following license:\n"; + print TPL "\n"; + if (open(LIC, "<$licfile")) { + while (<LIC>) { + print TPL " " . $_; + } + close LIC; + } else { + warn "Can't open $licfile: $!\n"; + $exitstatus = 1; + print TPL " (MISSING LICENSE: $licfile)\n"; + } + print TPL "\n"; + $licnum++; + } + + close TPL or die "I/O error on $tplname: $!\n"; +} + +# +# Make file list for each TPL file. +# + +chdir($top) or die "Can't chdir to $top: $!\n"; +$top = getcwd(); + +my $isclosed = qr"^usr/closed"; +my $istools = qr"^usr/src/tools"; + +my @closedlist; +my @toolslist; +my @bfulist; + +open(IX, "<$indexfile") or die "Can't open $indexfile: $!\n"; +while (<IX>) { + chomp; + if (/$isclosed/) { + push @closedlist, $_; + } + if (/$istools/) { + push @toolslist, $_; + } else { + push @bfulist, $_; + } +} +close IX; + +# +# Generate each TPL file. +# + +maketpl("ON-BINARIES", @closedlist) if (@closedlist); +maketpl("ON-BUILD-TOOLS", @toolslist) if (@toolslist); +maketpl("BFU-ARCHIVES", @bfulist) if (@bfulist); + +exit $exitstatus; diff --git a/usr/src/tools/scripts/nightly.1 b/usr/src/tools/scripts/nightly.1 index 7e3a3d7f50..4c6565c715 100644 --- a/usr/src/tools/scripts/nightly.1 +++ b/usr/src/tools/scripts/nightly.1 @@ -18,9 +18,9 @@ .\" " .\" " CDDL HEADER END .\" " -.\" "Copyright 2006 Sun Microsystems, Inc. All rights reserved." +.\" "Copyright 2007 Sun Microsystems, Inc. All rights reserved." .\" "Use is subject to license terms." -.TH nightly 1 "12 Oct 2006" +.TH nightly 1 "21 Mar 2007" .SH NAME .I nightly \- build an OS-Net consolidation overnight @@ -235,6 +235,12 @@ a time. .LP .B Miscellaneous options .TP 10 +.B \-O +generate deliverables for OpenSolaris. Tarballs containing +a source snapshot, +binaries of closed-source components, compiled ON tools (SUNWonbld), +and BFU archives are put in $CODEMGR_WS. +.TP 10 .B \-V VERS set the build version string to VERS, overriding VERSION .TP @@ -288,7 +294,15 @@ in terms of $CODEMGR_WS Root of the proto area for the build. The makefiles direct the installation of header files and libraries to this area and direct references to these files by builds of commands and other -targets. It should be expressed in terms of $CODEMGR_WS +targets. It should be expressed in terms of $CODEMGR_WS. +.LP +If $MULTI_PROTO is "no", $ROOT may contain a DEBUG or non-DEBUG +build. If $MULTI_PROTO is "yes", $ROOT contains the DEBUG build and +$ROOT-nd contains the non-DEBUG build. +.LP +For OpenSolaris deliveries (\fB\-O\fR), $ROOT-open contains the DEBUG +build of just the open source tree, and $ROOT-open-nd contains the +non-DEBUG build. .LP .RE .B MACH @@ -506,6 +520,17 @@ available, although these are not stable, and should be checked before use. The command output will be appended to the mail message and log file. .RE .LP +.B MULTI_PROTO +.RS 5 +If "no" (the default), +.I nightly +will reuse $ROOT for both the DEBUG and non-DEBUG builds. If "yes", +the DEBUG build will go in $ROOT and the non-DEBUG build will go in +$ROOT-nd. Other values will be treated as "no". Use of the +.B \-O +flag forces MULTI_PROTO to "yes". +.RE +.LP .SH REALMODE ENVIRONMENT VARIABLES .LP The following environment variables referenced by @@ -566,4 +591,7 @@ NIGHTLY_OPTIONS="-ACrlapDm" export NIGHTLY_OPTIONS .LP # /opt/onbld/bin/nightly -i myenv +.PD .LP +.SH SEE ALSO +.BR bldenv (1) diff --git a/usr/src/tools/scripts/nightly.sh b/usr/src/tools/scripts/nightly.sh index 182ec2787d..96f674e1e1 100644 --- a/usr/src/tools/scripts/nightly.sh +++ b/usr/src/tools/scripts/nightly.sh @@ -19,6 +19,7 @@ # # CDDL HEADER END # + # # Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -33,7 +34,7 @@ # The default is the old behavior of CLONE_WS # # -i on the command line, means fast options, so when it's on the -# command line (only), lint and check builds are skipped no matter what +# command line (only), lint and check builds are skipped no matter what # the setting of their individual flags are in NIGHTLY_OPTIONS. # # LINTDIRS can be set in the env file, format is a list of: @@ -58,30 +59,61 @@ # unset CDPATH -# function to do a DEBUG and non-DEBUG build. Needed because we might +# +# Print the tag string used to identify a build (e.g., "DEBUG +# open-only") +# usage: tagstring debug-part open-part +# +tagstring() { + debug_part=$1 + open_part=$2 + + if [ -n "$open_part" ]; then + echo "$debug_part $open_part" + else + echo "$debug_part" + fi +} + +# +# Function to do a DEBUG and non-DEBUG build. Needed because we might # need to do another for the source build, and since we only deliver DEBUG or # non-DEBUG packages. +# +# usage: normal_build [-O] +# -O OpenSolaris delivery build. Put the proto area, BFU archives, +# and packages in -open directories. Use skeleton closed +# binaries. Skip the package build (until 6414822 is fixed). +# normal_build() { - # timestamp the start of a nightly build; the findunref tool uses it. - touch $SRC/.build.tstamp + orig_p_FLAG=$p_FLAG + + suffix="" + open_only="" + while getopts O FLAG $*; do + case $FLAG in + O) + suffix="-open" + open_only="open-only" + p_FLAG=n + ;; + esac + done # non-DEBUG build begins if [ "$F_FLAG" = "n" ]; then - export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= - export RELEASE_BUILD ; RELEASE_BUILD= - unset EXTRA_OPTIONS - unset EXTRA_CFLAGS - - build non-DEBUG -nd - - if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a "$p_FLAG" = "y" ]; then + set_non_debug_build_flags + mytag=`tagstring "non-DEBUG" "$open_only"` + build "$mytag" "$suffix-nd" $MULTI_PROTO + if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \ + "$p_FLAG" = "y" ]; then copy_ihv_pkgs non-DEBUG -nd fi else - echo "\n==== No non-DEBUG build ====\n" >> $LOGFILE + echo "\n==== No non-DEBUG $open_only build ====\n" >> $LOGFILE fi # non-DEBUG build ends @@ -89,23 +121,21 @@ normal_build() { # DEBUG build begins if [ "$D_FLAG" = "y" ]; then - - export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= - unset RELEASE_BUILD - unset EXTRA_OPTIONS - unset EXTRA_CFLAGS - - build DEBUG "" - - if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a "$p_FLAG" = "y" ]; then + set_debug_build_flags + mytag=`tagstring "DEBUG" "$open_only"` + build "$mytag" "$suffix" $MULTI_PROTO + if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a \ + "$p_FLAG" = "y" ]; then copy_ihv_pkgs DEBUG "" fi else - echo "\n==== No DEBUG build ====\n" >> $LOGFILE + echo "\n==== No DEBUG $open_only build ====\n" >> $LOGFILE fi # DEBUG build ends + + p_FLAG=$orig_p_FLAG } # @@ -305,12 +335,28 @@ set_up_source_build() { } -# function to do the build. -# usage: build LABEL SUFFIX +# Return library search directive as function of given root. +myldlibs() { + echo "-L$1/lib -L$1/usr/lib" +} + +# Return header search directive as function of given root. +myheaders() { + echo "-I$1/usr/include" +} +# +# Function to do the build, including cpio archive and package generation. +# usage: build LABEL SUFFIX MULTIPROTO +# - LABEL is used to tag build output. +# - SUFFIX is used to distinguish files (e.g., debug vs non-debug). +# - If MULTIPROTO is "yes", it means to name the proto area according to +# SUFFIX. Otherwise ("no"), (re)use the standard proto area. +# build() { LABEL=$1 SUFFIX=$2 + MULTIPROTO=$3 INSTALLOG=install${SUFFIX}-${MACH} NOISE=noise${SUFFIX}-${MACH} CPIODIR=${CPIODIR_ORIG}${SUFFIX} @@ -319,6 +365,12 @@ build() { SPARC_RM_PKGARCHIVE=${SPARC_RM_PKGARCHIVE_ORIG}${SUFFIX} fi + ORIGROOT=$ROOT + [ $MULTIPROTO = no ] || export ROOT=$ROOT$SUFFIX + + export ENVLDLIBS1=`myldlibs $ROOT` + export ENVCPPFLAGS1=`myheaders $ROOT` + this_build_ok=y # # Build OS-Networking source @@ -516,6 +568,8 @@ build() { else echo "\n==== Not creating $LABEL packages ====\n" >> $LOGFILE fi + + ROOT=$ORIGROOT } # Usage: dolint /dir y|n @@ -536,11 +590,10 @@ dolint() { base=`basename $lintdir` LINTOUT=$lintdir/lint-${MACH}.out LINTNOISE=$lintdir/lint-noise-${MACH} + export ENVLDLIBS1=`myldlibs $ROOT` + export ENVCPPFLAGS1=`myheaders $ROOT` - export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= - unset RELEASE_BUILD - unset EXTRA_OPTIONS - unset EXTRA_CFLAGS + set_debug_build_flags # # '$MAKE lint' in $lintdir @@ -619,6 +672,26 @@ copy_ihv_proto() { else echo "$IA32_IHV_ROOT: not found" >> $LOGFILE fi + + if [ "$MULTI_PROTO" = yes ]; then + if [ ! -d "$ROOT-nd" ]; then + echo "mkdir -p $ROOT-nd" >> $LOGFILE + mkdir -p $ROOT-nd + fi + # If there's a non-debug version of the IHV proto area, + # copy it, but copy something if there's not. + if [ -d "$IA32_IHV_ROOT-nd" ]; then + echo "copying $IA32_IHV_ROOT-nd to $ROOT-nd\n" >> $LOGFILE + cd $IA32_IHV_ROOT-nd + elif [ -d "$IA32_IHV_ROOT" ]; then + echo "copying $IA32_IHV_ROOT to $ROOT-nd\n" >> $LOGFILE + cd $IA32_IHV_ROOT + else + echo "$IA32_IHV_ROOT{-nd,}: not found" >> $LOGFILE + return + fi + tar -cf - . | (cd $ROOT-nd; umask 0; tar xpf - ) 2>&1 >> $LOGFILE + fi } # Install IHV packages in PKGARCHIVE @@ -651,7 +724,13 @@ copy_ihv_pkgs() { fi } +# +# Build and install the onbld tools. +# # usage: build_tools DESTROOT +# +# returns non-zero status if the build was successful. +# build_tools() { DESTROOT=$1 @@ -671,45 +750,54 @@ build_tools() { egrep -e "(${MAKE}:|[ ]error[: \n])" | \ egrep -v "Ignoring unknown host" | \ egrep -v warning >> $mail_msg_file - if [ "$?" != "0" ]; then - STABS=${DESTROOT}/opt/onbld/bin/${MACH}/stabs - export STABS - CTFSTABS=${DESTROOT}/opt/onbld/bin/${MACH}/ctfstabs - export CTFSTABS - GENOFFSETS=${DESTROOT}/opt/onbld/bin/genoffsets - export GENOFFSETS - - CTFCONVERT=${DESTROOT}/opt/onbld/bin/${MACH}/ctfconvert - export CTFCONVERT - CTFMERGE=${DESTROOT}/opt/onbld/bin/${MACH}/ctfmerge - export CTFMERGE - - CTFCVTPTBL=${DESTROOT}/opt/onbld/bin/ctfcvtptbl - export CTFCVTPTBL - CTFFINDMOD=${DESTROOT}/opt/onbld/bin/ctffindmod - export CTFFINDMOD - - if [ "$VERIFY_ELFSIGN" = "y" ]; then - ELFSIGN=${DESTROOT}/opt/onbld/bin/elfsigncmp - else - ELFSIGN=${DESTROOT}/opt/onbld/bin/${MACH}/elfsign - fi - export ELFSIGN - - PATH="${DESTROOT}/opt/onbld/bin/${MACH}:${PATH}" - PATH="${DESTROOT}/opt/onbld/bin:${PATH}" - export PATH - - echo "\n==== New environment settings. ====\n" >> $LOGFILE - echo "STABS=${STABS}" >> $LOGFILE - echo "CTFSTABS=${CTFSTABS}" >> $LOGFILE - echo "CTFCONVERT=${CTFCONVERT}" >> $LOGFILE - echo "CTFMERGE=${CTFMERGE}" >> $LOGFILE - echo "CTFCVTPTBL=${CTFCVTPTBL}" >> $LOGFILE - echo "CTFFINDMOD=${CTFFINDMOD}" >> $LOGFILE - echo "ELFSIGN=${ELFSIGN}" >> $LOGFILE - echo "PATH=${PATH}" >> $LOGFILE + return $? +} + +# +# Set up to use locally installed tools. +# +# usage: use_tools TOOLSROOT +# +use_tools() { + TOOLSROOT=$1 + + STABS=${TOOLSROOT}/opt/onbld/bin/${MACH}/stabs + export STABS + CTFSTABS=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfstabs + export CTFSTABS + GENOFFSETS=${TOOLSROOT}/opt/onbld/bin/genoffsets + export GENOFFSETS + + CTFCONVERT=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfconvert + export CTFCONVERT + CTFMERGE=${TOOLSROOT}/opt/onbld/bin/${MACH}/ctfmerge + export CTFMERGE + + CTFCVTPTBL=${TOOLSROOT}/opt/onbld/bin/ctfcvtptbl + export CTFCVTPTBL + CTFFINDMOD=${TOOLSROOT}/opt/onbld/bin/ctffindmod + export CTFFINDMOD + + if [ "$VERIFY_ELFSIGN" = "y" ]; then + ELFSIGN=${TOOLSROOT}/opt/onbld/bin/elfsigncmp + else + ELFSIGN=${TOOLSROOT}/opt/onbld/bin/${MACH}/elfsign fi + export ELFSIGN + + PATH="${TOOLSROOT}/opt/onbld/bin/${MACH}:${PATH}" + PATH="${TOOLSROOT}/opt/onbld/bin:${PATH}" + export PATH + + echo "\n==== New environment settings. ====\n" >> $LOGFILE + echo "STABS=${STABS}" >> $LOGFILE + echo "CTFSTABS=${CTFSTABS}" >> $LOGFILE + echo "CTFCONVERT=${CTFCONVERT}" >> $LOGFILE + echo "CTFMERGE=${CTFMERGE}" >> $LOGFILE + echo "CTFCVTPTBL=${CTFCVTPTBL}" >> $LOGFILE + echo "CTFFINDMOD=${CTFFINDMOD}" >> $LOGFILE + echo "ELFSIGN=${ELFSIGN}" >> $LOGFILE + echo "PATH=${PATH}" >> $LOGFILE } staffer() { @@ -757,6 +845,44 @@ obsolete_build() { echo "WARNING: Obsolete $1 build requested; request will be ignored" } +# +# wrapper over wsdiff. +# usage: do_wsdiff LABEL OLDPROTO NEWPROTO +# +do_wsdiff() { + label=$1 + oldproto=$2 + newproto=$3 + + echo "\n==== Objects that differ since last build ($label) ====\n" | \ + tee -a $LOGFILE >> $mail_msg_file + + wsdiff="wsdiff" + [ "$t_FLAG" = y ] && wsdiff="wsdiff -t" + + $wsdiff -r ${TMPDIR}/wsdiff.results $oldproto $newproto 2>&1 | \ + tee -a $LOGFILE >> $mail_msg_file +} + +# +# Functions for setting build flags (debug/non-debug). Keep them +# together. +# + +set_non_debug_build_flags() { + export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= + export RELEASE_BUILD ; RELEASE_BUILD= + unset EXTRA_OPTIONS + unset EXTRA_CFLAGS +} + +set_debug_build_flags() { + export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= + unset RELEASE_BUILD + unset EXTRA_OPTIONS + unset EXTRA_CFLAGS +} + MACH=`uname -p` @@ -797,6 +923,7 @@ NIGHTLY_OPTIONS variable in the <env_file> as follows: -I integration engineer default group of options (-ampu) -M do not run pmodes (safe file permission checker) -N do not run protocmp + -O generate OpenSolaris deliverables -R default group of options for building a release (-mp) -U update proto area in the parent -V VERS set the build version string to VERS @@ -843,6 +970,7 @@ M_FLAG=n m_FLAG=n N_FLAG=n n_FLAG=n +O_FLAG=n o_FLAG=n P_FLAG=n p_FLAG=n @@ -1047,7 +1175,7 @@ check_closed_tree # NIGHTLY_OPTIONS=-${NIGHTLY_OPTIONS#-} OPTIND=1 -while getopts AaBCDdFfGIilMmNnoPpRrS:TtUuWwXxz FLAG $NIGHTLY_OPTIONS +while getopts AaBCDdFfGIilMmNnOoPpRrS:TtUuWwXxz FLAG $NIGHTLY_OPTIONS do case $FLAG in A ) A_FLAG=y @@ -1084,6 +1212,8 @@ do ;; n ) n_FLAG=y ;; + O ) O_FLAG=y + ;; o ) o_FLAG=y ;; P ) P_FLAG=y @@ -1354,11 +1484,6 @@ PARENT_ROOT= export ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \ PARENT_ROOT -ENVLDLIBS1="-L$ROOT/lib -L$ROOT/usr/lib" -ENVCPPFLAGS1="-I$ROOT/usr/include" - -export ENVLDLIBS1 ENVLDLIBS2 - CPIODIR_ORIG=$CPIODIR PKGARCHIVE_ORIG=$PKGARCHIVE IA32_IHV_PKGS_ORIG=$IA32_IHV_PKGS @@ -1386,6 +1511,10 @@ logshuffle() { if [ -f $TMPDIR/wsdiff.results ]; then mv $TMPDIR/wsdiff.results $LLOG fi + + if [ -f $TMPDIR/wsdiff-nd.results ]; then + mv $TMPDIR/wsdiff-nd.results $LLOG + fi fi # @@ -1506,6 +1635,24 @@ create_lock() { staffer sh -c "echo $hostname $STAFFER $$ > $lockf" || exit 1 } +# +# Return the list of interesting proto areas, depending on the current +# options. +# +allprotos() { + roots="$ROOT" + if [ $O_FLAG = y ]; then + # OpenSolaris deliveries require separate proto areas. + [ $D_FLAG = y ] && roots="$roots $ROOT-open" + [ $F_FLAG = n ] && roots="$roots $ROOT-open-nd" + fi + if [[ $D_FLAG = y && $F_FLAG = n ]]; then + [ $MULTI_PROTO = yes ] && roots="$roots $ROOT-nd" + fi + + echo $roots +} + # Ensure no other instance of this script is running on this host. # LOCKNAME can be set in <env_file>, and is by default, but is not # required due to the use of $ATLOG below. @@ -1613,15 +1760,28 @@ EOF fi fi +if [ "$O_FLAG" = "y" -a "$a_FLAG" = "n" ]; then + echo "WARNING: OpenSolaris deliveries (-O) require archives;" \ + "enabling the -a flag." | tee -a $mail_msg_file >> $LOGFILE + a_FLAG=y +fi + if [ "$a_FLAG" = "y" -a "$D_FLAG" = "n" -a "$F_FLAG" = "y" ]; then echo "WARNING: Neither DEBUG nor non-DEBUG build requested, but the" \ "'a' option was set." | tee -a $mail_msg_file >> $LOGFILE fi if [ "$D_FLAG" = "n" -a "$l_FLAG" = "y" ]; then - echo "WARNING: DEBUG build not requested, but lint will be with" \ - "DEBUG enabled.\n" \ + # + # In the past we just complained but went ahead with the lint + # pass, even though the proto area was built non-debug. It's + # unlikely that non-debug headers will make a difference, but + # rather than assuming it's a safe combination, force the user + # to specify a debug build. + # + echo "WARNING: DEBUG build not requested; disabling lint.\n" \ | tee -a $mail_msg_file >> $LOGFILE + l_FLAG=n fi if [ "$f_FLAG" = "y" ]; then @@ -1638,7 +1798,7 @@ if [ "$f_FLAG" = "y" ]; then fi if [ "$w_FLAG" = "y" -a ! -d $ROOT ]; then - echo "WARNING: -w specified, but no pre-existing proto area found;" \ + echo "WARNING: -w specified, but $ROOT does not exist;" \ "ignoring -w\n" | tee -a $mail_msg_file >> $LOGFILE w_FLAG=n fi @@ -1664,6 +1824,19 @@ if [ "$t_FLAG" = "n" ]; then fi fi +[ "$O_FLAG" = y ] && MULTI_PROTO=yes + +case $MULTI_PROTO in +yes|no) ;; +*) + echo "WARNING: MULTI_PROTO is \"$MULTI_PROTO\"; " \ + "should be \"yes\" or \"no\"." | tee -a $mail_msg_file >> $LOGFILE + echo "Setting MULTI_PROTO to \"no\".\n" | \ + tee -a $mail_msg_file >> $LOGFILE + export MULTI_PROTO=no + ;; +esac + echo "==== Build environment ====\n" | tee -a $mail_msg_file >> $LOGFILE # System @@ -1750,6 +1923,14 @@ if [ "$w_FLAG" = "y" -a -d "$ROOT" ]; then mv $ROOT $ROOT.prev fi +# Same for non-DEBUG proto area +if [ "$w_FLAG" = "y" -a "$MULTI_PROTO" = yes -a -d "$ROOT-nd" ]; then + if [ -d "$ROOT-nd.prev" ]; then + rm -rf $ROOT-nd.prev + fi + mv $ROOT-nd $ROOT-nd.prev +fi + # # Decide whether to clobber # @@ -1772,7 +1953,7 @@ if [ "$i_FLAG" = "n" -a -d "$SRC" ]; then egrep -v "Ignoring unknown host" \ >> $mail_msg_file - if [ "$t_FLAG" = "y" ]; then + if [[ "$t_FLAG" = "y" || "$O_FLAG" = "y" ]]; then echo "\n==== Make tools clobber at `date` ====\n" >> $LOGFILE cd ${TOOLS} rm -f ${TOOLS}/clobber-${MACH}.out @@ -1786,7 +1967,7 @@ if [ "$i_FLAG" = "n" -a -d "$SRC" ]; then mkdir -p ${TOOLS_PROTO} fi - rm -rf $ROOT + rm -rf `allprotos` # Get back to a clean workspace as much as possible to catch # problems that only occur on fresh workspaces. @@ -1848,16 +2029,17 @@ else fi # -# Build tools if requested +# Build and use the workspace's tools if requested # -if [ "$t_FLAG" = "y" ]; then - export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= - export RELEASE_BUILD ; RELEASE_BUILD= - unset EXTRA_OPTIONS - unset EXTRA_CFLAGS +if [[ "$t_FLAG" = "y" || "$O_FLAG" = y ]]; then + set_non_debug_build_flags - export ONBLD_TOOLS=${ONBLD_TOOLS:=${TOOLS_PROTO}/opt/onbld} build_tools ${TOOLS_PROTO} + + if [[ $? -ne 0 && "$t_FLAG" = y ]]; then + use_tools $TOOLS_PROTO + export ONBLD_TOOLS=${ONBLD_TOOLS:=${TOOLS_PROTO}/opt/onbld} + fi fi # @@ -1871,15 +2053,131 @@ if [ "$i_FLAG" = "y" -a "$SH_FLAG" = "y" ]; then echo "\n==== NOT Building base OS-Net source ====\n" | \ tee -a $LOGFILE >> $mail_msg_file else + # timestamp the start of the normal build; the findunref tool uses it. + touch $SRC/.build.tstamp + normal_build fi +# +# Generate OpenSolaris deliverables if requested. +# +if [ "$O_FLAG" = y -a "$build_ok" = y ]; then + # + # Generate skeleton (minimal) closed binaries for open-only + # build. There's no need to distinguish debug from non-debug + # binaries, but it simplifies file management to have separate + # trees. + # + + echo "\n==== Generating skeleton closed binaries for" \ + "open-only build ====\n" | \ + tee -a $LOGFILE >> $mail_msg_file + + rm -rf $CODEMGR_WS/closed.skel + if [ "$D_FLAG" = y ]; then + mkclosed $MACH $ROOT $CODEMGR_WS/closed.skel/root_$MACH \ + >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create skeleton DEBUG closed binaries." | + tee -a $mail_msg_file >> $LOGFILE + fi + fi + if [ "$F_FLAG" = n ]; then + mkclosed $MACH $ROOT-nd $CODEMGR_WS/closed.skel/root_$MACH-nd \ + >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create skeleton non-DEBUG closed binaries." | + tee -a $mail_msg_file >> $LOGFILE + fi + fi + + ORIG_CLOSED_IS_PRESENT=$CLOSED_IS_PRESENT + export CLOSED_IS_PRESENT=no + + ORIG_ON_CLOSED_BINS="$ON_CLOSED_BINS" + export ON_CLOSED_BINS=$CODEMGR_WS/closed.skel + + normal_build -O + + echo "\n==== Generating OpenSolaris tarballs ====\n" | \ + tee -a $LOGFILE >> $mail_msg_file + + cd $CODEMGR_WS + + echo "Generating THIRDPARTYLICENSE files..." >> $LOGFILE + + mktpl usr/src/tools/opensolaris/license-list >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create THIRDPARTYLICENSE files" | + tee -a $mail_msg_file >> $LOGFILE + fi + + echo "Generating closed binaries tarball(s)..." >> $LOGFILE + if [ "$D_FLAG" = y ]; then + bindrop $ROOT $ROOT-open >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create DEBUG closed binaries." | + tee -a $mail_msg_file >> $LOGFILE + fi + fi + if [ "$F_FLAG" = n ]; then + bindrop -n $ROOT-nd $ROOT-open-nd >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create non-DEBUG closed binaries." | + tee -a $mail_msg_file >> $LOGFILE + fi + fi + + echo "Generating SUNWonbld tarball..." >> $LOGFILE + PKGARCHIVE=$PKGARCHIVE_ORIG + onblddrop >> $LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create SUNWonbld tarball." | + tee -a $mail_msg_file >> $LOGFILE + fi + + echo "Generating README.opensolaris..." >> $LOGFILE + cat $SRC/tools/opensolaris/README.opensolaris.tmpl | \ + mkreadme_osol $CODEMGR_WS/README.opensolaris >> $LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create README.opensolaris." | + tee -a $mail_msg_file >> $LOGFILE + fi + + echo "Generating source tarball..." >> $LOGFILE + sdrop >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create source tarball." | + tee -a $mail_msg_file >> $LOGFILE + fi + + echo "Generating BFU tarball(s)..." >> $LOGFILE + if [ "$D_FLAG" = y ]; then + bfudrop nightly-open >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create DEBUG archives tarball." | + tee -a $mail_msg_file >> $LOGFILE + fi + fi + if [ "$F_FLAG" = n ]; then + bfudrop nightly-open-nd >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + echo "Couldn't create non-DEBUG archives tarball." | + tee -a $mail_msg_file >> $LOGFILE + fi + fi + + ON_CLOSED_BINS=$ORIG_ON_CLOSED_BINS + CLOSED_IS_PRESENT=$ORIG_CLOSED_IS_PRESENT +fi + ORIG_SRC=$SRC BINARCHIVE=${CODEMGR_WS}/bin-${MACH}.cpio.Z # # For the "open" build, we don't mung any source files, so skip this -# step. +# step. # if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then save_binaries @@ -1929,32 +2227,48 @@ fi if [ "$SO_FLAG" = "y" ]; then # # Copy the open sources into their own tree, set up the closed - # binaries, and set up the environment. + # binaries, and set up the environment. The build looks for + # the closed binaries in a location that depends on whether + # it's a DEBUG build, so we might need to make two copies. # copy_source $CODEMGR_WS $OPEN_SRCDIR OPEN_SOURCE usr/src SRC=$OPEN_SRCDIR/usr/src # Try not to clobber any user-provided closed binaries. export ON_CLOSED_BINS=$CODEMGR_WS/closed$$ - echo "\n==== Copying skeleton closed binaries to $ON_CLOSED_BINS ====\n" | \ + + echo "\n==== Copying skeleton closed binaries to" \ + "$ON_CLOSED_BINS ====\n" | \ tee -a $mail_msg_file >> $LOGFILE - mkclosed $MACH $CODEMGR_WS/proto $ON_CLOSED_BINS >>$LOGFILE 2>&1 - if [ $? -ne 0 ]; then - build_ok=n - echo "Aborting (couldn't create closed binaries)." | - tee -a $mail_msg_file >> $LOGFILE + + if [ "$D_FLAG" = y ]; then + mkclosed $MACH $ROOT $ON_CLOSED_BINS/root_$MACH >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + build_ok=n + echo "Couldn't create DEBUG closed binaries." | + tee -a $mail_msg_file >> $LOGFILE + fi + fi + if [ "$F_FLAG" = n ]; then + root=$ROOT + [ "$MULTI_PROTO" = yes ] && root=$ROOT-nd + mkclosed $MACH $root $ON_CLOSED_BINS/root_$MACH-nd \ + >>$LOGFILE 2>&1 + if [ $? -ne 0 ]; then + build_ok=n + echo "Couldn't create non-DEBUG closed binaries." | + tee -a $mail_msg_file >> $LOGFILE + fi fi - CLOSED_IS_PRESENT=no + + export CLOSED_IS_PRESENT=no fi if is_source_build && [ $build_ok = y ] ; then - # remove proto area here, since we don't clobber - rm -rf "$ROOT" + # remove proto area(s) here, since we don't clobber + rm -rf `allprotos` if [ "$t_FLAG" = "y" ]; then - export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD= - export RELEASE_BUILD ; RELEASE_BUILD= - unset EXTRA_OPTIONS - unset EXTRA_CFLAGS + set_non_debug_build_flags ORIG_TOOLS=$TOOLS # # SRC was set earlier to point to the source build @@ -1973,10 +2287,21 @@ if [[ "$SO_FLAG" = "y" && "$build_ok" = "y" ]]; then rm -rf $ON_CLOSED_BINS fi +# +# There are several checks that need to look at the proto area, but +# they only need to look at one, and they don't care whether it's +# DEBUG or non-DEBUG. +# +if [[ "$MULTI_PROTO" = yes && "$D_FLAG" = n ]]; then + checkroot=$ROOT-nd +else + checkroot=$ROOT +fi + if [ "$build_ok" = "y" ]; then echo "\n==== Creating protolist system file at `date` ====" \ >> $LOGFILE - protolist $ROOT > $ATLOG/proto_list_${MACH} + protolist $checkroot > $ATLOG/proto_list_${MACH} echo "==== protolist system file created at `date` ====\n" \ >> $LOGFILE @@ -2006,7 +2331,7 @@ if [ "$build_ok" = "y" ]; then # Use the presence of the first file entry of the cached # IHV proto list in the reference list to determine # whether it was build with -X or not. - IHV_REF_PROTO_LIST=$SRC/pkgdefs/etc/proto_list_ihv_$MACH + IHV_REF_PROTO_LIST=$SRC/pkgdefs/etc/proto_list_ihv_$MACH grepfor=$(nawk '$1 == "f" { print $2; exit }' \ $IHV_REF_PROTO_LIST 2> /dev/null) if [ $? = 0 -a -n "$grepfor" ]; then @@ -2091,9 +2416,19 @@ if [ "$U_FLAG" = "y" -a "$build_ok" = "y" ]; then rm -rf $PARENT_WS/proto/root_$MACH/* unset Ulockfile mkdir -p $NIGHTLY_PARENT_ROOT - cd $ROOT - ( tar cf - . | ( cd $NIGHTLY_PARENT_ROOT; umask 0; tar xpf - ) ) 2>&1 | - tee -a $mail_msg_file >> $LOGFILE + if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then + cd $ROOT + ( tar cf - . | + ( cd $NIGHTLY_PARENT_ROOT; umask 0; tar xpf - ) ) 2>&1 | + tee -a $mail_msg_file >> $LOGFILE + fi + if [[ "$MULTI_PROTO" = yes && "$F_FLAG" = n ]]; then + mkdir -p $NIGHTLY_PARENT_ROOT-nd + cd $ROOT-nd + ( tar cf - . | + ( cd $NIGHTLY_PARENT_ROOT-nd; umask 0; tar xpf - ) ) 2>&1 | + tee -a $mail_msg_file >> $LOGFILE + fi fi # @@ -2112,7 +2447,7 @@ if [ "$A_FLAG" = "y" -a "$build_ok" = "y" ]; then mkdir -p $SRC/interfaces.out intf_check -V -m -o -b $SRC/tools/abi/etc \ - -d $SRC/interfaces.out $ROOT 2>&1 | sort \ + -d $SRC/interfaces.out $checkroot 2>&1 | sort \ > $SRC/interfaces.out/log # report any ERROR found in log file @@ -2163,9 +2498,9 @@ if [ "$r_FLAG" = "y" -a "$build_ok" = "y" ]; then else rtime_sflag="-s" fi - check_rtime -d $ROOT -i -m -o $rtime_sflag $ROOT 2>&1 | \ - egrep -v ": unreferenced object=$ROOT/.*/lib(w|intl|thread|pthread).so" | \ - egrep -v ": unused object=$ROOT/.*/lib(w|intl|thread|pthread).so" | \ + check_rtime -d $checkroot -i -m -o $rtime_sflag $checkroot 2>&1 | \ + egrep -v ": unreferenced object=$checkroot/.*/lib(w|intl|thread|pthread).so" | \ + egrep -v ": unused object=$checkroot/.*/lib(w|intl|thread|pthread).so" | \ sort >$SRC/runtime.out # Determine any processing errors that will affect the final output @@ -2291,7 +2626,7 @@ if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then >>$mail_msg_file arg=-b [ "$build_ok" = y ] && arg= - checkpaths $arg $ROOT 2>&1 | tee -a $LOGFILE >>$mail_msg_file + checkpaths $arg $checkroot 2>&1 | tee -a $LOGFILE >>$mail_msg_file fi if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then @@ -2310,15 +2645,12 @@ if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then fi if [ "$w_FLAG" = "y" -a "$build_ok" = "y" ]; then - echo "\n==== Objects that differ since last build ====\n" | \ - tee -a $LOGFILE >> $mail_msg_file + if [[ "$MULTI_PROTO" = no || "$D_FLAG" = y ]]; then + do_wsdiff DEBUG $ROOT.prev $ROOT + fi - if [ "$t_FLAG" = "y" ]; then - wsdiff -t -r ${TMPDIR}/wsdiff.results $ROOT.prev $ROOT | \ - tee -a $LOGFILE >> $mail_msg_file - else - wsdiff -r ${TMPDIR}/wsdiff.results $ROOT.prev $ROOT | \ - tee -a $LOGFILE >> $mail_msg_file + if [[ "$MULTI_PROTO" = yes && "$F_FLAG" = n ]]; then + do_wsdiff non-DEBUG $ROOT-nd.prev $ROOT-nd fi fi diff --git a/usr/src/tools/scripts/onblddrop.sh b/usr/src/tools/scripts/onblddrop.sh new file mode 100644 index 0000000000..ba8ea615d6 --- /dev/null +++ b/usr/src/tools/scripts/onblddrop.sh @@ -0,0 +1,91 @@ +#! /bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# ident "%Z%%M% %I% %E% SMI" +# + +# +# Make SUNWonbld package tarball for OpenSolaris. Besides the +# package, we include licensing files. +# + +fail() { + echo $* + exit 1 +} + +# +# Directory that we assemble everything in. Everything goes into +# $subdir so that it unpacks cleanly. +# +stagedir=$(mktemp -dt onblddropXXXXX) +subdir=onbld + +[ -n "$SRC" ] || fail "Please set SRC." +[ -n "$CODEMGR_WS" ] || fail "Please set CODEMGR_WS." +[ -n "$PKGARCHIVE" ] || fail "Please set PKGARCHIVE." + +[ -n "$MAKE" ] || export MAKE=make + +isa=`uname -p` +tarfile=$CODEMGR_WS/SUNWonbld.$isa.tar + +# +# Generate the README from boilerplate and the contents of the +# SUNWonbld tree. +# usage: mkdireadme targetdir +# +mkreadme() { + targetdir=$1 + readme=README.ON-BUILD-TOOLS.$isa + sed -e s/@ISA@/$isa/ -e s/@DELIVERY@/ON-BUILD-TOOLS/ \ + $SRC/tools/opensolaris/README.binaries.tmpl > $targetdir/$readme + (cd $targetdir; find SUNWonbld -type f -print | \ + sort >> $targetdir/$readme) +} + +[ -n "$stagedir" ] || fail "Can't create staging directory." +mkdir -p $stagedir/$subdir || fail "Can't create $stagedir/$subdir." + +cd $CODEMGR_WS +# $MAKE -e to make sure PKGARCHIVE is used. +(cd usr/src/tools/SUNWonbld; $MAKE -e install) || fail "Can't make package." + +[ -d $PKGARCHIVE/SUNWonbld ] || \ + fail "$PKGARCHIVE/SUNWonbld is missing." +(cd $PKGARCHIVE; tar cf - SUNWonbld) | (cd $stagedir/$subdir; tar xf -) + +# Insert binary license files. +cp -p $SRC/tools/opensolaris/BINARYLICENSE.txt $stagedir/$subdir || \ + fail "Can't add BINARYLICENSE.txt" +mkreadme $stagedir/$subdir +cp -p $CODEMGR_WS/THIRDPARTYLICENSE.ON-BUILD-TOOLS $stagedir/$subdir || \ + fail "Can't add THIRDPARTYLICENSE.ON-BUILD-TOOLS." + +(cd $stagedir; tar cf $tarfile $subdir) || fail "Can't create $tarfile." +bzip2 -f $tarfile || fail "Can't compress $tarfile". + +rm -rf $stagedir diff --git a/usr/src/tools/scripts/sdrop.sh b/usr/src/tools/scripts/sdrop.sh new file mode 100644 index 0000000000..7b6726dd47 --- /dev/null +++ b/usr/src/tools/scripts/sdrop.sh @@ -0,0 +1,67 @@ +#!/bin/ksh -p +# +# CDDL HEADER START +# +# The contents of this file are subject to the terms of the +# Common Development and Distribution License (the "License"). +# You may not use this file except in compliance with the License. +# +# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE +# or http://www.opensolaris.org/os/licensing. +# See the License for the specific language governing permissions +# and limitations under the License. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file at usr/src/OPENSOLARIS.LICENSE. +# If applicable, add the following below this CDDL HEADER, with the +# fields enclosed by brackets "[]" replaced with your own identifying +# information: Portions Copyright [yyyy] [name of copyright owner] +# +# CDDL HEADER END +# + +# +# ident "%Z%%M% %I% %E% SMI" +# +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Use is subject to license terms. +# +# Source drop generator. Based on clone_source function in nightly(1). +# + +tmpdir=$(mktemp -dt sdropXXXXX) + +cleanup() { + [ -n "$tmpdir" ] && rm -rf $tmpdir +} + +fail() { + echo $* + cleanup + exit 1 +} + +[ -n "$CODEMGR_WS" ] || fail "Please define CODEMGR_WS." +[ -n "$tmpdir" ] || fail "Can't create temp directory." + +tarfile=$CODEMGR_WS/on-src.tar + +cd $CODEMGR_WS + +# +# Copy anything that's registered with SCCS, except for deleted files, +# into a temp directory. Then tar that up. +# + +find usr/src -name 's\.*' -a -type f -print | \ + sed -e 's,SCCS\/s.,,' | \ + grep -v '/\.del-*' | \ + cpio -pd $tmpdir +[ $? -eq 0 ] || fail "Couldn't populate temp directory $tmpdir." + +cp README.opensolaris $tmpdir || fail "Couldn't copy README.opensolaris." + +(cd $tmpdir; tar cf $tarfile .) || fail "Couldn't create $tarfile." +bzip2 -f $tarfile || fail "Couldn't bzip2 $tarfile." + +cleanup diff --git a/usr/src/tools/scripts/stdenv.sh b/usr/src/tools/scripts/stdenv.sh index bf5b5d13f8..8eb05ab834 100644 --- a/usr/src/tools/scripts/stdenv.sh +++ b/usr/src/tools/scripts/stdenv.sh @@ -20,7 +20,7 @@ # # -# Copyright 2006 Sun Microsystems, Inc. All rights reserved. +# Copyright 2007 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # # ident "%Z%%M% %I% %E% SMI" @@ -54,3 +54,11 @@ # builds. # [ -n "$OPEN_SRCDIR" ] || export OPEN_SRCDIR="$CODEMGR_WS/open_src" + +# +# Flag to enable creation of per-build-type proto areas. If "yes", +# more proto areas are created, which speeds up incremental builds but +# increases storage consumption. Will be forced to "yes" for +# OpenSolaris deliveries. +# +[ -n "$MULTI_PROTO" ] || export MULTI_PROTO=no |
