nightly.sh revision a5c06a9ed1833574df8f8a348316df41d3f7cad4
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#!/bin/ksh -p
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# CDDL HEADER START
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# The contents of this file are subject to the terms of the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Common Development and Distribution License, Version 1.0 only
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# (the "License"). You may not use this file except in compliance
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# with the License.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# or http://www.opensolaris.org/os/licensing.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# See the License for the specific language governing permissions
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# and limitations under the License.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# When distributing Covered Code, include this CDDL HEADER in each
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# If applicable, add the following below this CDDL HEADER, with the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# fields enclosed by brackets "[]" replaced with your own identifying
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# information: Portions Copyright [yyyy] [name of copyright owner]
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# CDDL HEADER END
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Use is subject to license terms.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# ident "%Z%%M% %I% %E% SMI"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Based on the nightly script from the integration folks,
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Mostly modified and owned by mike_s.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Changes also by kjc, dmk.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# BRINGOVER_WS may be specified in the env file.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# The default is the old behavior of CLONE_WS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# -i on the command line, means fast options, so when it's on the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# command line (only), lint, check, GPROF and TRACE builds are skipped
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# no matter what the setting of their individual flags are in NIGHTLY_OPTIONS.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# LINTDIRS can be set in the env file, format is a list of:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# /dirname-to-run-lint-on flag
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer#
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff# Where flag is: y - enable lint noise diff output
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# n - disable lint noise diff output
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# For example: LINTDIRS="$SRC/uts n $SRC/stand y $SRC/psm y"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# -A flag in NIGHTLY_OPTIONS checks ABI diffs in .so files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# This option requires a couple of scripts.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# OPTHOME and TEAMWARE may be set in the environment to override /opt
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# and /opt/teamware defaults.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# The CDPATH variable causes ksh's `cd' builtin to emit messages to stdout
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# under certain circumstances, which can really screw things up; unset it.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CDPATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# function to do a DEBUG and non-DEBUG build. Needed because we might
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# need to do another for the source build, and since we only deliver DEBUG or
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# non-DEBUG packages.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinormal_build() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # timestamp the start of a nightly build; the findunref tool uses it.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki touch $SRC/.build.tstamp
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # non-DEBUG build begins
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$F_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export RELEASE_BUILD ; RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_CFLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build non-DEBUG -nd
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a "$p_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki copy_ihv_pkgs non-DEBUG -nd
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== No non-DEBUG build ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # non-DEBUG build ends
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # DEBUG build begins
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$D_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset RELEASE_BUILD
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_CFLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build DEBUG ""
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ "$build_ok" = "y" -a "$X_FLAG" = "y" -a "$p_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki copy_ihv_pkgs DEBUG ""
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer else
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== No DEBUG build ====\n" >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # DEBUG build ends
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfilelist() {
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ $# -ne 2 ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "usage: filelist DESTDIR PATTERN"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer exit 1;
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer DEST=$1
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer PATTERN=$2
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer cd ${DEST}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer OBJFILES=${ORIG_SRC}/xmod/obj_files
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ ! -f ${OBJFILES} ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer return;
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer for i in `grep -v '^#' ${ORIG_SRC}/xmod/obj_files | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer grep ${PATTERN} | cut -d: -f2 | tr -d ' \t'`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # wildcard expansion
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for j in $i
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f "$j" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $j
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d "$j" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $j
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done | sort | uniq
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# function to save off binaries after a full build for later
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# restoration
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkisave_binaries() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # save off list of binaries
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Saving binaries from build at `date` ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${BINARCHIVE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${CODEMGR_WS}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki filelist ${CODEMGR_WS} '^preserve:' >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki filelist ${CODEMGR_WS} '^preserve:' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cpio -ocB 2>/dev/null | compress \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki > ${BINARCHIVE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# delete files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkihybridize_files() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: hybridize_files DESTDIR MAKE_TARGET"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw DEST=$1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw MAKETARG=$2
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Hybridizing files at `date` ====\n" | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw for i in `filelist ${DEST} '^delete:'`
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw do
c8268b2c32246a4fd927df00921c772baab114e0Kelly Moyer echo "removing ${i}." | tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw rm -rf "${i}"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for i in `filelist ${DEST} '^hybridize:' `
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "hybridizing ${i}." | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${i}+
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sed -e "/^# HYBRID DELETE START/,/^# HYBRID DELETE END/d" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki < ${i} > ${i}+
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv ${i}+ ${i}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# restore binaries into the proper source tree.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkirestore_binaries() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: restore_binaries DESTDIR MAKE_TARGET"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DEST=$1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw MAKETARG=$2
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Restoring binaries to ${MAKETARG} at `date` ====\n" | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cd ${DEST}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw zcat ${BINARCHIVE} | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cpio -idmucvB 2>/dev/null | tee -a $mail_msg_file >> ${LOGFILE}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# rename files we save binaries of
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwrename_files() {
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ $# -ne 2 ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "usage: rename_files DESTDIR MAKE_TARGET"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1;
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DEST=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki MAKETARG=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Renaming source files in ${MAKETARG} at `date` ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for i in `filelist ${DEST} '^rename:'`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo ${i} | tee -a $mail_msg_file >> ${LOGFILE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${i}.export
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv ${i} ${i}.export
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# function to create the export/crypt source tree
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# usage: clone_source CODEMGR_WS DESTDIR MAKE_TARGET
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiclone_source() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 3 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: clone_source CODEMGR_WS DESTDIR MAKE_TARGET"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki WS=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DEST=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki MAKETARG=$3
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Creating ${DEST} source from ${WS} (${MAKETARG}) ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "cleaning out ${DEST}." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf "${DEST}" >> $LOGFILE 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p ${DEST}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${WS}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "creating ${DEST}." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find usr/src -name 's\.*' -a -type f -print | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sed -e 's,SCCS\/s.,,' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v '/\.del-*' | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cpio -pd ${DEST} >>$LOGFILE 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SRC=${DEST}/usr/src
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${MAKETARG}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "making ${MAKETARG} in ${SRC}." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /bin/time $MAKE -e ${MAKETARG} 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $SRC/${MAKETARG}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== ${MAKETARG} build errors ====\n" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep ":" $SRC/${MAKETARG}.out | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw egrep -e "(^${MAKE}:|[ ]error[: \n])" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "warning" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "clearing state files." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find . -name '.make*' -exec rm -f {} \;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${DEST}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${MAKETARG}" = "CRYPT_SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${CODEMGR_WS}/crypt_files.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== xmod/cry_files that don't exist ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CRYPT_FILES=${WS}/usr/src/xmod/cry_files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for i in `cat ${CRYPT_FILES}`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # make sure the files exist
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ -f "$i" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer continue
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d "$i" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki continue
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$i" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find `cat ${CRYPT_FILES}` -print 2>/dev/null | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cpio -ocB 2>/dev/null | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki compress > ${CODEMGR_WS}/crypt_files.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${MAKETARG}" = "EXPORT_SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # rename first, since we might restore a file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # of the same name (mapfiles)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rename_files ${EXPORT_SRC} EXPORT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki hybridize_files ${EXPORT_SRC} EXPORT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # save the cleartext
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Creating ${MAKETARG}.cpio.Z ====\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${DEST}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${MAKETARG}.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find usr/src -depth -print | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v usr/src/${MAKETARG}.out | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cpio -ocB 2>/dev/null | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki compress > ${CODEMGR_WS}/${MAKETARG}.cpio.Z
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${MAKETARG}" = "EXPORT_SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki restore_binaries ${EXPORT_SRC} EXPORT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${MAKETARG}" = "CRYPT_SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki restore_binaries ${CRYPT_SRC} CRYPT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# function to do the build.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# usage: build LABEL SUFFIX
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild() {
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: build LABEL SUFFIX"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LABEL=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SUFFIX=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki INSTALLOG=install${SUFFIX}-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki NOISE=noise${SUFFIX}-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CPIODIR=${CPIODIR_ORIG}${SUFFIX}
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ "$SPARC_RM_PKGARCHIVE_ORIG" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SPARC_RM_PKGARCHIVE=${SPARC_RM_PKGARCHIVE_ORIG}${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #remove old logs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki OLDINSTALLOG=install${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki OLDNOISE=noise${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/${OLDINSTALLOG}.out
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw rm -f $SRC/${OLDNOISE}.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $SRC/${OLDNOISE}.out ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $SRC/${OLDNOISE}.out $SRC/${NOISE}.ref
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw fi
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw this_build_ok=y
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw #
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw # Build OS-Networking source
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer #
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Building OS-Net source at `date` ($LABEL) ====\n" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer rm -f $SRC/${INSTALLOG}.out
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer cd $SRC
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer /bin/time $MAKE -e install 2>&1 | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $SRC/${INSTALLOG}.out >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Build errors ($LABEL) ====\n" >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep ":" $SRC/${INSTALLOG}.out |
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep -e "(^${MAKE}:|[ ]error[: \n])" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep -v "Ignoring unknown host" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep -v "cc .* -o error " | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep -v "warning" >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$?" = "0" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer build_ok=n
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer this_build_ok=n
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer grep "bootblock image is .* bytes too big" $SRC/${INSTALLOG}.out \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$?" = "0" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build_ok=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki this_build_ok=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$W_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Build warnings ($LABEL) ====\n" >>$mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw # should be none, but there are a few that are pmake
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw # related, and a couple of silly ones.
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw egrep -i warning: $SRC/${INSTALLOG}.out \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^tic:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^mcs:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^LD_LIBRARY_PATH=' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'multiple use of -K option' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'option -I appears more than once' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'ar: creating' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'ar: writing' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'conflicts:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v ':saved created' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^stty.*c:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^mfgname.c:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^uname-i.c:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^volumes.c:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^lint library construction:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'tsort: INFORM:' \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v 'stripalign:' \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer | egrep -v 'chars, width' \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer | egrep -v 'option -zdefs/nodefs appears more than' \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer | egrep -v "symbol \`timezone' has differing types:" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v "parameter <PSTAMP> set to" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v "^Manifying" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v "Ignoring unknown host" \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v "redefining segment flags attribute for" \
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw >> $mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw fi
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff echo "\n==== Ended OS-Net source build at `date` ($LABEL) ====\n" \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff >> $LOGFILE
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw echo "\n==== Elapsed build time ($LABEL) ====\n" >>$mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw tail -3 $SRC/${INSTALLOG}.out >>$mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ "$i_FLAG" = "n" -a "$W_FLAG" = "n" ]; then
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw rm -f $SRC/${NOISE}.ref
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ -f $SRC/${NOISE}.out ]; then
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw mv $SRC/${NOISE}.out $SRC/${NOISE}.ref
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw fi
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw grep : $SRC/${INSTALLOG}.out \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw | egrep -v '^/' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^(Start|Finish|real|user|sys|./bld_awk)' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^tic:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^mcs' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^LD_LIBRARY_PATH=' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v 'multiple use of -K option' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'option -I appears more than once' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'ar: creating' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'ar: writing' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'conflicts:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v ':saved created' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^stty.*c:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^mfgname.c:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^uname-i.c:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^volumes.c:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^lint library construction:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'tsort: INFORM:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'stripalign:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'chars, width' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'option -zdefs/nodefs appears more than' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v "symbol \`timezone' has differing types:" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v 'PSTAMP' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '|%WHOANDWHERE%|' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Manifying' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v 'Ignoring unknown host' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v 'Processing method:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Writing' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v 'spellin1:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^adding:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v "^echo 'msgid" \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^echo ' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '\.c:$' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^Adding file:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'CLASSPATH=' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '\/var\/mail\/:saved' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v -- '-DUTS_VERSION=' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^Running Mkbootstrap' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^Applet length read:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v 'bytes written:' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v '^File:SolarisAuthApplet.bin' \
34f1a571c0d0c682a4a70b97b1e62430aa630559Michael Bergknoff | egrep -v -i 'jibversion' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Output size:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Solo size statistics:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Using ROM API Version' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Zero Signature length:' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^Note \(probably harmless\):' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '::' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v -- '-xcache' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep -v '^\+' \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | sort | uniq >$SRC/${NOISE}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ ! -f $SRC/${NOISE}.ref ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cp $SRC/${NOISE}.out $SRC/${NOISE}.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Build noise differences ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki diff $SRC/${NOISE}.ref $SRC/${NOISE}.out >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Create cpio archives for preintegration testing (PIT)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ "$a_FLAG" = "y" -a "$this_build_ok" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Creating $LABEL cpio archives at `date` ====\n" \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki makebfu_file="${TMPDIR}/makebfu"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${makebfu_file}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki makebfu 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a ${makebfu_file} >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== cpio archives build errors ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v "^Creating .* archive:" ${makebfu_file} | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v "^Making" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -v "^$" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sort | uniq >> $mail_msg_file
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw rm -f ${makebfu_file}
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw # hack for test folks
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw if [ -z "`echo $PARENT_WS|egrep '^\/ws\/'`" ]; then
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw X=/net/`uname -n`${CPIODIR}
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw else
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw X=${CPIODIR}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Archive_directory: ${X}" >${TMPDIR}/f
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cp ${TMPDIR}/f ${CPIODIR}/../../.${MACH}_wgtrun
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${TMPDIR}/f
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Not creating $LABEL cpio archives ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Building Packages
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$p_FLAG" = "y" -a "$this_build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Creating $LABEL packages at `date` ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/pkgdefs/${INSTALLOG}.out
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw echo "Clearing out $PKGARCHIVE ..." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $PKGARCHIVE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mkdir -p $PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Optional build of sparc realmode on i386
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$MACH" = "i386" ] && [ "${SPARC_RM_PKGARCHIVE}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Clearing out ${SPARC_RM_PKGARCHIVE} ..." \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf ${SPARC_RM_PKGARCHIVE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p ${SPARC_RM_PKGARCHIVE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $SRC/pkgdefs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $MAKE -e install 2>&1 | \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw tee -a $SRC/pkgdefs/${INSTALLOG}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Package build errors ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer egrep "${MAKE}|ERROR|WARNING" $SRC/pkgdefs/${INSTALLOG}.out | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep ':' | \
d2b9c6763c7b3aad7a4c2609ca71e0b02114bca9fw grep -v PSTAMP | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Not creating $LABEL packages ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkidolint() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Arg. 2 is a flag to turn on/off the lint diff output
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki dl_usage="Usage: dolint /dir y|n"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $dl_usage
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ ! -d "$1" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $dl_usage
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$2" != "y" -a "$2" != "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo $dl_usage
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki lintdir=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki dodiff=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki base=`basename $lintdir`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LINTOUT=$lintdir/lint-${MACH}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LINTNOISE=$lintdir/lint-noise-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
806db1d7d3933321464d3e214503005b510991befw unset RELEASE_BUILD
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_CFLAGS
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw #
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # '$MAKE lint' in $lintdir
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Begin '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # remove old lint.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $lintdir/lint.out $lintdir/lint-noise.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $lintdir/lint-noise.ref ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $lintdir/lint-noise.ref ${LINTNOISE}.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $LINTOUT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $lintdir
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Remove all .ln files to ensure a full reference file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f Nothing_to_remove \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki `find . -name SCCS -prune -o -type f -name '*.ln' -print `
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw /bin/time $MAKE -ek lint 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LINTOUT >> $LOGFILE
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw echo "\n==== '$MAKE lint' of $base ERRORS ====\n" >> $mail_msg_file
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw grep "$MAKE:" $LINTOUT |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Ended '$MAKE lint' of $base at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Elapsed time of '$MAKE lint' of $base ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tail -3 $LINTOUT >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw rm -f ${LINTNOISE}.ref
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw if [ -f ${LINTNOISE}.out ]; then
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw mv ${LINTNOISE}.out ${LINTNOISE}.ref
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw fi
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw #grep : $LINTOUT |
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw #egrep -v '^(name|function|value|argument|real|user|sys)' |
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw #egrep -v 'warning: (name|function|value|possibly)' |
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw #egrep -v 'warning: argument used' |
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw grep : $LINTOUT | \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw egrep -v '^(real|user|sys)' |
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw egrep -v '(library construction)' | \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw egrep -v ': global crosschecks' | \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw egrep -v 'Ignoring unknown host' | \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw egrep -v '\.c:$' | \
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw sort | uniq > ${LINTNOISE}.out
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw if [ ! -f ${LINTNOISE}.ref ]; then
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw cp ${LINTNOISE}.out ${LINTNOISE}.ref
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw fi
a1c5472562e714fe175eb2fbfcde0ccba7385a6cfw if [ "$dodiff" != "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== lint warnings $base ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # should be none, though there are a few that were filtered out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # above
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -i '(warning|lint):' ${LINTNOISE}.out \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | sort | uniq >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== lint noise differences $base ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki diff ${LINTNOISE}.ref ${LINTNOISE}.out \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Install proto area from IHV build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwcopy_ihv_proto() {
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Installing $IA32_IHV_ROOT ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d "$IA32_IHV_ROOT" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ ! -d "$ROOT" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "mkdir -p $ROOT" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p $ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "cd $IA32_IHV_ROOT\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $IA32_IHV_ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tar -cf - . | (cd $ROOT; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$IA32_IHV_ROOT: not found" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Install IHV packages in PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicopy_ihv_pkgs() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 2 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: copy_ihv_pkgs LABEL SUFFIX"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LABEL=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SUFFIX=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # always use non-DEBUG IHV packages
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki IA32_IHV_PKGS=${IA32_IHV_PKGS_ORIG}-nd
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PKGARCHIVE=${PKGARCHIVE_ORIG}${SUFFIX}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Installing IHV packages from $IA32_IHV_PKGS ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d "$IA32_IHV_PKGS" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $IA32_IHV_PKGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tar -cf - * | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$IA32_IHV_PKGS: not found" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Installing IHV packages from $IA32_IHV_BINARY_PKGS ($LABEL) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d "$IA32_IHV_BINARY_PKGS" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $IA32_IHV_BINARY_PKGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tar -cf - * | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki (cd $PKGARCHIVE; umask 0; tar xpf - ) 2>&1 >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
5413ab1b25eb8f7cbf9070adc2e222772aa054daMichael Bergknoff echo "$IA32_IHV_BINARY_PKGS: not found" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild_tools() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $# -ne 1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "usage: build_tools DESTROOT"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DESTROOT=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki INSTALLOG=install-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Building tools at `date` ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${TOOLS}/${INSTALLOG}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${TOOLS}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /bin/time $MAKE ROOT=${DESTROOT} -e install 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a ${TOOLS}/${INSTALLOG}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Tools build errors ====\n" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep ":" ${TOOLS}/${INSTALLOG}.out |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -e "(${MAKE}:|[ ]error[: \n])" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v warning >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$?" != "0" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki STABS=${DESTROOT}/opt/onbld/bin/${MACH}/stabs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export STABS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFSTABS=${DESTROOT}/opt/onbld/bin/${MACH}/ctfstabs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFSTABS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki GENOFFSETS=${DESTROOT}/opt/onbld/bin/genoffsets
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export GENOFFSETS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFCONVERT=${DESTROOT}/opt/onbld/bin/${MACH}/ctfconvert
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFCONVERT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFMERGE=${DESTROOT}/opt/onbld/bin/${MACH}/ctfmerge
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFMERGE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFCVTPTBL=${DESTROOT}/opt/onbld/bin/ctfcvtptbl
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFCVTPTBL
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CTFFINDMOD=${DESTROOT}/opt/onbld/bin/ctffindmod
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CTFFINDMOD
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$VERIFY_ELFSIGN" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ELFSIGN=${DESTROOT}/opt/onbld/bin/elfsigncmp
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ELFSIGN=${DESTROOT}/opt/onbld/bin/${MACH}/elfsign
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export ELFSIGN
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PATH="${DESTROOT}/opt/onbld/bin/${MACH}:${PATH}"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PATH="${DESTROOT}/opt/onbld/bin:${PATH}"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export PATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== New environment settings. ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "STABS=${STABS}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CTFSTABS=${CTFSTABS}" >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "CTFCONVERT=${CTFCONVERT}" >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "CTFMERGE=${CTFMERGE}" >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "CTFCVTPTBL=${CTFCVTPTBL}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CTFFINDMOD=${CTFFINDMOD}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "ELFSIGN=${ELFSIGN}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "PATH=${PATH}" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkistaffer() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $ISUSER -ne 0 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$@"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw arg="\"$1\""
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw shift
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw for i
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki arg="$arg \"$i\""
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki eval su $STAFFER -c \'$arg\'
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiMACH=`uname -p`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$OPTHOME" = "" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw OPTHOME=/opt
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw export OPTHOME
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$TEAMWARE" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki TEAMWARE=$OPTHOME/teamware
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export TEAMWARE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
aaba19e23c48a32e927f4e39464be188bfcbef37fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiUSAGE='Usage: nightly [-in] [-V VERS ] [ -S E|D|H ] <env_file>
aaba19e23c48a32e927f4e39464be188bfcbef37fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiWhere:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -i Fast incremental options (no clobber, lint, check, gprof, trace)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -n Do not do a bringover
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -V VERS set the build version string to VERS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -S Build a variant of the source product
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki E - build exportable source
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki D - build domestic source (exportable + crypt)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki H - build hybrid source (binaries + deleted source)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki <env_file> file in Bourne shell syntax that sets and exports
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki variables that configure the operation of this script and many of
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki the scripts this one calls. If <env_file> does not exist,
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki it will be looked for in $OPTHOME/onbld/env.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinon-DEBUG is the default build type. Build options can be set in the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiNIGHTLY_OPTIONS variable in the <env_file> as follows:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -A check for ABI differences in .so files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -C check for cstyle/hdrchk errors
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -D do a build with DEBUG on
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -F do _not_ do a non-DEBUG build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -G gate keeper default group of options (-au)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -I integration engineer default group of options (-ampu)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -M do not run pmodes (safe file permission checker)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -N do not run protocmp
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -P do a build with GPROF on
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -R default group of options for building a release (-mp)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -T do a build with TRACE on
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -U update proto area in the parent
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -V VERS set the build version string to VERS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -X copy x86 IHV packages
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -a create cpio archives
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -d use Distributed Make (default uses Parallel Make)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -f find unreferenced files
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -i do an incremental build (no "make clobber")
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -l do "make lint" in $LINTDIRS (default: $SRC y)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -m send mail to $MAILTO at end of build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -n do not do a bringover
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -o build using root privileges to set OWNER/GROUP (old style)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -p create packages
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -r check ELF runtime attributes in the proto area
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -t build and use the tools in $SRC/tools
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -u update proto_list_$MACH and friends in the parent workspace;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki when used with -f, also build an unrefmaster.out in the parent
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -z compress cpio archives with gzip
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -W Do not report warnings (freeware gate ONLY)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -S Build a variant of the source product
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki E - build exportable source
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki D - build domestic source (exportable + crypt)
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw H - build hybrid source (binaries + deleted source)
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw'
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# -x less public handling of xmod source for the source product
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# A log file will be generated under the name $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# for partially completed build and log.`date '+%m%d%y'`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# in the same directory for fully completed builds.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# default values for low-level FLAGS; G I R are group FLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiA_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkia_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkid_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiC_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiF_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkif_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiD_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiP_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiT_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkin_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkio_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkii_FLAG=n; i_CMD_LINE_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkil_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkim_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkip_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkir_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkit_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiu_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiU_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiV_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiM_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwN_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwz_FLAG=n
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwW_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSE_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSD_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSH_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiX_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiXMOD_OPT=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild_ok=y
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# examine arguments
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiOPTIND=1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhile getopts inV:S:t FLAG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkido
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki case $FLAG in
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i ) i_FLAG=y; i_CMD_LINE_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki n ) n_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki V ) V_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki V_ARG="$OPTARG"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki S )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Can only build one source variant at a time."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${OPTARG}" = "E" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SE_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "${OPTARG}" = "D" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SD_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "${OPTARG}" = "H" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SH_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki t ) t_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki \? ) echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki esac
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkidone
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# correct argument count after options
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkishift `expr $OPTIND - 1`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# test that the path to the environment-setting file was given
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ $# -ne 1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# check if user is running nightly as root
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# ISUSER is set non-zero if an ordinary user runs nightly, or is zero
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# when root invokes nightly.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki/usr/bin/id | grep '^uid=0(' >/dev/null 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiISUSER=$?; export ISUSER
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# force locale to C
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_COLLATE=C; export LC_COLLATE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_CTYPE=C; export LC_CTYPE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_MESSAGES=C; export LC_MESSAGES
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_MONETARY=C; export LC_MONETARY
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_NUMERIC=C; export LC_NUMERIC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLC_TIME=C; export LC_TIME
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# clear environment variables we know to be bad for the build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_AUDIT LD_AUDIT_32 LD_AUDIT_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_BIND_NOW LD_BIND_NOW_32 LD_BIND_NOW_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_BREADTH LD_BREADTH_32 LD_BREADTH_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_CONFIG LD_CONFIG_32 LD_CONFIG_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_DEBUG LD_DEBUG_32 LD_DEBUG_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_DEMANGLE LD_DEMANGLE_32 LD_DEMANGLE_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_FLAGS LD_FLAGS_32 LD_FLAGS_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_LIBRARY_PATH LD_LIBRARY_PATH_32 LD_LIBRARY_PATH_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_LOADFLTR LD_LOADFLTR_32 LD_LOADFLTR_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOAUDIT LD_NOAUDIT_32 LD_NOAUDIT_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOAUXFLTR LD_NOAUXFLTR_32 LD_NOAUXFLTR_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOCONFIG LD_NOCONFIG_32 LD_NOCONFIG_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NODIRCONFIG LD_NODIRCONFIG_32 LD_NODIRCONFIG_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NODIRECT LD_NODIRECT_32 LD_NODIRECT_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOLAZYLOAD LD_NOLAZYLOAD_32 LD_NOLAZYLOAD_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOOBJALTER LD_NOOBJALTER_32 LD_NOOBJALTER_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_NOVERSION LD_NOVERSION_32 LD_NOVERSION_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_ORIGIN LD_ORIGIN_32 LD_ORIGIN_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_PRELOAD LD_PRELOAD_32 LD_PRELOAD_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset LD_PROFILE LD_PROFILE_32 LD_PROFILE_64
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CONFIG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset GROUP
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset OWNER
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset REMOTE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset ENV
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset ARCH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CLASSPATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset NAME
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Setup environmental variables
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -f $1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [[ $1 = */* ]]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki . $1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki . ./$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $OPTHOME/onbld/env/$1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki . $OPTHOME/onbld/env/$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Cannot find env file as either $1 or $OPTHOME/onbld/env/$1"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# place ourselves in a new task, respecting BUILD_PROJECT if set.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -z "$BUILD_PROJECT" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /usr/bin/newtask -c $$
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /usr/bin/newtask -c $$ -p $BUILD_PROJECT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkips -o taskid= -p $$ | read build_taskid
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkips -o project= -p $$ | read build_project
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# See if NIGHTLY_OPTIONS is set
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$NIGHTLY_OPTIONS" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki NIGHTLY_OPTIONS="-aBm"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# If BRINGOVER_WS was not specified, let it default to CLONE_WS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$BRINGOVER_WS" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki BRINGOVER_WS=$CLONE_WS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# If BRINGOVER_FILES was not specified, default to usr/src
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$BRINGOVER_FILES" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki BRINGOVER_FILES="usr/src"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Note: changes to the option letters here should also be applied to the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# bldenv script.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiOPTIND=1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhile getopts ABDFNMPTCGIRafinlmoptuUxdrtzWS:X FLAG $NIGHTLY_OPTIONS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkido
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki case $FLAG in
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki A ) A_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki B ) D_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;; # old version of D
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki F ) F_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki D ) D_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki P ) P_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki T ) T_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki C ) C_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki M ) M_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki N ) N_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki G ) a_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki u_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki I ) a_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki m_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki p_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki u_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki R ) m_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki p_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki a ) a_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki d ) d_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki f ) f_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i ) i_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki n ) n_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki o ) o_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki l ) l_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki m ) m_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki p ) p_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki r ) r_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki t ) t_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki u ) u_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki z ) z_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki U )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "${PARENT_ROOT}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "PARENT_ROOT must be set if the U flag is" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "present in NIGHTLY_OPTIONS."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki U_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki NIGHTLY_PARENT_ROOT=$PARENT_ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki x ) XMOD_OPT="-x"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki W ) W_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki S )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Can only build one source variant at a time."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "${OPTARG}" = "E" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SE_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "${OPTARG}" = "D" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SD_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "${OPTARG}" = "H" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw SH_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki X ) # now that we no longer need realmode builds, just
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # copy IHV packages. only meaningful on x86.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$MACH" = "i386" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki X_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki \? ) echo "$USAGE"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki esac
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwdone
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ $ISUSER -ne 0 ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ "$o_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "Old-style build requires root permission."
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # Set default value for STAFFER, if needed.
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ -z "$STAFFER" -o "$STAFFER" = "nobody" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw STAFFER=`/usr/xpg4/bin/id -un`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export STAFFER
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoffif [ -z "$MAILTO" -o "$MAILTO" = "nobody" ]; then
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff MAILTO=$STAFFER
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff export MAILTO
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknofffi
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoff
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael BergknoffPATH="$OPTHOME/onbld/bin:$OPTHOME/onbld/bin/${MACH}:/usr/ccs/bin"
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael BergknoffPATH="$PATH:$OPTHOME/SUNWspro/bin:$TEAMWARE/bin:/usr/bin:/usr/sbin:/usr/ucb"
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael BergknoffPATH="$PATH:/usr/openwin/bin:/usr/sfw/bin:/opt/sfw/bin:."
af71cc4ed6be914d26e9de3a90a2bb56e4bbe78dMichael Bergknoffexport PATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiunset CH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$o_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# root invoked old-style build -- make sure it works as it always has
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# by exporting 'CH'. The current Makefile.master doesn't use this, but
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# the old ones still do.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PROTOCMPTERSE="protocmp.terse"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CH=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export CH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PROTOCMPTERSE="protocmp.terse -gu"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPOUND_SIGN="#"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDEF_STRIPFLAG="-s"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# we export POUND_SIGN to speed up the build process -- prevents evaluation of
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# the Makefile.master definitions.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# we export DEF_STRIPFLAG to strip debug data from nightly builds; the default
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# behavior is to include all debug data.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport o_FLAG POUND_SIGN DEF_STRIPFLAG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$d_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki maketype="distributed"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki MAKE=dmake
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # get the dmake version string alone
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DMAKE_VERSION=$( $MAKE -v )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DMAKE_VERSION=${DMAKE_VERSION#*: }
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # focus in on just the dotted version number alone
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DMAKE_MAJOR=$( echo $DMAKE_VERSION | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sed -e 's/.*\<\([^.]*\.[^ ]*\).*$/\1/' )
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # extract the second (or final) integer
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DMAKE_MINOR=${DMAKE_MAJOR#*.}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DMAKE_MINOR=${DMAKE_MINOR%%.*}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # extract the first integer
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DMAKE_MAJOR=${DMAKE_MAJOR%%.*}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CHECK_DMAKE=${CHECK_DMAKE:-y}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # x86 was built on the 12th, sparc on the 13th.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$CHECK_DMAKE" = "y" -a \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/12" -a \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$DMAKE_VERSION" != "Sun Distributed Make 7.3 2003/03/13" -a \( \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$DMAKE_MAJOR" -lt 7 -o \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "$DMAKE_MAJOR" -eq 7 -a "$DMAKE_MINOR" -lt 4 \) ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "$DMAKE_VERSION" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$MAKE is missing."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo `whence $MAKE`" version is:"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo " ${DMAKE_VERSION}"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat <<EOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiThis version may not be safe for use. Either set TEAMWARE to a better
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkipath or (if you really want to use this version of dmake anyway), add
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkithe following to your environment to disable this check:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki CHECK_DMAKE=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiEOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PATH="$TEAMWARE/ParallelMake/bin:$PATH"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki maketype="parallel"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki MAKE=make
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport PATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport MAKE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "${SUNWSPRO}" != "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PATH="${SUNWSPRO}/bin:$PATH"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export PATH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkihostname=`uname -n`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ ! -f $HOME/.make.machines ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw DMAKE_MAX_JOBS=4
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DMAKE_MAX_JOBS="`grep $hostname $HOME/.make.machines | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tail -1 | awk -F= '{print $ 2;}'`"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$DMAKE_MAX_JOBS" = "" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki DMAKE_MAX_JOBS=4
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiDMAKE_MODE=parallel;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport DMAKE_MODE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport DMAKE_MAX_JOBS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -z "${ROOT}" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "ROOT must be set."
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ -z "${EXPORT_SRC}" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "EXPORT_SRC must be set for a source build."
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "${CRYPT_SRC}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "CRYPT_SRC must be set for a source build."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "${EXPORT_SRC}" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "EXPORT_SRC must be set for a source build."
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# if -V flag was given, reset VERSION to V_ARG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$V_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki VERSION=$V_ARG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Append source version
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SE_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki VERSION="${VERSION}:EXPORT"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$SD_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw VERSION="${VERSION}:DOMESTIC"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SH_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw VERSION="${VERSION}:MODIFIED_SOURCE_PRODUCT"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwTMPDIR="/tmp/nightly.tmpdir.$$"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwexport TMPDIR
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwrm -rf ${TMPDIR}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkimkdir -p $TMPDIR || exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Keep elfsign's use of pkcs11_softtoken from looking in the user home
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# directory, which doesn't always work. Needed until all build machines
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# have the fix for 6271754
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSOFTTOKEN_DIR=$TMPDIR
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport SOFTTOKEN_DIR
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiTOOLS=${SRC}/tools
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwTOOLS_PROTO=${TOOLS}/proto
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwunset CFLAGS LD_LIBRARY_PATH LDFLAGS
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# create directories that are automatically removed if the nightly script
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# fails to start correctly
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinewdir() {
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw dir=$1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw toadd=
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw while [ ! -d $dir ]; do
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw toadd="$dir $toadd"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki dir=`dirname $dir`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki torm=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki newlist=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for dir in $toadd; do
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if staffer mkdir $dir; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw newlist="$ISUSER $dir $newlist"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki torm="$dir $torm"
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki [ -z "$torm" ] || staffer rmdir $torm
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki return 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki newdirlist="$newlist $newdirlist"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki return 0
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinewdirlist=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki[ -d $CODEMGR_WS ] || newdir $CODEMGR_WS || exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# since this script assumes the build is from full source, it nullifies
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# variables likely to have been set by a "ws" script; nullification
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# confines the search space for headers and libraries to the proto area
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# built from this immediate source.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVLDLIBS1=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVLDLIBS2=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVLDLIBS3=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS1=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS2=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS3=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS4=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPARENT_ROOT=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport ENVLDLIBS3 ENVCPPFLAGS1 ENVCPPFLAGS2 ENVCPPFLAGS3 ENVCPPFLAGS4 \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki PARENT_ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVLDLIBS1="-L$ROOT/lib -L$ROOT/usr/lib"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiENVCPPFLAGS1="-I$ROOT/usr/include"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexport ENVLDLIBS1 ENVLDLIBS2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiCPIODIR_ORIG=$CPIODIR
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiPKGARCHIVE_ORIG=$PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiIA32_IHV_PKGS_ORIG=$IA32_IHV_PKGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SPARC_RM_PKGARCHIVE" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki SPARC_RM_PKGARCHIVE_ORIG=$SPARC_RM_PKGARCHIVE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Juggle the logs and optionally send mail on completion.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkilogshuffle() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LLOG="$ATLOG/log.`date '+%m%d'`"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $ATLOG/log.??`date '+%d'`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $LLOG -o -d $LLOG ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki LLOG=$LLOG.$$
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir $LLOG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $ATLOG/proto_list_${MACH} $LLOG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Now that we're about to send mail, it's time to check the noise
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # file. In the event that an error occurs beyond this point, it will
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # be recorded in the nightly.log file, but nowhere else. This would
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # include only errors that cause the copying of the noise log to fail
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # or the mail itself not to be sent.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exec >>$LOGFILE 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -s $build_noise_file ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Nightly build noise ====\n" |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat $build_noise_file >>$LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat $build_noise_file >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo | tee -a $LOGFILE >>$mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $build_noise_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki case "$build_ok" in
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki y)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki state=Completed
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki state=Interrupted
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki *)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki state=Failed
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ;;
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki esac
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cat $build_time_file $mail_msg_file > ${LLOG}/mail_msg
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$m_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat $build_time_file $mail_msg_file |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki /usr/bin/mailx -s \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "Nightly ${MACH} Build of `basename ${CODEMGR_WS}` ${state}." \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ${MAILTO}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki staffer cp ${LLOG}/mail_msg $PARENT_WS/usr/src/mail_msg-${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki staffer cp $LOGFILE $PARENT_WS/usr/src/nightly-${MACH}.log
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv $LOGFILE $LLOG
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Remove the locks and temporary files on any exit
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwcleanup() {
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw logshuffle
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw [ -z "$lockfile" ] || staffer rm -f $lockfile
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw [ -z "$atloglockfile" ] || rm -f $atloglockfile
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw [ -z "$ulockfile" ] || staffer rm -f $ulockfile
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw [ -z "$Ulockfile" ] || rm -f $Ulockfile
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw set -- $newdirlist
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw while [ $# -gt 0 ]; do
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ISUSER=$1 staffer rmdir $2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki shift; shift
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw done
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw rm -rf $TMPDIR
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwcleanup_signal() {
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw build_ok=i
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # this will trigger cleanup(), above.
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw exit 1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwtrap cleanup 0
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwtrap cleanup_signal 1 2 3 15
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Generic lock file processing -- make sure that the lock file doesn't
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# exist. If it does, it should name the build host and PID. If it
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# doesn't, then make sure we can create it. Clean up locks that are
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# known to be stale (assumes host name is unique among build systems
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# for the workspace).
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicreate_lock() {
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki lockf=$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki lockvar=$2
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $lockf ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki basews=`basename $CODEMGR_WS`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if read host user pid < $lockf; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$host" != "$hostname" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$MACH build of $basews apparently" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "already started by $user on $host as $pid."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif kill -s 0 $pid 2>/dev/null; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$MACH build of $basews already started" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "by $user as $pid."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # stale lock; clear it out and continue
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $lockf
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "$MACH build of $basews already running."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $lockf ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Lock file is $lockf."
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ldir=`dirname $lockf`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki [ -d $ldir ] || newdir $ldir || exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki eval $lockvar=$lockf
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki staffer sh -c "echo $hostname $STAFFER $$ > $lockf" || exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Ensure no other instance of this script is running on this host.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# LOCKNAME can be set in <env_file>, and is by default, but is not
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# required due to the use of $ATLOG below.
aaba19e23c48a32e927f4e39464be188bfcbef37fwif [ -n "$LOCKNAME" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki create_lock /tmp/$LOCKNAME "lockfile"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Create from one, two, or three other locks:
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# $ATLOG/nightly.lock
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# - protects against multiple builds in same workspace
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# $PARENT_WS/usr/src/nightly.$MACH.lock
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# - protects against multiple 'u' copy-backs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# $NIGHTLY_PARENT_ROOT/nightly.lock
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# - protects against multiple 'U' copy-backs
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
aaba19e23c48a32e927f4e39464be188bfcbef37fw# Overriding ISUSER to 1 causes the lock to be created as root if the
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# script is run as root. The default is to create it as $STAFFER.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiISUSER=1 create_lock $ATLOG/nightly.lock "atloglockfile"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$u_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki create_lock $PARENT_WS/usr/src/nightly.$MACH.lock "ulockfile"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$U_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # NIGHTLY_PARENT_ROOT is written as root if script invoked as root.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ISUSER=1 create_lock $NIGHTLY_PARENT_ROOT/nightly.lock "Ulockfile"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Locks have been taken, so we're doing a build and we're committed to
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# the directories we may have created so far.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkinewdirlist=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Create mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkimail_msg_file="${TMPDIR}/mail_msg"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkitouch $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild_time_file="${TMPDIR}/build_time"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Move old LOGFILE aside
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# ATLOG directory already made by 'create_lock' above
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -f $LOGFILE ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mv -f $LOGFILE ${LOGFILE}-
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Build OsNet source
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSTART_DATE=`date`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiSECONDS=0
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "\n==== Nightly $maketype build started: $START_DATE ====" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | tee -a $LOGFILE > $build_time_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# make sure we log only to the nightly build file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkibuild_noise_file="${TMPDIR}/build_noise"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiexec </dev/null >$build_noise_file 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "\n==== list of environment variables ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkienv >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "\n==== Nightly argument issues ====\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$i_FLAG" = "y" -o "$i_CMD_LINE_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -S flags do not support incremental" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "builds; forcing clobber\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki i_CMD_LINE_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$N_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -S flags do not support protocmp;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "protocmp disabled\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki N_FLAG=y
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$l_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -S flags do not support lint;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "lint disabled\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki l_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$C_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -S flags do not support cstyle;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "cstyle check disabled\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki C_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$N_FLAG" = "y" ]; then
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff if [ "$p_FLAG" = "y" ]; then
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael BergknoffWARNING: the p option (create packages) is set, but so is the N option (do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki not run protocmp); this is dangerous; you should unset the N option
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiEOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cat <<EOF | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiWarning: the N option (do not run protocmp) is set; it probably shouldn't be
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiEOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$a_FLAG" = "y" -a "$D_FLAG" = "n" -a "$F_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: Neither DEBUG nor non-DEBUG build requested, but the" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "'a' option was set." | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$D_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: DEBUG build not requested, but lint will be with" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "DEBUG enabled.\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$f_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$i_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -f flag cannot be used during incremental" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "builds; ignoring -f\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki f_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$p_FLAG" != "y" -o "$l_FLAG" != "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: the -f flag requires -l and -p; ignoring -f\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki f_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$T_FLAG" = "y" -a -d $SRC/uts/common/dtrace ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: TRACE build requested but workspace contains DTrace;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "-T will have no effect\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$t_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # We're not doing a tools build, so make sure elfsign(1) is
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # new enough to safely sign non-crypto binaries. We test
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # debugging output from elfsign to detect the old version.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki newelfsigntest=`SUNW_CRYPTO_DEBUG=stderr /usr/bin/elfsign verify \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -e /usr/lib/security/pkcs11_softtoken.so.1 2>&1 \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki | egrep algorithmOID`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -z "$newelfsigntest" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: /usr/bin/elfsign out of date;" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "will only sign crypto modules\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export ELFSIGN_OBJECT=true
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki elif [ "$VERIFY_ELFSIGN" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: VERIFY_ELFSIGN=y requires" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "the -t flag; ignoring VERIFY_ELFSIGN\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknofffi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "==== Build environment ====\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# System
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwwhence uname | tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwuname -a 2>&1 | tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwecho | tee -a $mail_msg_file >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# nightly (will fail in year 2100 due to SCCS flaw)
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "$0 $@" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "%M% version %I% 20%E%\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# make
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhence $MAKE | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$d_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $MAKE -v | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "number of concurrent jobs = $DMAKE_MAX_JOBS" |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Report the compiler versions.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -f $SRC/Makefile ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki srcroot=$SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielif [ -f $BRINGOVER_WS/usr/src/Makefile ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki srcroot=$BRINGOVER_WS/usr/src
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\nUnable to find \"Makefile\" in $BRINGOVER_WS/usr/src or $SRC." |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki( cd $srcroot
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki for target in cc-version cc64-version java-version; do
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Put statefile somewhere we know we can write to rather than trip
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # over a read-only $srcroot. Use /usr/ccs/bin/make here because
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # it supports -K and ParallelMake doesn't.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki #
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $TMPDIR/make-state
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if /usr/ccs/bin/make -K $TMPDIR/make-state -e $target 2>/dev/null; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki continue
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
aaba19e23c48a32e927f4e39464be188bfcbef37fw touch $TMPDIR/nocompiler
aaba19e23c48a32e927f4e39464be188bfcbef37fw done
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki) | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ -f $TMPDIR/nocompiler ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $TMPDIR/nocompiler
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build_ok=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Aborting due to missing compiler." |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# as
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhence as | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkias -V 2>&1 | head -1 | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Check that we're running a capable link-editor
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiwhence ld | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLDVER=`ld -V 2>&1`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho $LDVER | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiLDVER=`echo $LDVER | sed -e "s/.*-1\.//" -e "s/:.*//"`
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ `expr $LDVER \< 422` -eq 1 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "The link-editor needs to be at version 422 or higher to build" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "the latest stuff, hope your build works." | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "\nBuild project: $build_project\nBuild taskid: $build_taskid" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho "\n==== Build version ====\n" | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiecho $VERSION | tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Decide whether to clobber
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$i_FLAG" = "n" -a -d "$SRC" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Make clobber at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # remove old clobber file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/clobber.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/clobber-${MACH}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Remove all .make.state* files, just in case we are restarting
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # the build after having interrupted a previous 'make clobber'.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki find . \( -name SCCS -o -name 'interfaces.*' \) -prune \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -o -name '.make.*' -print | xargs rm -f
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $MAKE -ek clobber 2>&1 | tee -a $SRC/clobber-${MACH}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Make clobber ERRORS ====\n" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep "$MAKE:" $SRC/clobber-${MACH}.out |
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "Ignoring unknown host" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$t_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Make tools clobber at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${TOOLS}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${TOOLS}/clobber-${MACH}.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $MAKE -ek clobber 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a ${TOOLS}/clobber-${MACH}.out >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Make tools clobber ERRORS ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep "$MAKE:" ${TOOLS}/clobber-${MACH}.out \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf ${TOOLS_PROTO}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki mkdir -p ${TOOLS_PROTO}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $ROOT
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Get back to a clean workspace as much as possible to catch
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # problems that only occur on fresh workspaces.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Remove all .make.state* files, libraries, and .o's that may
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # have been ommitted from clobber.
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw # We should probably blow away temporary directories too.
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw cd $SRC
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw find . \( -name SCCS -o -name 'interfaces.*' \) -prune -o \
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw \( -name '.make.*' -o -name 'lib*.a' -o -name 'lib*.so*' -o \
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw -name '*.o' \) -print | xargs rm -f
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fwelse
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw echo "\n==== No clobber at `date` ====\n" >> $LOGFILE
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fwfi
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw
dc6ca969834c6d8d1aac19aaea19d86c5b73cf75fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Decide whether to bringover to the codemgr workspace
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$n_FLAG" = "n" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== bringover to $CODEMGR_WS at `date` ====\n" >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # sleep on the parent workspace's lock
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki while egrep -s write $BRINGOVER_WS/Codemgr_wsdata/locks
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw do
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw sleep 120
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw done
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== BRINGOVER LOG ====\n" >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki staffer $TEAMWARE/bin/bringover -c "nightly update" -p $BRINGOVER_WS \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki -w $CODEMGR_WS $BRINGOVER_FILES < /dev/null 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $mail_msg_file >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $? -eq 1 ]
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "trouble with bringover, quitting at `date`." >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exit 1
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw fi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ -d $SRC/cmd/lp/cmd/lpsched/lpsched -a \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ! -f $SRC/cmd/lp/cmd/lpsched/lpsched/Makefile ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # on297 printing
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $SRC/cmd/lp/cmd/lpsched/lpsched
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -d $SRC/cmd/localedef/localedef -a \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ! -f $SRC/cmd/localedef/localedef/Makefile ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # on297 CSI project
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -rf $SRC/cmd/localedef/localedef
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== No bringover to $CODEMGR_WS ====\n" >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# Build tools if requested
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$t_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export RELEASE_BUILD ; RELEASE_BUILD=
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki unset EXTRA_OPTIONS
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff unset EXTRA_CFLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export ONBLD_TOOLS=${ONBLD_TOOLS:=${TOOLS_PROTO}/opt/onbld}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build_tools ${TOOLS_PROTO}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwif [ "$i_FLAG" = "y" -a "$SH_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== NOT Building base OS-Net source ====\n" | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkielse
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki normal_build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiORIG_SRC=$SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiBINARCHIVE=${CODEMGR_WS}/bin-${MACH}.cpio.Z
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki save_binaries
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Retrieving SCCS files at `date` ====\n" >> $LOGFILE
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw SCCSHELPER=${TMPDIR}/sccs-helper
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw rm -f ${SCCSHELPER}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwcat >${SCCSHELPER} <<EOF
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw#!/bin/ksh
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicd \$1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkicd ..
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkisccs get SCCS >/dev/null 2>&1
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiEOF
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd $SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki chmod +x ${SCCSHELPER}
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff find . -name SCCS | xargs -L 1 ${SCCSHELPER}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f ${SCCSHELPER}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SD_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw clone_source ${CODEMGR_WS} ${CRYPT_SRC} CRYPT_SRC
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fwfi
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw# EXPORT_SRC comes after CRYPT_SRC since a domestic build will need
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# $SRC pointing to the export_source usr/src.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki clone_source ${CODEMGR_WS} ${EXPORT_SRC} EXPORT_SRC
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$SD_FLAG" = "y" ]; then
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff # drop the crypt files in place.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki cd ${EXPORT_SRC}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\nextracting crypt_files.cpio.Z onto export_source.\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> ${LOGFILE}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki zcat ${CODEMGR_WS}/crypt_files.cpio.Z | \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw cpio -idmucvB 2>/dev/null >> ${LOGFILE}
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ "$?" = "0" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== DOMESTIC extraction succeeded ====\n" \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== DOMESTIC extraction failed ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
2ea390f3bec3fff24e17f2bb5bf7457e44834af2Michael Bergknoff
aaba19e23c48a32e927f4e39464be188bfcbef37fwif [ "$SE_FLAG" = "y" -o "$SD_FLAG" = "y" -o "$SH_FLAG" = "y" ]; then
aaba19e23c48a32e927f4e39464be188bfcbef37fw # remove proto area here, since we don't clobber
aaba19e23c48a32e927f4e39464be188bfcbef37fw rm -rf "$ROOT"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$t_FLAG" = "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw export RELEASE_BUILD ; RELEASE_BUILD=
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw unset EXTRA_OPTIONS
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw unset EXTRA_CFLAGS
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki build_tools ${EXPORT_SRC}/usr/src/tools/proto
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki export EXPORT_RELEASE_BUILD ; EXPORT_RELEASE_BUILD=#
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki normal_build
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$build_ok" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Creating protolist system file at `date` ====" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki protolist $ROOT > $ATLOG/proto_list_${MACH}
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "==== protolist system file created at `date` ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $LOGFILE
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw if [ "$N_FLAG" != "y" ]; then
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw echo "\n==== Impact on packages ====\n" >> $mail_msg_file
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw # If there is a reference proto list, compare the build's proto
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # list with the reference to see changes in proto areas.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Use the current exception list.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki exc=etc/exception_list_$MACH
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $SRC/pkgdefs/$exc ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki ELIST="-e $SRC/pkgdefs/$exc"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f "$REF_PROTO_LIST" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $PROTOCMPTERSE \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki "Files in yesterday's proto area, but not today's:" \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw "Files in today's proto area, but not yesterday's:" \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw "Files that changed between yesterday and today:" \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw ${ELIST} \
1c60fca8a4c7f20e66b3fadbbd9180e37c8db195fw -d $REF_PROTO_LIST \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $ATLOG/proto_list_${MACH} \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Compare the build's proto list with current package
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # definitions to audit the quality of package definitions
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # and makefile install targets. Use the current exception list.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer PKGDEFS_LIST="-d $SRC/pkgdefs"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer $PROTOCMPTERSE \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Files missing from the proto area:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Files missing from packages:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer "Inconsistencies between pkgdefs and proto area:" \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ${ELIST} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ${PKGDEFS_LIST} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer $ATLOG/proto_list_${MACH} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerif [ "$u_FLAG" = "y" -a "$build_ok" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer staffer cp $ATLOG/proto_list_${MACH} \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer $PARENT_WS/usr/src/proto_list_${MACH}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# Update parent proto area if necessary. This is done now
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# so that the proto area has either DEBUG or non-DEBUG kernels.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# Note that this clears out the lock file, so we can dispense with
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# the variable now.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerif [ "$U_FLAG" = "y" -a "$build_ok" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Copying proto area to $NIGHTLY_PARENT_ROOT ====\n" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $LOGFILE >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # The rm -rf command below produces predictable errors if
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # nightly is invoked from the parent's $ROOT/opt/onbld/bin,
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # and that directory is accessed via NFS. This is because
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # deleted-but-still-open files don't actually disappear as
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # expected, but rather turn into .nfsXXXX junk files, leaving
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # the directory non-empty. Since this is a not-unusual usage
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # pattern, and we still want to catch other errors here, we
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # take the unusal step of moving aside 'nightly' from that
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # directory (if we're using it).
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mypath=${0##*/root_$MACH/}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$mypath" = $0 ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mypath=opt/onbld/bin/${0##*/}
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ $0 -ef $PARENT_WS/proto/root_$MACH/$mypath ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mv -f $0 $PARENT_WS/proto/root_$MACH
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer rm -rf $PARENT_WS/proto/root_$MACH/*
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer unset Ulockfile
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mkdir -p $NIGHTLY_PARENT_ROOT
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer cd $ROOT
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ( tar cf - . | ( cd $NIGHTLY_PARENT_ROOT; umask 0; tar xpf - ) ) 2>&1 |
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $mail_msg_file >> $LOGFILE
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer#
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer# do shared library interface verification
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer#
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerif [ "$A_FLAG" = "y" -a "$build_ok" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Check versioning and ABI information ====\n" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $LOGFILE >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer rm -rf $SRC/interfaces.ref
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ -d $SRC/interfaces.out ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mv $SRC/interfaces.out $SRC/interfaces.ref
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer rm -rf $SRC/interfaces.out
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mkdir -p $SRC/interfaces.out
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer intf_check -V -m -o -b $SRC/tools/abi/etc \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer -d $SRC/interfaces.out $ROOT 2>&1 | sort \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer > $SRC/interfaces.out/log
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # report any ERROR found in log file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fgrep 'ERROR' $SRC/interfaces.out/log | sed 's/^ERROR: //' | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $LOGFILE >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ ! -d $SRC/interfaces.ref ] ; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer mkdir -p $SRC/interfaces.ref
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ -d $SRC/interfaces.out ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer cp -r $SRC/interfaces.out/* $SRC/interfaces.ref
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Diff versioning warnings (since last build) ====\n" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $LOGFILE >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer out_vers=`grep ^VERSION $SRC/interfaces.out/log`;
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer ref_vers=`grep ^VERSION $SRC/interfaces.ref/log`;
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # Report any differences in WARNING messages between last
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer # and current build.
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer if [ "$out_vers" = "$ref_vers" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer diff $SRC/interfaces.ref/log $SRC/interfaces.out/log | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fgrep 'WARNING' | sed 's/WARNING: //' | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $LOGFILE >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer fi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerfi
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyerif [ "$r_FLAG" = "y" -a "$build_ok" = "y" ]; then
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer echo "\n==== Check ELF runtime attributes ====\n" | \
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer tee -a $LOGFILE >> $mail_msg_file
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer LDDUSAGE="^ldd: does not support -e"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer LDDWRONG="wrong class"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer CRLERROR="^crle:"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer CRLECONF="^crle: configuration file:"
817697f4a28f704a2d88ace09406d985aa3a8549Kelly Moyer
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rm -f $SRC/runtime.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ -f $SRC/runtime.out ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "$LDDUSAGE|$LDDWRONG|$CRLERROR|$CRLECONF" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $SRC/runtime.out > $SRC/runtime.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # If we're doing a debug build the proto area will be left with
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # debuggable objects, thus don't assert -s.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ "$D_FLAG" = "y" ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rtime_sflag=""
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki else
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki rtime_sflag="-s"
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki check_rtime -d $ROOT -i -m -o $rtime_sflag $ROOT 2>&1 | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v ": unreferenced object=$ROOT/.*/lib(w|intl|thread|pthread).so" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v ": unused object=$ROOT/.*/lib(w|intl|thread|pthread).so" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki sort >$SRC/runtime.out
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # Determine any processing errors that will affect the final output
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # and display these first.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -l "$LDDUSAGE" $SRC/runtime.out > /dev/null
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $? -eq 0 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: ldd(1) does not support -e. The version of ldd(1)" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "on your system is old - 4390308 (s81_30) is required.\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -l "$LDDWRONG" $SRC/runtime.out > /dev/null
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $? -eq 0 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: wrong class message detected. ldd(1) was unable" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "to execute an object, thus it could not be checked fully." | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Perhaps a 64-bit object was encountered on a 32-bit system," | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "or an i386 object was encountered on a sparc system?\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep -l "$CRLECONF" $SRC/runtime.out > /dev/null
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ $? -eq 0 ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "WARNING: creation of an alternative dependency cache failed." | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "Dependencies will bind to the base system libraries.\n" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep "$CRLECONF" $SRC/runtime.out | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki grep "$CRLERROR" $SRC/runtime.out | grep -v "$CRLECONF" | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n" | tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep '<dependency no longer necessary>' $SRC/runtime.out | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # NEEDED= and RPATH= are informational; report anything else that we
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # haven't already.
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "NEEDED=|RPATH=|$LDDUSAGE|$LDDWRONG|$CRLERROR|$CRLECONF" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $SRC/runtime.out | tee -a $LOGFILE >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki # probably should compare against a 'known ok runpaths' list
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki if [ ! -f $SRC/runtime.ref ]; then
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "$LDDUSAGE|$LDDWRONG|$CRLERROR|$CRLECONF" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki $SRC/runtime.out > $SRC/runtime.ref
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki fi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki echo "\n==== Diff ELF runtime attributes (since last build) ====\n" \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki egrep -v "$LDDUSAGE|$LDDWRONG|$CRLERROR|$CRLECONF" $SRC/runtime.out | \
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki diff $SRC/runtime.ref - >> $mail_msg_file
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkifi
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# For now, don't make archives or packages for GPROF/TRACE builds
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkia_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkip_FLAG=n
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki# GPROF build begins
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenki
0d63ce2b32a9e1cc8ed71d4d92536c44d66a530avenkiif [ "$i_CMD_LINE_FLAG" = "n" -a "$P_FLAG" = "y" ]; then
export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
export RELEASE_BUILD ; RELEASE_BUILD=
export EXTRA_OPTIONS ; EXTRA_OPTIONS="-DGPROF"
export EXTRA_CFLAGS ; EXTRA_CFLAGS="-xpg"
build GPROF -prof
else
echo "\n==== No GPROF build ====\n" >> $LOGFILE
fi
# GPROF build ends
# TRACE build begins
if [ "$i_CMD_LINE_FLAG" = "n" -a "$T_FLAG" = "y" ]; then
export INTERNAL_RELEASE_BUILD ; INTERNAL_RELEASE_BUILD=
export RELEASE_BUILD ; RELEASE_BUILD=
export EXTRA_OPTIONS ; EXTRA_OPTIONS="-DTRACE"
unset EXTRA_CFLAGS
build TRACE -trace
else
echo "\n==== No TRACE build ====\n" >> $LOGFILE
fi
# TRACE build ends
# DEBUG lint of kernel begins
if [ "$i_CMD_LINE_FLAG" = "n" -a "$l_FLAG" = "y" ]; then
if [ "$LINTDIRS" = "" ]; then
# LINTDIRS="$SRC/uts y $SRC/stand y $SRC/psm y"
LINTDIRS="$SRC y"
fi
set $LINTDIRS
while [ $# -gt 0 ]; do
dolint $1 $2; shift; shift
done
else
echo "\n==== No '$MAKE lint' ====\n" >> $LOGFILE
fi
# "make check" begins
if [ "$i_CMD_LINE_FLAG" = "n" -a "$C_FLAG" = "y" ]; then
# remove old check.out
rm -f $SRC/check.out
rm -f $SRC/check-${MACH}.out
cd $SRC
$MAKE -ek check 2>&1 | tee -a $SRC/check-${MACH}.out >> $LOGFILE
echo "\n==== cstyle/hdrchk errors ====\n" >> $mail_msg_file
grep ":" $SRC/check-${MACH}.out |
egrep -v "Ignoring unknown host" | \
sort | uniq >> $mail_msg_file
else
echo "\n==== No '$MAKE check' ====\n" >> $LOGFILE
fi
echo "\n==== Find core files ====\n" | \
tee -a $LOGFILE >> $mail_msg_file
find $SRC -name core -a -type f -exec file {} \; | \
tee -a $LOGFILE >> $mail_msg_file
if [ "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
echo "\n==== Diff unreferenced files (since last build) ====\n" \
| tee -a $LOGFILE >>$mail_msg_file
rm -f $SRC/unref-${MACH}.ref
if [ -f $SRC/unref-${MACH}.out ]; then
mv $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
fi
findunref $SRC ${TOOLS}/findunref/exception_list \
2>> $mail_msg_file | sort > $SRC/unref-${MACH}.out
if [ ! -f $SRC/unref-${MACH}.ref ]; then
cp $SRC/unref-${MACH}.out $SRC/unref-${MACH}.ref
fi
diff $SRC/unref-${MACH}.ref $SRC/unref-${MACH}.out >>$mail_msg_file
fi
# Verify that the usual lists of files, such as exception lists,
# contain only valid references to files. If the build has failed,
# then don't check the proto area.
CHECK_PATHS=${CHECK_PATHS:-y}
if [ "$CHECK_PATHS" = y -a "$N_FLAG" != y ]; then
echo "\n==== Check lists of files ====\n" | tee -a $LOGFILE \
>>$mail_msg_file
arg=-b
[ "$build_ok" = y ] && arg=
checkpaths $arg $ROOT 2>&1 | tee -a $LOGFILE >>$mail_msg_file
fi
if [ "$M_FLAG" != "y" -a "$build_ok" = y ]; then
echo "\n==== Impact on file permissions ====\n" \
>> $mail_msg_file
#
# Get pkginfo files from usr/src/pkgdefs
#
pmodes -qvdP \
`for d in $SRC/pkgdefs; do
if [ -d "$d" ]
then
find $d -name pkginfo.tmpl -print -o -name .del\* -prune
fi
done | sed -e 's:/pkginfo.tmpl$::' | sort -u ` >> $mail_msg_file
fi
END_DATE=`date`
echo "==== Nightly $maketype build completed: $END_DATE ====" | \
tee -a $LOGFILE >> $build_time_file
typeset -Z2 minutes
typeset -Z2 seconds
elapsed_time=$SECONDS
((hours = elapsed_time / 3600 ))
((minutes = elapsed_time / 60 % 60))
((seconds = elapsed_time % 60))
echo "\n==== Total build time ====" | \
tee -a $LOGFILE >> $build_time_file
echo "\nreal ${hours}:${minutes}:${seconds}" | \
tee -a $LOGFILE >> $build_time_file
if [ "$u_FLAG" = "y" -a "$f_FLAG" = "y" -a "$build_ok" = "y" ]; then
staffer cp ${SRC}/unref-${MACH}.out $PARENT_WS/usr/src/
#
# Produce a master list of unreferenced files -- ideally, we'd
# generate the master just once after all of the nightlies
# have finished, but there's no simple way to know when that
# will be. Instead, we assume that we're the last nightly to
# finish and merge all of the unref-${MACH}.out files in
# $PARENT_WS/usr/src/. If we are in fact the final ${MACH} to
# finish, then this file will be the authoritative master
# list. Otherwise, another ${MACH}'s nightly will eventually
# overwrite ours with its own master, but in the meantime our
# temporary "master" will be no worse than any older master
# which was already on the parent.
#
set -- $PARENT_WS/usr/src/unref-*.out
cp "$1" ${TMPDIR}/unref.merge
shift
for unreffile; do
comm -12 ${TMPDIR}/unref.merge "$unreffile" > ${TMPDIR}/unref.$$
mv ${TMPDIR}/unref.$$ ${TMPDIR}/unref.merge
done
staffer cp ${TMPDIR}/unref.merge $PARENT_WS/usr/src/unrefmaster.out
fi
#
# All done save for the sweeping up.
# (whichever exit we hit here will trigger the "cleanup" trap which
# optionally sends mail on completion).
#
if [ "$build_ok" = "y" ]; then
exit 0
fi
exit 1