DataMuseum.dk

Presents historical artifacts from the history of:

Regnecentalen RC-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Regnecentalen RC-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦7487998d1⟧ TextFile

    Length: 21903 (0x558f)
    Types: TextFile
    Notes: UNIX file
    Names: »INSTALL«

Derivation

└─⟦19aea28d9⟧ Bits:30004649 ISC 3.0.1 Patch Disk Rel. 2.0 (5.25 inch)
└─⟦19aea28d9⟧ UNIX Filesystem
    └─⟦this⟧ »install/INSTALL« 
└─⟦5a9f1bdbd⟧ Bits:30004698 RC900 Environment Rel. 2.0 (5.25 inch)
└─⟦5a9f1bdbd⟧ UNIX Filesystem
    └─⟦this⟧ »install/INSTALL« 
└─⟦a1684274c⟧ Bits:30004650 ISC 3.0.1 Patch Disk Rel. 2.0 (3.5 inch)
└─⟦a1684274c⟧ UNIX Filesystem
    └─⟦this⟧ »install/INSTALL« 
└─⟦de58d8f44⟧ Bits:30004699 RC900 Environment Rel. 2.0 (3.5 inch)
└─⟦de58d8f44⟧ UNIX Filesystem
    └─⟦this⟧ »install/INSTALL« 

TextFile

#      Copyrighted as an unpublished work.
#      (c) Copyright INTERACTIVE Systems Corporation 1991
#      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	2.63 - 91/09/19"
#
UIaware=${UIaware:-0}
PART2ok=${PART2ok:-no}
[ "${UIaware}" -eq 1 ] && export UIaware BEEP pkgs PART2ok	# UI tag
UIout=/tmp/UIout.$$
#
# NOTE: UI-awareness must be tested on both sides!
# The "UIaware=1" flag means that this script was invoked by a system
# with an active UI server (who will handle output requests to the screen)
#
# However, we must also check that the component scripts that are
# run during the course of installation are also "UI-aware",
# i.e., that if they require user input, it is handled in a UI-approved
# manner (using the proper ui calls instead of "echo/read's").
# The latter check is done by searching the package's "copyright" script
# for the "UIaware" flag; if it is found, the "PART2ok" var is set to "yes"
# It is assumed that *all* the package's scripts are UI-aware.
#
printv() { # if INSTALL was invoked by sysadm/UI, we cannot just echo
           # information to the screen.  When we enter INSTALL, the file
           # listing window has been displayed/selected, and we are at
           # cursor position 0,0.  To display messages, use this function.
	if [ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ]
	then
		ui print \"${1}\\\n\" >&3
	else
		echo "${1}" >&3
	fi
}
getpkgname() { # set the packagename strings
	if [ -f $MNTPATH/$pkg/install/BUGFIX ]
	then
		SUBSET=`cat $MNTPATH/$pkg/install/BUGFIX`
	fi
	PKGNAME=`cat $MNTPATH/$pkg/install/${pkg}.name`
	export PKGNAME
}
chk4input() {   # Check the copyright script for the "UIaware" flag.  If it
		# exists, we assume that *all* the installation scripts
		# know about ui, and set the PART2ok flag to "yes".  Then
		# the script output will be captured & displayed in a ui
		# window; otherwise, the screen will be cleared and the
		# scripts run in a subshell.
# initialize PART2ok flag
	PART2ok=no              # hedge our bets ...

# FK, check all for the time being
	for i in preinstall setup postinstall unsetup puninstall cleanup
	do
		test -f $MNTPATH/$pkg/install/$i || continue
		grep 'UIaware' $MNTPATH/$pkg/install/$i >/dev/null 2>&1 ||
			return
	done
# FK, end
	[ ! -f $MNTPATH/$pkg/install/copyright ] && return

	if grep "UIaware" $MNTPATH/$pkg/install/copyright >/dev/null 2>&1
	then
	    PART2ok=yes
	fi
}
getmulti() { # sets $pkgs string to what user wants to install
	ALLPKGS=$pkgs		# not used by sysadm/UI - package is done
	SCREEN=/tmp/SCREEN$$	# via a separate form; the "$pkgs" variable
	nbrpkgs=$1		# is set by the time we get here!
	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 want to install, or enter \"n\" for NONE, or enter \"all\" to"
	echo "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 2>/dev/null || 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
	# FK, added -e so SCO doesn't destruct the floppy disk
	${CONF}/bin/idinstall -k -a -e $1 >/dev/null 2>&1 
	if [ $? != 0 ]
	then
		if [ "${UIaware}" -eq 1 ]
		then
			ui variable set Object \"${1}\"
			show_message %drvErr %drvErrH
		else
			echo "\n\tThe installation may not complete due to an error in the"
			echo "$1 driver installation."
		fi
  		return 1
	fi
}

