home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume6
/
ptys.sco
/
INSTALL
next >
Wrap
Text File
|
1989-03-04
|
2KB
|
107 lines
: INSTALL
# Xenix pty installation.
if [ ! -f /etc/systemid ]
then
echo "This is not a Xenix system" 1>&2
exit 1
fi
if [ ! -f pty.o ]
then
echo "you must make pty.o before running INSTALL" 1>&2
exit 1
fi
PATH=/usr/sys/conf:$PATH; export PATH
cp pty.o /usr/sys/conf
# NOTE!!!!!!!!!!!!!!
# To change the number of ptys, change the value in PTYCNT
PTYCNT=`sed -n 's/.*PTYCNT//p' PTYCNT`
MASTERMINOR=`sed -n 's/.*MASTERMINOR//p' PTYCNT`
cd /usr/sys/conf
# get the first available major number.
PTYMAJOR=0
for i in `majorsinuse`
do
[ $i != $PTYMAJOR ] && break
PTYMAJOR=`expr $i + 1`
done
configure -a ptyopen ptyclose ptyread ptywrite ptyioctl -m $PTYMAJOR -c
if [ $? -ne 0 ]
then
echo "pty cannot be added to the master file" 1>&2
exit 1
fi
if [ $? -ne 0 ]
then
echo "support files not updated" 1>&2
exit 1
fi
# make the pty device files in /dev
LETTER=p
cnt=0
while [ $cnt -lt $PTYCNT ]
do
for y in 0 1 2 3 4 5 6 7 8 9 a b c d e f
do
i=$LETTER$y
if [ $cnt -ge ${PTYCNT} ]
then
break
fi
[ -c /dev/pty$i ] && rm -f /dev/pty$i
[ -c /dev/tty$i ] && rm -f /dev/tty$i
/etc/mknod /dev/pty$i c ${PTYMAJOR} \
`expr $cnt + $MASTERMINOR` &&
/etc/mknod /dev/tty$i c ${PTYMAJOR} $cnt ||
exit 1
chmod 666 /dev/pty$i /dev/tty$i
chown root /dev/pty$i /dev/tty$i
chgrp root /dev/pty$i /dev/tty$i
cnt=`expr $cnt + 1`
done
LETTER=`echo $LETTER | tr '[a-z][A-Y]' '[b-z][A-Z]'`
done
# add pty.o to the link_xenix script
if fgrep pty.o link_xenix >/dev/null
then
: fine
else
ed - link_xenix <<'-EOF'
/kid\.o/s//kid.o pty.o/
w
EOF
fi
# relink the kernel
sh -v link_xenix || exit 1
# tell the user what to do next
echo ""
echo "The new kernel with ptys has been linked as /usr/sys/conf/xenix."
echo "To make this kernel the default, type the following commands:"
echo " mv /xenix /xenix.prev"
echo " ln /usr/sys/conf/xenix /"
echo ""