|
|
DataMuseum.dkPresents historical artifacts from the history of: Regnecentalen RC-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Regnecentalen RC-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: I T U
Length: 8771 (0x2243)
Types: TextFile
Notes: UNIX file
Names: »INSTALL«
└─⟦f660c3862⟧ Bits:30004068/disk1.imd Interactive TCP/IP v.1.2
└─⟦f660c3862⟧ UNIX Filesystem
└─⟦this⟧ »install/INSTALL«
#
# Copyrighted as an unpublished work.
# (c) Copyright 1987 INTERACTIVE Systems Corporation
# All rights reserved.
#
# RESTRICTED RIGHTS
#
# These programs are supplied under a license. They may be used,
# disclosed, and/or copied only as permitted under such license
# agreement. Any copy must contain the above copyright notice and
# this restricted rights notice. Use, copying, and/or disclosure
# of the programs is strictly prohibited unless otherwise provided
# in the license agreement.
#
#ident "@(#)INSTALL.sh 2.20 - 90/01/31"
#
# find mount device
#
if test -b "$1"
then
mntdev=$1
elif test -b /dev/diskette
then
mntdev=/dev/diskette
elif test -b /dev/install
then
mntdev=/dev/install
else
echo "**ERROR** Can't find mount device"
exit
fi
mntname="${2:-/install}"
#
# Get the packages on this diskette
#
MNTPATH=/install export MNTPATH
INSDIR=/usr/lib/installed
INSPATH=/install
CONF=/etc/conf
cwd=`pwd`
alreadyinstalled=0
cd $INSPATH
pkgs=`echo * | sed 's/install//'` export pkgs
set $pkgs
nbrpkgs=$# export nbrpkgs
cd $cwd
MINSTALL=$MNTPATH/install/MINSTALL
if [ -f $MINSTALL ]
then
PKGS=/tmp/PKGS$$ export PKGS
sh $MINSTALL
pkgs=`cat $PKGS`
rm -rf $PKGS
fi
for pkg in $pkgs
do
NAMEFILE=$MNTPATH/$pkg/install/$pkg.name
if [ -r $MNTPATH/$pkg/install/BUGFIX ]
then
SUBSET=`cat $MNTPATH/$pkg/install/BUGFIX`
if [ -f /usr/options/$SUBSET ]
then
PKGNAME="UPDATE $pkg to `cat /usr/options/$SUBSET`"
else
PKGNAME=`cat $NAMEFILE`
fi
else
PKGNAME=`cat $NAMEFILE`
fi
echo Install ${PKGNAME:-$pkg}? "(y): \c"
read resp
[ "$resp" = "n" -o "$resp" = "N" ] && continue
if [ -f $MNTPATH/$pkg/install/.auth ]
then
while :
do
if /etc/.auth $pkg
then
break
else
echo 'INCORRECT AUTHORIZATION KEY; try again? (y): \c'
read resp
if [ "$resp" = "n" -o "$resp" = "N" ]
then
echo 'CANNOT INSTALL' ${PKGNAME:-$pkg}
continue 2
fi
fi
done
fi
INSPATH=$MNTPATH/$pkg/new
DRIVER=$MNTPATH/$pkg/driver
export PKGNAME
LAST=`cat $MNTPATH/$pkg/install/NBRDISKS`
echo "Installing ${PKGNAME}."
[ -x $MNTPATH/$pkg/install/copyright ] && /bin/sh $MNTPATH/$pkg/install/copyright
expect=1
while [ "$expect" -le "$LAST" ]
do
if [ "$expect" -gt 1 ]
then
cd /
/etc/umount $mntdev 2>/dev/null
echo "Remove floppy and insert floppy number $expect"
echo "Type <return> when ready: \c"
read answer
/etc/mount $mntdev $mntname -r 2>/dev/null
else
if [ "$expect" -eq 1 -a -r /usr/options/$pkg.name ]
then
echo "**WARNING** The `cat /usr/options/$pkg.name` is already installed"
answer=""
alreadyinstalled=1
while [ "$answer" != y -a "$answer" != n ]
do
echo "Type 'y' to overwrite the ${PKGNAME} or \c"
echo "'n' quit: \c"
read answer
done
case $answer in
y) ;;
n) cd /
/etc/umount $mntdev 2>/dev/null
exit 1;;
esac
fi
fi
if [ -r $MNTPATH/$pkg/install/BUGFIX ]
then
OVERWRITE=
SUBSET=`cat $MNTPATH/$pkg/install/BUGFIX`
if cat /usr/options/$SUBSET 2>/dev/null|grep $pkg >/dev/null 2>&1
then
echo "**WARNING** The `cat /usr/options/$SUBSET` is already installed"
answer=""
alreadyinstalled=1
while [ "$answer" != y -a "$answer" != n ]
do
echo "Type 'y' to overwrite ${PKGNAME} or \c"
echo "'n' quit: \c"
read answer
done
case $answer in
y) OVERWRITE=yes;;
n) cd /
/etc/umount $mntdev 2>/dev/null
exit 1;;
esac
fi
fi
#
# Check to make sure that this floppy belongs to the package
#
if [ ! -r $MNTPATH/$pkg/install/BUGFIX ]
then
while [ ! -s $NAMEFILE -o "${PKGNAME}" != "`cat $NAMEFILE`" ]
do
echo "**ERROR** Floppy does not belong to the ${PKGNAME}"
cd /
/etc/umount $mntdev 2>/dev/null
echo "Remove floppy and insert correct floppy"
echo "Type <return> when ready: \c"
read answer
/etc/mount $mntdev $mntname -r 2>/dev/null
done
fi
#
# Check to make sure this is the correct floppy of the set
#
answer=""
while [ "`cat $MNTPATH/$pkg/install/ORDER`" != "$expect" -a "$answer" != y ]
do
echo "**WARNING** Floppy out of sequence"
echo "Expecting floppy diskette number $expect"
while [ "$answer" != y -a "$answer" != n ]
do
echo "Type 'y' to continue or \c"
echo "'n' to try another floppy: \c"
read answer
done
case $answer in
n) cd /
/etc/umount $mntdev 2>/dev/null
echo "Remove floppy and insert correct floppy"
echo "Type <return> when ready: \c"
read answer
answer=""
/etc/mount $mntdev $mntname -r 2>/dev/null
;;
y) expect=`cat $MNTPATH/$pkg/install/ORDER`
;;
esac
done
#
# Verify dependencies loaded
#
#
# Verify that there is space for the package.
#
if [ "$expect" -eq 1 -a -x $MNTPATH/$pkg/install/dependencies ]
then
if /bin/sh $MNTPATH/$pkg/install/dependencies
then :
else
exit 1
fi
fi
if /etc/mount | grep /usr >/dev/null 2>&1
then
USRneeds=`expr "\`du -s ${INSPATH}/usr\`" : "\([0-9]*\).*"`
USRspace=`expr "\`df /usr 2>/dev/null\`" : '.*: *\([0-9]*\)'`
if
[ $alreadyinstalled -eq 0 -a "$USRspace" -lt "$USRneeds" ]
then
echo "**ERROR** ${PKGNAME} cannot be installed --"
echo "Not enough space on the hard disk."
echo "There are $USRspace blocks available"
echo "on the /usr file system --"
echo "$USRneeds blocks are needed."
exit
fi
else
USRneeds=0
fi
if expr `ls -a ${DRIVER} | wc -l` \> 2 >/dev/null
then
ROOTneeds=`expr "\`du -s ${DRIVE}\`" : "\([0-9]*\).*"`
drexist=1
else
ROOTneeds=0
drexist=0
fi
ROOTneeds=`expr "\`du -s ${INSPATH}\`" : "\([0-9]*\).*"`
ROOTneeds=`expr ${ROOTneeds} - ${USRneeds}`
ROOTspace=`expr "\`df / 2>/dev/null\`" : '.*: *\([0-9]*\)'`
if
[ $alreadyinstalled -eq 0 -a "${ROOTspace:-2000}" -lt "$ROOTneeds" ]
then
echo "**ERROR** ${PKGNAME} cannot be installed --"
echo "Not enough space on the hard disk."
echo "There are $ROOTspace blocks available"
echo "on the / (root) file system --"
echo "$ROOTneeds blocks are needed."
exit
fi
# Do special work before files are copied in.
trap "trap '' 1 2 3 9 15; rm -f /tmp/*$$; exit 1" 1 2 3
if [ "$expect" -eq 1 ]
then
cp $MNTPATH/$pkg/install/Rlist.$pkg /tmp/Files$$
cp $MNTPATH/$pkg/install/Remove /tmp/Remove$$
if [ -f $MNTPATH/$pkg/install/preinstall ]
then . $MNTPATH/$pkg/install/preinstall
fi
fi
if [ "$drexist" = 1 ]
then
cd ${DRIVER}
echo "Installing driver(s): please wait"
for dir in `ls`
do
cd $dir
${CONF}/bin/idcheck -p $dir > /dev/null 2>&1
# delete the old driver configuration files, so that
# the major device number is recalculated
if [ $? != 0 ]
then
${CONF}/bin/idinstall -k -d $dir >/dev/null 2>&1
fi
${CONF}/bin/idinstall -k -a $dir
if [ $? != 0 ]
then
echo "\n\tThe installation cannot be completed due to an error in the '$dir' driver installation."
exit 1
fi
cd ..
done
fi
if expr `ls -a ${INSPATH} | wc -l` \> 2 >/dev/null
then
cd ${INSPATH}
echo "The following files are being installed:"
find . -print | cpio -pduvm /
fi
# Do special work after files are copied in.
cd $MNTPATH/$pkg/install
if [ -f link ]
then
. ./link
fi
if [ -f setup ]
then
. ./setup
fi
echo "Floppy diskette number $expect is complete"
expect=`expr $expect + 1`
done
# Do special work after files are copied in.
cd $MNTPATH/$pkg/install
if [ -f postinstall ]
then
. ./postinstall
fi
if [ ! -d /usr/options ]
then
mkdir /usr/options
chmod 755 /usr/options
fi
if [ -r $MNTPATH/$pkg/install/BUGFIX ]
then
SUBSET=`cat $MNTPATH/$pkg/install/BUGFIX`
if [ -f /usr/options/$SUBSET ]
then
CONTENT=`cat /usr/options/$SUBSET`
else
CONTENT=`cat $NAMEFILE`
fi
if [ "$OVERWRITE" != "yes" ]
then
echo "$CONTENT, UPDATE $pkg" >/usr/options/$SUBSET
fi
else
echo "$PKGNAME" >/usr/options/$pkg.name
chmod 744 /usr/options/$pkg.name
fi
if [ ! -d ${INSDIR} ]
then
mkdir ${INSDIR}
chmod 755 ${INSDIR}
fi
if [ ! -d ${INSDIR}/Files ]
then
mkdir ${INSDIR}/Files
chmod 755 ${INSDIR}/Files
fi
mv /tmp/Files$$ ${INSDIR}/Files/$pkg.name
if [ ! -d ${INSDIR}/Remove ]
then
mkdir ${INSDIR}/Remove
chmod 755 ${INSDIR}/Remove
fi
mv /tmp/Remove$$ ${INSDIR}/Remove/$pkg.name
echo "Installation of ${PKGNAME} is complete."
cd $cwd
done
exit