
# Alpha Micro AMIX installation shell script
#
echo "\n\nAlpha Micro AMIX Installation Command\n"
case $1 in
	str* )	inp=$1
		;;
	rmt* )	inp=$1
		;;
	*)	echo "	1. Streamer"
		echo "	2. Magnetic tape"
		echo "\nSelect which device to load from: \c"
		read inp
		case $inp in
			1 ) inp=str0
				;;
			2 ) inp=rmt0
				;;
			* ) echo "Invalid selection.\n\n"
			    exit
				;;
		esac
		;;
esac
case $inp in
	str* )	echo "\nInstall the streamer cartridge containing the file"
		echo "system in the tape drive. Enter carriage return"
		echo "when ready: \c"
		read d
		echo < /dev/str0
		;;
	rmt* )	echo < /dev/$inp
		dd if=/dev/n$inp of=/dev/null
		dd if=/dev/n$inp of=/dev/null
		dd if=/dev/n$inp of=/dev/null
		dd if=/dev/n$inp of=/dev/null
		dd if=/dev/n$inp of=/dev/null
		;;
	*)	echo "Invalid Device!!!!!!!!!!!!!"
		exit
		;;
esac
echo "\nRestoring Root File System...."
cd /
tar -xvbf 20 /dev/$inp
echo "Updating configuration files...."
cd /etc
cp passwd_amdist passwd
cp inittab_amdist inittab
cp rc_amdist rc
cp shutdown_amdis shutdown
cp ttytype_amdist ttytype
cd /
cp /install/badblk /bin/badblk
echo "Making lost and found directory...."
/bin/mklost+found
/install/make_mail
echo "Making devices...."
/install/make_am300
sync; sync
echo "Installing boot program...."
/install/putboot 1
mkdir /dsk1
echo "Making file system on slice c...."
mkfs1b /dev/am0c 79308:8000 1 1
fsck -y /dev/am0c
echo "Checking file masks...."
/install/vchk_sh_cmds > /dev/null 2>&1
echo "\n\nAMIX installation complete."
echo "Enter date and time in the format MMDDHHMMYY"
echo ">> \c"
read d
date $d
sync; sync
echo
