
# Installation script to install 3.3 Secure Overlay

echo "\n\n**** Installation script for S90 3.3 Secure Overlay ****\n"

cd /

if [ $# -ne 2 ]
then

	echo "Enter the name of this system's rewind device ->  \c"
	read REWIND
	echo "Enter the name of this system's non-rewind device ->  \c"
	read NOREWIND
else
	REWIND=$1
	NOREWIND=$2
fi

# Position the tape past the first file

<$REWIND;<$NOREWIND

# Read in the overlay
echo "\nReading in files for the Secure Overlay\n"
/bin/cpio -ivdumB <$REWIND

sync

# Modify the system file if it needs it.
/bin/chmod 644 /etc/system
/bin/grep "sec		1" /etc/system > /dev/null
if [ $?  -eq 1 ]
then 
	/bin/cp /etc/system /tmp/system
	/usr/bin/nawk '$0 ~ "sar		1"\
		{printf ("%s\nsec		1\nsat		1\n",$0); next};\
     	{print $0} ' < /tmp/system > /etc/system
fi

# Load the man pages also...
echo "\nWould you like to install the security man pages? \c"
read YN
if [ $YN = "y" -o $YN = "Y" ]
then
	echo "\nInstalling man pages in /usr/catman\n"
	<$NOREWIND;<$NOREWIND
	cd /usr/catman
	cpio -ivdumB < $REWIND
fi


# Rebuilds kernel, required for this release
echo "\nRebuilding kernel\n"

cd /usr/sys
/bin/make install

cd /

echo "\n\nThe installation of the overlay has been completed.  Please link the"
echo "new kernel to /arix, umount the /usr slice, and reboot the system "
echo "by typing 'uadmin 2 1 0'.  "

# Three more cmds must be run to finish the transformation to secure unix.
# They are:
# 	pwconv
#	mktty_auth
#	roleconv -b < roledef
# They are run once from the script /etc/rc2.d/S03secsetup the first time the
# system changes to init level 2 after /usr is mounted.

exit 0
