|
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 - download
Length: 8070 (0x1f86) Types: TextFile Notes: UNIX file Names: »INSTALL«
└─⟦104d96909⟧ Bits:30004765 SW95718I UNIX LAN Server Rel. 1.1 └─⟦104d96909⟧ 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.9 - 89/04/25" # # 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 # INSDIR=/usr/lib/installed INSPATH=/install CONF=/etc/conf cwd=`pwd` alreadyinstalled=0 cd $INSPATH set `ls -d ??` cd $cwd nbrpkgs=$# pkgs="$*" for pkg in $pkgs do NAMEFILE=/install/$pkg/install/$pkg.name if [ -r /install/$pkg/install/BUGFIX ] then SUBSET=`cat /install/$pkg/install/BUGFIX` PKGNAME="UPDATE $pkg to `cat /usr/options/$SUBSET`" else PKGNAME=`cat $NAMEFILE` fi echo Install ${PKGNAME:-$pkg}? "(y): \c" read resp [ "$resp" = "n" -o "$resp" = "N" ] && continue INSPATH=/install/$pkg/new DRIVER=/install/$pkg/driver export PKGNAME LAST=`cat /install/$pkg/install/NBRDISKS` echo "Installing ${PKGNAME}." [ -x /install/$pkg/install/copyright ] && /bin/sh /install/$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 /install/$pkg/install/BUGFIX ] then OVERWRITE= SUBSET=`cat /install/$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 /install/$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 /install/$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 /install/$pkg/install/ORDER` ;; esac done # # Verify dependencies loaded # # # Verify that there is space for the package. # if [ "$expect" -eq 1 -a -x /install/$pkg/install/dependencies ] then if /bin/sh /install/$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 /install/$pkg/install/Rlist.$pkg /tmp/Files$$ cp /install/$pkg/install/Remove /tmp/Remove$$ if [ -f /install/$pkg/install/preinstall ] then . /install/$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 if [ $? != 0 ] then if [ -d ${CONF}/pack.d/$dir ] then ${CONF}/bin/idinstall -u -k $dir else ${CONF}/bin/idinstall -a -k $dir fi else ${CONF}/bin/idinstall -a -k $dir >/dev/null 2>&1 fi 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 /install/$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 /install/$pkg/install if [ -f postinstall ] then . ./postinstall fi if [ ! -d /usr/options ] then mkdir /usr/options chmod 755 /usr/options fi if [ -r /install/$pkg/install/BUGFIX ] then SUBSET=`cat /install/$pkg/install/BUGFIX` CONTENT=`cat /usr/options/$SUBSET` 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