# Get the next diskette of an installable package.
# Returns 1 if user cancelled installation, 0 if diskette in drive.
getdisk() { # use $1 as package name, $2 is disk to ask for.
	cd /
	while :
	do
		/etc/umount $MNTDEV >/dev/null 2>&1
		if [ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ]
		then
			[ "${BEEP}" = "yes" ] && ui beep
			pkgname=`expr "${1}" : '^\(.\{1,70\}\).*$'`
			ui call chgdsk_do \"$pkgname\" \"$2\"
			ui cancelled || return 1

			# make sure diskette is in drive and is accessible
			diskette_ok -r $MNTDEV || return 1
		else
			echo "Please remove the floppy from the drive and insert"
			echo "The $1 $2."
			echo "Type <return> when ready: \c"
			read answer
		fi
		/etc/mount -r $MNTDEV $MNTPATH && break
		if [ "${UIaware}" -eq 1 -a "${PART2ok}" -eq "yes" ]
		then
			show_message %wrgDsk %wrgDskH
		else
			echo "\n\tWARNING▶07◀▶07◀\nThis is not the correct disk."
		fi
	done
	return 0
}

confirmupdate() { # see if this is already installed, ask user
# FK, check for old PKG name
#	[ -f /usr/options/$pkg.name ] || return 0
	case "$pkg" in
	*.ISC | *.SCO)
		oldpkg=`expr x"$pkg" : 'x\(.*\)\....$'` ;;
	*)	oldpkg="" ;;
	esac
	if test -n "$oldpkg" -a -f /usr/options/$oldpkg.name
	then	FK="$oldpkg"
	elif test -f /usr/options/$pkg.name
	then	FK="$pkg"
	else	return 0
	fi
# FK, end
	alreadyinstalled=1
	if [ "${UIaware}" -eq 1 ]		# UI scoping test
	then
# FK		ui variable set Object \"`cat /usr/options/${pkg}.name`\"
		ui variable set Object \"`cat /usr/options/${FK}.name`\"
		ui variable set Obj2 \"${PKGNAME}\"
		ui clrinfo
		question %dupPkg %dupPkgH %generic_help && return 1
		ui variable set Object \"$PKGNAME\"
		ui infomsg %addpkg3W
	else
		echo "\t\t**WARNING**▶07◀▶07◀"
