# # CDDL HEADER START # # The contents of this file are subject to the terms of the # Common Development and Distribution License (the "License"). # You may not use this file except in compliance with the License. # # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE # or http://www.opensolaris.org/os/licensing. # See the License for the specific language governing permissions # and limitations under the License. # # When distributing Covered Code, include this CDDL HEADER in each # file and include the License file at usr/src/OPENSOLARIS.LICENSE. # If applicable, add the following below this CDDL HEADER, with the # fields enclosed by brackets "[]" replaced with your own identifying # information: Portions Copyright [yyyy] [name of copyright owner] # # CDDL HEADER END # # # Copyright 2006 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #ident "%Z%%M% %I% %E% SMI" LC_ALL=C export LC_ALL # Add the 'gk' account with the same password as root grep gk $BASEDIR/etc/passwd >/dev/null 2>&1 if [ "$?" != "0" ]; then echo "Installing 'gk' account" echo "gk:x:0:1:Gatekeeper:/opt/onbld/gk:/usr/bin/csh" \ >> $BASEDIR/etc/passwd grep "^root:" $BASEDIR/etc/shadow | sed -e 's/^root:/gk:/' \ >> $BASEDIR/etc/shadow fi # Back up gk's existing .make.machines file if [ "(" -f $BASEDIR/opt/onbld/gk/.make.machines ")" -a "!" "(" -f \ $BASEDIR/opt/onbld/gk/.make.machines.orig ")" ]; then echo "Backing up $BASEDIR/opt/onbld/gk/.make.machines" \ "to $BASEDIR/opt/onbld/gk/.make.machines.orig"; cp $BASEDIR/opt/onbld/gk/.make.machines \ $BASEDIR/opt/onbld/gk/.make.machines.orig; fi # Back up root's existing .make.machines file if [ "(" -f $BASEDIR/.make.machines ")" -a "!" "(" -f \ $BASEDIR/.make.machines.orig ")" ]; then echo "Backing up $BASEDIR/.make.machines to" \ "$BASEDIR/.make.machines.orig"; mv $BASEDIR/.make.machines \ $BASEDIR/.make.machines.orig; fi # Create a .make.machines file for dmake. Preserve concurrency setting # for the local machine if present. grep `uname -n` $BASEDIR/opt/onbld/gk/.make.machines >/dev/null 2>&1; if [ "$?" = "0" ]; then echo "Preserving existing dmake concurrency."; grep `uname -n` $BASEDIR/opt/onbld/gk/.make.machines \ > /tmp/.make.machines; mv /tmp/.make.machines $BASEDIR/opt/onbld/gk/.make.machines; else cpus=`psrinfo | grep on-line | wc -l`; max=`expr '(' $cpus + 1 ')' '*' 2`; speed=`psrinfo -v | head -3 | awk '/MHz/ { print $6 }'`; if [ $speed -gt "500" ]; then max=`expr $max '*' 2`; fi echo "`uname -n` max=$max" > $BASEDIR/opt/onbld/gk/.make.machines; echo "dmake concurrency set to $max."; fi # Create link for root's .make.machines. cd $BASEDIR ; ln -s opt/onbld/gk/.make.machines .make.machines >/dev/null 2>&1 ; exit 0 ;