#!/bin/sh BASE=/a ADMIN_FILE=/a/tmp/admin # Create a temporary package administration file, to force the pkgadd(1M) # command not to perform checks (and prompt for questions) when installing # a package. # This enables you to maintain a hand-off installation when you are adding # packages. cat >${ADMIN_FILE} <>$FILE 148.88.8.6 EOT # Netmasks FILE=$BASE/etc/netmasks cp $FILE $FILE.`date +%Y%m%d` cat <$FILE # # The netmasks file associates Internet Protocol (IP) address # masks with IP network numbers. # # network-number netmask # # Both the network-number and the netmasks are specified in # "decimal dot" notation, e.g: # # 128.32.0.0 255.255.255.0 # 148.88.0.0 255.255.0.0 10.8.0.0 255.248.0.0 10.20.0.0 255.255.0.0 10.22.3.0 255.255.255.0 10.32.0.0 255.255.0.0 10.33.0.0 255.255.0.0 10.34.0.0 255.255.0.0 10.36.0.0 255.255.0.0 10.38.0.0 255.255.0.0 EOT # copy static bash (for root shell) FILE=$BASE/sbin/bash if [ ! -f $FILE ] then cp $MNT/static-bash/bash $FILE chown root:root $FILE chmod 555 $FILE fi # System File FILE=$BASE/etc/system if [ -f $FILE ] then if grep -c "noexec_user_stack" $FILE >/dev/null then false else cp $FILE $FILE.`date +%Y%m%d` cat <>$FILE * Foil certain classes of bug exploits set noexec_user_stack = 1 * Log attempted exploits set noexec_user_stack_log = 1 EOT fi fi # should do $BASE/etc/passwd for root shell # set the system console to be vt100 FILE=$BASE/etc/inittab if [ -f $FILE ] then cp $FILE $FILE.`date +%Y%m%d` sed '/^co:/ s/-T sun/-T vt100/' <$FILE >$FILE.$$ mv $FILE.$$ $FILE fi # configure xntpd FILE=$BASE/etc/inet/ntp.conf if [ ! -f $FILE ] then cat <$FILE # Config file for xntpd # 22/01/01 - steveb updated this for 4-way peering server ntp0.lancs.ac.uk server ntp1.lancs.ac.uk server ntp2.lancs.ac.uk server ntp3.lancs.ac.uk driftfile /var/ntp/ntp.drift EOT fi # Remove sendmail # If we want mail functionality we'll install exim # disabled this because it *still* asks for confirmation # /usr/sbin/pkgrm -a ${ADMIN_FILE} -A -R ${BASE} SUNWsndmu SUNWsndmr # Disable power management touch /a/noautoshutdown # install solaris style packages DIR=$MNT/pkg for p in `cat $DIR/PACKAGELIST` do pkg=`basename $p` /usr/sbin/pkgadd -a ${ADMIN_FILE} -d ${MNT} -R ${BASE} $pkg done # copy dumb packages across DIR=$BASE/usr/local/packages mkdir -p $DIR ( cd $MNT/packages && tar cf - . ) | ( cd $DIR && tar xfp - ) # do the installs for the packages for p in `cat $DIR/PACKAGELIST` do echo "Installing '$p'" for d in bin sbin do [ ! -d "$BASE/usr/local/$d" ] && mkdir -p $BASE/usr/local/$d echo "$p/$d" # install user progs for x in $DIR/$p/$d/* do echo "$x" file=`basename $x` case "$file" in "install.sh") ;; "$p.init") ;; *) # if [ "$file" != "install.sh" -a ! -f "$BASE/usr/local/$d/$file" ] if [ ! -f "$BASE/usr/local/$d/$file" ] then echo "linking /usr/local/$d/$file to ../packages/$p/$d/$file" ln -s ../packages/$p/$d/$file $BASE/usr/local/$d/$file fi ;; esac done done [ -f $DIR/$p/sbin/install.sh ] && $DIR/$p/sbin/install.sh $BASE [ -f $DIR/$p/DELETEME-AFTER-INSTALL ] && rm -rf $DIR/$p echo "Finished installing '$p'" done # Tidy up umount ${MNT} rmdir ${MNT}