|
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: 8453 (0x2105) Types: TextFile Notes: UNIX file Names: »INSTALL«
└─⟦0f0f313e4⟧ Bits:30004764 SW95709I.2F TCP/IP Update 1 └─⟦0f0f313e4⟧ UNIX Filesystem └─⟦this⟧ »install/INSTALL«
# (c) Copyright 1990 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. # # @(#)INSTALL 2.40 - 90/10/19 getpkgname() { # set the packagename strings NAMEFILE=$MNTPATH/$pkg/install/$pkg.name if [ -f $MNTPATH/$pkg/install/BUGFIX ] then SUBSET=`cat $MNTPATH/$pkg/install/BUGFIX` PKGNAME="UPDATE $pkg to `cat /usr/options/$SUBSET`" else PKGNAME=`cat $NAMEFILE` fi export PKGNAME } getmulti() { # sets $pkgs string to what user wants to install ALLPKGS=$pkgs SCREEN=/tmp/SCREEN$$ nbrpkgs=$1 echo "This Package Contains the following: \n" > $SCREEN npkg=0 for pkg in $ALLPKGS do getpkgname npkg=`expr $npkg + 1` echo " ${npkg}. ${PKGNAME:-$pkg}"| sed 's/-[ ]*Version.*$//'>> $SCREEN done [ -x /usr/bin/tput ] && tput clear cat $SCREEN rm -f $SCREEN echo "\nEnter a list of numbers separated by spaces for those modules" echo "you wish to install, or enter <RETURN> to install all modules: \c" read zz if [ "$zz" = "all" -o "$zz" = "" ]; then return 0; fi echo pkgs= pkgnum=1 for pkg in $ALLPKGS do set $zz while [ -n "$1" ] do if [ "$1" = "$pkgnum" ] then pkgs="$pkgs $pkg" break fi shift done pkgnum=`expr $pkgnum + 1` done } yesorno() { # return 0 for yes, 1 for no QUESTION="$*" while : do echo "$QUESTION (y/n)? \c" read ans case "$ans" in y*|Y*) return 0 ;; n*|N*) return 1 ;; *) echo '\nPlease answer "y" or "n".\n' ;; esac done } adddriver () { # ask about a driver and configure it in if desired. cd /etc/drivers/$1 || return 1 [ -f description ] && cat description >> $CONF/kconfig.d/description ${CONF}/bin/idcheck -p $1 > /dev/null 2>&1 if [ $? != 0 ] then # delete the old driver configuration files, so that # the major device number is recalculated ${CONF}/bin/idinstall -k -d $1 >/dev/null 2>&1 fi ${CONF}/bin/idinstall -k -a $1 >/dev/null 2>&1 if [ $? != 0 ] then echo "\n\tThe installation may not complete due to an error in the" echo "$1 driver installation." return 1 fi } getdisk() { # use $1 as package name, $2 is disk to ask for. cd / while : do /etc/umount $MNTDEV 2>/dev/null echo "Please remove the floppy from the drive and insert" echo "The $1 $2." echo "Type <return> when ready: \c" read answer /etc/mount $MNTDEV $MNTPATH -r && break echo "\n WARNING▶07◀▶07◀\nThis is not the correct disk." done } confirmupdate() { # see if this is already installed, ask user [ -f /usr/options/$pkg.name ] || return 0 alreadyinstalled=1 echo "\t\t**WARNING**▶07◀▶07◀" cat /usr/options/$pkg.name echo "is already installed" yesorno "Do you want to replace this package with\n$PKGNAME" || return 1 return 0 } cantinstall() { # give message about it echo "\t\t**ERROR**▶07◀▶07◀" echo ${PKGNAME} echo "cannot be installed -- Not enough space on the hard disk." echo "There are $2 blocks available on the $1 filesystem --" echo "$3 blocks are needed." } checkspace() { # see if there's enough disk for $1 package ROOTneeds=0 if [ $alreadyinstalled -eq 1 ] then updatespace=`expr "\`df / 2>/dev/null\`" : '.*: *\([0-9]*\)'` [ "$updatespace" -ge 2000 ] && return 0 cantinstall "" $updatespace "At least 2000" return 1 fi while read blocks fsname do if /etc/mount | grep /$fsname >/dev/null 2>&1 then space=`expr "\`df /$fsname 2>/dev/null\`" : '.*: *\([0-9]*\)'` if [ "$space" -le "$blocks" ] then cantinstall /$fsname $space $blocks return 1 fi else ROOTneeds=`expr $ROOTneeds + $blocks` fi done < $MNTPATH/$pkg/install/TOTALSIZE [ $? -eq 1 ] && return 1 ROOTspace=`expr "\`df / 2>/dev/null\`" : '.*: *\([0-9]*\)'` if [ "$ROOTspace" -lt "$ROOTneeds" ] then cantinstall root $ROOTneeds $ROOTspace return 1 fi return 0 } getmntdev() { # find mount device for MNTDEV in $1 /dev/diskette /dev/install do [ -b $MNTDEV ] && return 0 done echo "**ERROR** Can't find mount device" exit 1 } getpkgorder() { # put packages in the correct order if [ -f install/MULSUBS ] then # multiple subsets pkgs=`cat install/MULSUBS` else # just one pkgs=`ls | sed '/install/d'` fi export pkgs } runif() { # run a script if it's there, with any arguments supplied [ -f $SCRIPTS/$1 ] || return 0 /bin/sh $SCRIPTS/$1 $2 return $? } # START HERE: $0 called with $1 and $2 getmntdev $1 export MNTDEV MNTPATH=${2:-/install}; export MNTPATH INSDIR=/usr/lib/installed CONF=${CONF:-/etc/conf}; export CONF SCRIPTS=/tmp/instpkg$$ [ -d ${INSDIR} ] || mkdir ${INSDIR} && chmod 755 ${INSDIR} [ -d ${INSDIR}/Files ] || mkdir ${INSDIR}/Files && chmod 755 ${INSDIR}/Files [ -d ${INSDIR}/Remove ] || mkdir ${INSDIR}/Remove && chmod 755 ${INSDIR}/Remove [ -x /usr/lbin/uncompress ] || cp $MNTPATH/install/uncompress /usr/lbin [ -x /usr/lbin/compress ] || ln /usr/lbin/uncompress /usr/lbin/compress [ -x /usr/lbin/zcat ] || ln /usr/lbin/uncompress /usr/lbin/zcat # setup list of packages (default, only one) cd $MNTPATH # Get the packages on this diskette # disks with more than one subset have a file specifying the order they # get installed in. getpkgorder set $pkgs nbr=$# [ $nbr -gt 1 ] && getmulti $nbr cd / for pkg in $pkgs do export pkg alreadyinstalled=0 thisdisk=1 getpkgname if [ $nbr -eq 1 ] then yesorno "Install $PKGNAME" || continue fi confirmupdate || continue checkspace $pkg || continue # copy all the scripts off the disk. (delete scripts from the last set) trap "trap '' 1 2 3 9 15; rm -rf $SCRIPTS; exit 1" 1 2 3 rm -fr $SCRIPTS mkdir -p $SCRIPTS cp $MNTPATH/$pkg/install/* $SCRIPTS runif dependencies || continue runif auth $pkg || continue runif copyright runif preinstall || continue lastdisk=`cat $SCRIPTS/NBRDISKS` # save the old /etc/drivers [ -d /etc/drivers ] && mv /etc/drivers /etc/drivers.$$ while : do cd $MNTPATH/$pkg/new echo "Installing $PKGNAME" echo "The following files are being installed:" # cpio in the world (don't munge existing directories) find . -print | while read dirname do zname=`expr $dirname : './\(.*\).Z$'` >/dev/null 2>&1 if [ -z "$zname" ] then fname=`expr $dirname : './\(.*\)'` >/dev/null 2>&1 echo /$fname >/dev/tty else echo /$zname >/dev/tty fi [ -d /$dirname ] || echo $dirname done | cpio -pduvm / > $SCRIPTS/newfiles.$thisdisk # uncompress them in the background cd / while read zname do uncompress -f /$zname 2>/dev/null done < $SCRIPTS/newfiles.$thisdisk & if [ -d ${MNTPATH}/$pkg/special ] then runif specinstall case $? in 0);; 1) continue ;; # go to next disk 2) break ;; # go to next subset esac fi # get the next disk if there is one [ $thisdisk -eq $lastdisk ] && break thisdisk=`expr $thisdisk + 1` getdisk "$PKGNAME" "Disk Number $thisdisk" while [ $thisdisk != "`cat $MNTPATH/$pkg/install/ORDER`" -o \ "$PKGNAME" != "`cat $MNTPATH/$pkg/install/$pkg.name`" ] do echo "ERROR: Wrong disk" getdisk "$PKGNAME" "Disk Number $thisdisk" done done # end of multidisk loop # update|create $pkg.name if [ -f $SCRIPTS/BUGFIX ] then CONTENT=`cat /usr/options/$SUBSET` echo "$CONTENT, UPDATE $pkg" >/usr/options/$SUBSET else rm -f /usr/options/$pkg.name mv $SCRIPTS/$pkg.name /usr/options fi # wait for uncompression (in background) to finish and cleanup after wait # install drivers if [ -f $SCRIPTS/drivers ] then echo "Installing driver(s)" rm -f $INSDIR/Files/$pkg.drvrs while read driv do adddriver $driv done < $SCRIPTS/drivers fi cd / runif link # Rlist is the list of installed files. Remove/pkg.name is the script # don't install them for BUGFIX subsets. removing them may hose you. if [ ! -f $SCRIPTS/BUGFIX ] then cp $SCRIPTS/Rlist.$pkg ${INSDIR}/Files/$pkg.name cp $SCRIPTS/Remove ${INSDIR}/Remove/$pkg.name fi runif setup # this is for backward compatibility runif postinstall # cleanup and restore the old /etc/drivers runif cleanup rm -rf /etc/drivers $SCRIPTS [ -d /etc/drivers.$$ ] && mv /etc/drivers.$$ /etc/drivers echo "Installation of ${PKGNAME} is complete." done # end of pkg loop exit 0