Metropoli BBS
VIEWER: install MODE: TEXT (ASCII)
#
#  (C) Copyright Promise Technology, Inc., 1993
# This source file is the property of Promise Technology Inc.
# It may not be copied or distributed in any isomorphic form
# without an appropriate prior licensing arrangement with 
# Promise Technology, Inc.
#

TMPFILE=/tmp/tmp$$
TMPFILE2=${TMPFILE}2

clear
if [ ! -d /etc/conf/pack.d/kernel ]
then
	echo "Cannot determine the kernel configuration!"
	echo "Please check your system."
	exit 1
fi

strings - /bin/pwd | grep 'SCO' > /dev/null 2>&1
if [ $? = 0 ]
then
	UNIXID=SCO
	DRIVER=Driver.sco	
	PTIDISKADD=ptidiskadd.sco
	PTIGANDS=ptigands.sco
	DIR=wd
fi

strings - /bin/pwd | grep 'UNIX System V/386' > /dev/null 2>&1
if [ $? = 0 ]
then
	UNIXID="AT&T"
	DRIVER=Driver.att
	PTIDISKADD=ptidiskadd.att
	PTIGANDS=ptigands.att
	DIR=hd
fi

if [ "$UNIXID" != "SCO" -a "$UNIXID" != "AT&T" ]
then
	echo "Only SCO UNIX and AT&T UNIX are supported now!\n"
	exit 1
fi

echo "\n\nInstalling driver on your $UNIXID unix ..."

while [ 1 ]
do
	echo "\n\nIf you will install one Promise caching controller"
	echo " as the secondary hard disk controller, "
	echo " what is the IRQ of the secondary hard disk controller"
	echo " in this system (12 or 15)? (default=15)\c"
	read IRQ
	if [ "$IRQ" != "12" -a "$IRQ" != "15" -a "$IRQ" != "" ]
	then
		continue
	fi
	if [ "$IRQ" = "" ]
	then
		IRQ=15
	fi
	break
done
IRQ=15

echo "\n\n"

if [ ! -f /etc/conf/pack.d/${DIR}/Driver.ptibak ]
then
cp /etc/conf/pack.d/${DIR}/Driver.o /etc/conf/pack.d/${DIR}/Driver.ptibak
fi
#
# space.c
#
#
# DC400
#
echo " 
struct {				/* DC400 */
	int	cyl;			/* DC400 */
	int	head;			/* DC400 */
	int	sect;			/* DC400 */
} pti_param[] = {			/* DC400 */
0,0,0,		/* adapter 0 drive 0 */ /* DC400 */
0,0,0,		/* adapter 0 drive 1 */ /* DC400 */
0,0,0,		/* adapter 0 drive 2 */ /* DC400 */
0,0,0,		/* adapter 0 drive 3 */ /* DC400 */
0,0,0,		/* adapter 1 drive 0 */ /* DC400 */
0,0,0,		/* adapter 1 drive 1 */ /* DC400 */
0,0,0,		/* adapter 1 drive 2 */ /* DC400 */
0,0,0		/* adapter 1 drive 3 */ /* DC400 */
};					/* DC400 */ " > /etc/conf/pack.d/${DIR}/space.c 2>/dev/null
#
# mtune
#
if [ "$UNIXID" = "SCO" ]
then

	cp /etc/conf/cf.d/mtune /etc/conf/cf.d/mtune.ptibak 2>/dev/null
	sed -e '/NDISK/s/NDISK[ 	]*[0-9]*/NDISK	8/g' /etc/conf/cf.d/mtune > $TMPFILE 2>/dev/null
	mv $TMPFILE /etc/conf/cf.d/mtune > /dev/null 2>&1
	set `cat /etc/conf/sdevice.d/wd1`
	echo "$1	Y	$3	$4	$5	$IRQ	$7	$8	$9	0" > /etc/conf/sdevice.d/wd1
fi
if [ "$UNIXID" = "AT&T" ]
then
	set `grep hd /etc/conf/cf.d/mdevice`
	echo $3 > $TMPFILE
	sed -e 's/o//g' $TMPFILE > $TMPFILE2
	AAA=`cat $TMPFILE2`
	echo "sed -e '/hd/s/$3/$AAA/g' /etc/conf/cf.d/mdevice > $TMPFILE
	mv $TMPFILE /etc/conf/cf.d/mdevice " > $TMPFILE2
	chmod +x $TMPFILE2
	$TMPFILE2
	set `cat /etc/conf/sdevice.d/hd`
	echo "$1	$2	$3	$4	$5	$6	$7	$8	$9	0" > /etc/conf/sdevice.d/hd
	echo "$1	$2	$3	$4	$5	$IRQ	170	177	$9	0" >> /etc/conf/sdevice.d/hd
	
fi

cp $DRIVER /etc/conf/pack.d/${DIR}/Driver.o

/etc/conf/bin/idbuild 
if [ $? != 0 ]
then
	exit 1
else
cp $PTIDISKADD /bin/ptidiskadd 2>/dev/null
chmod +x /bin/ptidiskadd 2>/dev/null
cp $PTIGANDS /bin/ptigands 2>/dev/null
chmod +x /bin/ptigands 2>/dev/null

echo "\nAfter booting with the new kernel, you can "
echo " use \"ptidiskadd\" command to add the secondary hard disks."
echo "\nPress <Enter> to continue\c"
read AAA
exit 0
fi
[ RETURN TO DIRECTORY ]