:
# this script installs the new in.pmd daemon, the tty_pty.o patch, and updates
# /etc/install/patch so that showrev -p indicates that this system has been
# patched
PATH=/usr/bin:/usr/ucb
BASE=`dirname $0`
SYS=/sys/`arch -k`/OBJ

if [ -f $SYS/tty_pty.o.OLD ]
then
	echo $SYS/tty_pty.o.OLD already exists, delete it and run install again
	exit 1
elif [ -f $SYS/tty_pty.o ]
then
	echo backing up existing $SYS/tty_pty.o to $SYS/tty_pty.o.OLD
	mv $SYS/tty_pty.o $SYS/tty_pty.o.OLD
else 
	echo $SYS/tty_pty.o not found, cannot rebuild kernel on this host
fi
cp $BASE/tty_pty.o $SYS/tty_pty.o
echo new tty_pty.o installed

if [ -f /usr/etc/in.pmd ]
then
	mv /usr/etc/in.pmd /usr/etc/in.pmd.OLD
	echo backing up existing /usr/etc/in.pmd to /usr/etc/in.pmd.OLD
fi
cp $BASE/in.pmd /usr/etc/in.pmd
echo new in.pmd installed in /usr/etc
echo Livingston tty_pty.o for pmd break installed `date +%y/%m/%d` >>/etc/install/patch
cat <<EOF
Now rebuild and install kernel by running following commands as root.
Replace GENERIC with the actual name of your kernel as shown in /etc/motd:

	cd /sys/`arch -k`/GENERIC
	make
	mv /vmunix /vmunix.old
	mv vmunix /vmunix
	reboot
EOF