# FK		cat /usr/options/$pkg.name
		cat /usr/options/$FK.name
		echo "is already installed"
		yesorno "Do you want to replace this package with\n$PKGNAME" || return 1
	fi
	return 0
}
cantinstall() { # give message about it
	TMPOUT=$SCRIPTS/ins$$
	echo "                        **ERROR**" >$TMPOUT
	echo ${PKGNAME} >>$TMPOUT
	echo "cannot be installed -- Not enough space on the hard disk." >>$TMPOUT
	echo "There are $2 blocks available on the $1 filesystem --" >>$TMPOUT
	echo "$3 blocks are needed." >>$TMPOUT

	if [ "${UIaware}" -eq 1 ]
	then
		show_message $TMPOUT %bigPkgH
	else
		echo "▶07◀▶07◀"
		cat $TMPOUT
	fi

	rm -f $TMPOUT
}
checkspace() { # see if there's enough disk for $1 package
	ROOTneeds=0
	ROOTspace=`expr "\`df / 2>/dev/null\`" : '.*: *\([0-9]*\)'`
	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
[ ! -f $MNTPATH/$pkg/install/TOTALSIZE ] && return 0		# (for now)
	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`
			if [ "$ROOTspace" -lt "$ROOTneeds" ]
			then
				cantinstall root $ROOTneeds $ROOTspace
				return 1
			fi
		fi
	done < $MNTPATH/$pkg/install/TOTALSIZE
	[ $? -eq 1 ] && return 1
	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
                # NOTE: ISCpkg.sh contains this same code!  Any changes
                # made to this routine should also be propagated to this
                # script!  (reason: sysadm/UI does package selection via
                # form, before disk-based INSTALL is called.)
	if [ -f install/MULSUBS ]
	then # multiple subsets
		pkgs=`cat install/MULSUBS`
	else # just one
		pkgs=`ls | sed '/install/d'`
	fi
	export pkgs
# FK, remove imposible pkgs
	test -x /usr/lbin/is_isc || return 0 # let user decide
	if /usr/lbin/is_isc; then
		NONO=", SCO"
	else
		NONO=", ISC"
	fi
	pkgs=`
		for pkg in $pkgs
		do	getpkgname
			if echo "$PKGNAME" | grep "$NONO" >/dev/null
			then	:
			else	echo "$pkg"
			fi
		done`
# FK, end
}

runif() { # run a script if it's there, with any arguments supplied
    RUNSCRIPT=$SCRIPTS/$1
    [ -f $RUNSCRIPT ] || return 0
    if [ ${UIaware} = 1 -a "${PART2ok}" = "yes" ]
    then                # no input required, send output to UI window
#        ui infomsg \"@4${1} routine.....@0\"

	if [ ! -x $RUNSCRIPT ]
	then        # can't eval unless executable
	    /bin/chmod u+x  $RUNSCRIPT    # only user perms switched on
	    set_chmod=1             # remember to reset ...
	else
	    set_chmod=0
	fi
	eval $RUNSCRIPT $2 > $SCRIPTS/runmsg$$ 2>&1    # also capture stderr
	rc=$?               # can't use pipe, need intermediate rc
	[ $set_chmod = 1 ] && /bin/chmod u-x $RUNSCRIPT

	while read line
	do
	    ui print \"${line}\\\n\"
	done < $SCRIPTS/runmsg$$
	if [ $rc -gt 0 ]
	then
	    ui errmsg %instFail
	    ui waitkey
	fi
	/bin/rm -f $SCRIPTS/runmsg$$
	ui clrinfo
    else		# no change for pre-UI (old style) scripts
#        echo "Running $1 routine ...."
        /bin/sh ${RUNSCRIPT} $2 
        rc=$?
    fi
    return $rc
}

# clean up after a package has been installed (or aborted)
pkg_cleanup() { # $1 is the UI error message (if instErr=1)
    [ "${pkg}" = "${lastpkg}" ] && /etc/umount $MNTDEV >/dev/null 2>&1
    if [ "${UIaware}" -eq 1 ]   # server running
    then
	if [ "${PART2ok}" = "yes" ]
	then
	    shortName=`echo ${PKGNAME} | cut -c1-42`
	    ui variable set Object \"$shortName\"
	    if [ "${instErr}" -eq 0 ]
	    then
		ui infomsg %instOK
		ui waitkey      # let user read msgs in window + inst OK
	    fi
	else
	    echo ""
	    echo "Installation of ${PKGNAME}"
	    if [ "${instErr}" -eq 1 ]
	    then
		echo "has been aborted due to errors."
	    else
		echo "is complete."
	    fi
	    echo "Press <RETURN> to continue ...\c"
	    read junk
	    ui screen load $SAVESCR
	    ui window current main
	    ui vstate current NORMAL
	fi
    else
	echo "Installation of ${PKGNAME} is complete."
    fi
    /bin/rm -rf $SCRIPTS >/dev/null 2>&1
}

# START HERE: $0 called with $1 and $2
if [ "${UIaware}" -eq 1 ]
then
    MNTDEV="${1}"
else
    getmntdev $1
fi
export MNTDEV
MNTPATH=${2:-/install}; export MNTPATH
INSDIR=/usr/lib/installed
CONF=${CONF:-/etc/conf}; export CONF
SCRIPTS=/tmp/instpkg$$
export SCRIPTS
SAVESCR=${SCRIPTS}/scr$$        # safe, since SCRIPTS dir is blasted
unset GETPKG
[ -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

rm -f /usr/lbin/uncompress 
cp $MNTPATH/install/uncompress /usr/lbin
rm -f /usr/lbin/compress 
ln /usr/lbin/uncompress /usr/lbin/compress
rm -f /usr/lbin/zcat 
ln /usr/lbin/uncompress /usr/lbin/zcat

if [ -f ${MNTPATH}/install/lilwhat.Z ]
then
	if [ ! -x /usr/lbin/lilwhat ] 
	then
		cp ${MNTPATH}/install/lilwhat.Z /usr/lbin
		/usr/lbin/uncompress /usr/lbin/lilwhat.Z
	fi
fi

if [ -f ${MNTPATH}/install/is_isc ]
then
	if [ ! -x /usr/lbin/is_isc ] 
	then
		cp ${MNTPATH}/install/is_isc /usr/lbin
	fi
	if [ ! -x /usr/lbin/is_sco ] 
	then
		ln -f /usr/lbin/is_isc /usr/lbin/is_sco
	fi
fi

#	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.  
################## older versions may be sans this file #############
# make sure that they are in the correct order.  Subsets that require more 
# than one diskette MUST be last in the list.
##################################

#[ "${UIaware}" -eq 1 ] && ui infomsg \"before getpkgorder pkgs is: $pkgs.....\"
[ "${UIaware}" -ne 1 ] && getpkgorder
set $pkgs
lastpkg=`eval echo \\$$#`
nbr=$#
#[ "${UIaware}" -eq 1 ] && ui infomsg \"before getmulti pkgs is: $pkgs.....\"
[ "${UIaware}" -ne 1 -a $nbr -gt 1 ] && getmulti $nbr
cd /

abort=0
for pkg in $pkgs
do
    export pkg
    alreadyinstalled=0
    thisdisk=1
    instErr=0
    getpkgname
    if [ "${UIaware}" -eq 1 ]
    then
	pkgname=`expr "${PKGNAME}" : '^\(.\{1,60\}\)'`
	ui variable set Object \"${pkgname}\"
	if [ $abort -eq 1 ]
	then
	    ui clrinfo
	    question %instCont %instAbortH inContHlp ||
				       { instErr=1; pkg_cleanup; break; }
	    abort=0
	fi
	ui infomsg %addpkg3W
	chk4input # is user input required by other installation scripts?
    elif [ $nbr -eq 1 ]  # skip this section with a UI system, because
    then                 # user already confirmed on the pkg select form
	yesorno "Install $PKGNAME" || continue
    fi
    confirmupdate || continue
    trap "trap '' 1 2 3 9 15; cd /; rm -rf $SCRIPTS; /etc/umount $MNTDEV >/dev/null 2>&1; exit 1" 1 2 3 15
    rm -fr $SCRIPTS
    mkdir -p $SCRIPTS
    checkspace $pkg || continue         # checkspace uses $SCRIPTS tmp file

    #
    # Set up screen.
    # If no input will be required by *any* of the scripts (PART2ok=yes)
    # then we can capture output in a ui window; otherwise, or if the
    # scripts assume control of the screen, we need to save & clear
    # the screen.
    #
    if [ "${UIaware}" -eq 1 ]
    then
	ui clrinfo
	if [ "${PART2ok}" = "yes" ]
	then
	    ui call addpkg2_do    # file list window
	else
	    ui window current SCREEN
	    ui screen save $SAVESCR
	    ui vstate current PROMPT    # for light cyan on black
	    ui cls
	fi
    fi

    # copy all the scripts off the disk. (delete scripts from the last set)
    cp $MNTPATH/$pkg/install/* $SCRIPTS

    runif dependencies || { instErr=1; pkg_cleanup; continue; }
    runif auth $pkg    || { instErr=1; pkg_cleanup; continue; }
    runif copyright
    runif preinstall   || { instErr=1; pkg_cleanup; continue; }
    lastdisk=`cat $SCRIPTS/NBRDISKS`
    # save the old /etc/drivers
    [ -d /etc/drivers ] && mv /etc/drivers /etc/drivers.$$
    exec 3<&1
    while :
    do
	cd $MNTPATH/$pkg/new
	printv "Installing $PKGNAME"
	printv "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
			printv "/$fname"
		else
			printv "/$zname"
		fi
		[ -d /$dirname ] || echo $dirname
	done | /bin/cpio -pduvm / > $SCRIPTS/newfiles.$thisdisk \
						2> $SCRIPTS/emsg$$
	rc=$?
	# display cpio msgs (eg. no of disk blocks copied, links, etc)
	while read line
	do
	    printv "$line"
	done < $SCRIPTS/emsg$$

	# check for errors
	# Cpio doesn't exit on all errors, so try to second-guess
	# it by looking at its stderr output.
	if [ $rc -gt 0 ]
	then
	    instErr=1   # for pkg_cleanup()
	elif egrep -l "[Ee]rror|[Cc]annot|corrupt|cpio:|Out of sync" \
			     $SCRIPTS/emsg$$ > /dev/null 2>&1
	then
	    instErr=1
	fi

	# if errors, ask user if wants to abort
	if [ $instErr -eq 1 ]
	then
	    abort=
	    if [ "${UIaware}" -eq 1 -a "$PART2ok" = "yes" ]
	    then
		ui window current main
		ui errmsg %instFail
		ui waitkey              # let user read any messages ...
		question %instAbort %instAbortH %generic_help &&
					abort=1 || abort=0
	        fix_console         # get rid of any driver error msgs
	    else
		echo "\nAn error has been detected while copying"
		echo "files from the diskette."
		echo "The ${PKGNAME}"
		echo "may not be installed correctly."
		yesorno "Do you want to continue the installation of this package"
		abort=$?
	    fi
	    [ $abort -eq 1 ] && break       # out of multi-disk loop
	    [ "$PART2ok" = "yes" ] && ui window select addpkg2
	    instErr=0           # user wants to continue, forget error
	fi

	if [ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ]
	then
	    ui infomsg %filUCprs
	else
	    echo "File uncompression in progress ...."
	fi
	# uncompress them in the background
	cd /
	while read zname
	do
	    /usr/lbin/uncompress -f /$zname 2>/dev/null
	    if [ $? -ne 0 ]
	    then
		nonzname=`echo $zname | sed 's/\.Z$//'`
		[ "$zname" = "$nonzname" ] && continue # wasn't compressed
		if [ -f /$nonzname ] # text file busy?
		then
		    fdir=`dirname /$nonzname`
		    ffile=`basename /$nonzname`
		    mv $fdir/$ffile $fdir/OLD.$ffile
		    /usr/lbin/uncompress -f /$zname 2>/dev/null
		    ret=$?
		    if [ $ret -ne 0 ] # now what?
		    then
			if [ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ]
			then
			    ui variable set Object \"$nonzname - error $ret\"
			    ui errmsg %ucmpErr
			else
			    echo cannot uncompress $nonzname
			    echo return code $ret
			fi
		    else    # make a list for an /etc/rc script
			    echo "rm -f $fdir/OLD.$ffile" >>$SCRIPTS/busyfiles
		    fi
		else
		    if [ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ]
		    then
			ui variable set Object "/$zfile"
			ui errmsg $ucmpErr2
		    else
			echo "\nUnknown error uncompressing /$zfile"
		    fi
		fi
	    fi
	done < $SCRIPTS/newfiles.$thisdisk &
	if [ -d ${MNTPATH}/$pkg/special ]
	then
	    runif specinstall
	    case $? in
		    0);;
		    1) continue ;; # go to next disk
		    2) pkg_cleanup; break ;; # go to next subset
	    esac
	fi
	# get the next disk if there is one
	[ $thisdisk -eq $lastdisk ] && break
	thisdisk=`expr $thisdisk + 1`
	[ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ] && ui clrinfo
	getdisk "$PKGNAME" "Disk Number $thisdisk" || { instErr=1; break; }
	dnum=`cat $MNTPATH/$pkg/install/ORDER`
	dnam=`cat $MNTPATH/$pkg/install/${pkg}.name`
	while [ "$thisdisk" -ne "${dnum}" -o "$PKGNAME" != "${dnam}" ]
	do
		if [ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ]
		then
			if [ "${thisdisk}" -ne "${dnum}" ]
			then
				ui infomsg %dnumErr
			else
				ui infomsg %dnamErr
			fi
		else
			echo "ERROR: Wrong disk"
		fi
		getdisk "$PKGNAME" "Disk Number $thisdisk" || { instErr=1;
								break 2; }
		dnum=`cat $MNTPATH/$pkg/install/ORDER`
		dnam=`cat $MNTPATH/$pkg/install/${pkg}.name`
	done
    done # end of multidisk loop

    # abort package if an error occurred while reading the diskettes
    if [ $instErr -eq 1 ]
    then
	pkg_cleanup
	continue        # go to next package subset
    fi

    # 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
# FK, handle old pkg names
	    if test -n "$oldpkg"
	    then
		rm -f /usr/options/$oldpkg.name
		mv $SCRIPTS/$pkg.name /usr/options/$oldpkg.name
	    else
		mv $SCRIPTS/$pkg.name /usr/options
	    fi
#	    mv $SCRIPTS/$pkg.name /usr/options
# FK, end
    fi
    # wait for uncompression (in background) to finish and cleanup after
    wait
    # install drivers
    if [ -f $SCRIPTS/drivers ]
    then
	    if [ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ]
	    then
		    ui infomsg %addpkg2W
	    else
		    echo "Installing driver(s)"
	    fi
	    rm -f $INSDIR/Files/$pkg.drvrs
	    while read driv
	    do
		    adddriver $driv
	    done < $SCRIPTS/drivers
    fi

    # Remove the new /etc/drivers and move the old one back
    rm -rf /etc/drivers
    [ -d /etc/drivers.$$ ] && mv /etc/drivers.$$ /etc/drivers
    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
# FK, handle old pkg name
	    rm -f ${INSDIR}/*/$pkg.name
	    if test -n "$oldpkg"
	    then
		rm -f ${INSDIR}/*/$oldpkg.name
		sed -e "s/$pkg/$oldpkg/" $SCRIPTS/Rlist.$pkg \
			> ${INSDIR}/Files/$oldpkg.name
		sed -e "s/$pkg/$oldpkg/" $SCRIPTS/Remove \
			> ${INSDIR}/Remove/$oldpkg.name
	    else
		cp $SCRIPTS/Rlist.$pkg  ${INSDIR}/Files/$pkg.name
		cp $SCRIPTS/Remove      ${INSDIR}/Remove/$pkg.name
	    fi
# FK	    cp $SCRIPTS/Rlist.$pkg  ${INSDIR}/Files/$pkg.name
# FK	    cp $SCRIPTS/Remove      ${INSDIR}/Remove/$pkg.name
# FK, end
    fi
    runif setup # this is for backward compatibility
    runif postinstall
    # cleanup and restore the old /etc/drivers
    runif cleanup

    # if there is a "busyfiles" list, put it into /etc/rc2.d
    # It has to be run after the filesystems are mounted.
    if [ -f $SCRIPTS/busyfiles ]
    then
	    echo "rm -f /etc/rc2.d/S02busyfiles" >> $SCRIPTS/busyfiles
	    if [ ! -f /etc/rc2.d/S02busyfiles ]
	    then
		cp $SCRIPTS/busyfiles /etc/rc2.d/S02busyfiles
	    else
		# If a busyfiles script pre-exists, remove the last
		# line, then append our newer list to the old one.
		#
		TOUT=/tmp/out$$
		grep -v "S02busyfiles" /etc/rc2.d/S02busyfiles >$TOUT
		# FK, added S02busyfiles to mv, so we get the right name
		mv $TOUT /etc/rc2.d/S02busyfiles
		cat $SCRIPTS/busyfiles >>/etc/rc2.d/S02busyfiles
	    fi

	    if [ "${UIaware}" -eq 1 -a "${PART2ok}" = "yes" ]
	    then
		show_message %filbusy %filbusyH
	    else
		echo "Some files in the ${PKGNAME} subset were busy."
		echo "They will be deleted at the next system re-boot"
	    fi
    fi

    pkg_cleanup

done # end of pkg loop

[ "${UIaware}" -eq 1 ] && ui window current main
exit 0