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 - download

⟦4283bc54b⟧ TextFile

    Length: 5331 (0x14d3)
    Types: TextFile
    Notes: UNIX file
    Names: »setup«

Derivation

└─⟦82ee0715d⟧ Bits:30004771 Terminal Driver Rel. 1.2 (3.5 inch)
└─⟦82ee0715d⟧ UNIX Filesystem
    └─ ⟦this⟧ »RCTDR.ISC/install/setup« 
    └─ ⟦this⟧ »RCTDR.SCO/install/setup« 
└─⟦ca69fd3f9⟧ Bits:30004770 Terminal Driver Rel. 1.2 (5.25 inch)
└─⟦ca69fd3f9⟧ UNIX Filesystem
    └─ ⟦this⟧ »RCTDR.ISC/install/setup« 
    └─ ⟦this⟧ »RCTDR.SCO/install/setup« 

TextFile

#
#       Setup script for the Terminal Driver package
#

#ident	"@(#)setup	1.1 - 92/12/21"

cd /usr/src/lib/terminfo

rm -rf /usr/tmp/all.ti
COMPILE="tic -v "
PERMLOC=/usr/lib/terminfo
TIFILES=`ls -aFx *.ti`;
TMPLOC=/usr/tmp/terminf.wrk

#
#	This routine locates a terminal name within a terminfo file
#
locate_ent()
{
	#
	#	This routine searches for the terminal name within
	#	the ti files, if found the file's name is displayed.
	#
	disp_msg()
	{
		FILE=`grep -l "^${TERMNAME}\|" *.ti`
		if [ -z "${FILE}" ]
			then
			FILE=`grep -l "^[^#].*\|${TERMNAME}\|" *.ti`
		fi
		if [ -n "${FILE}" ]
			then echo "Terminal ${TERMNAME} is located within terminfo file '${FILE}'"
			else echo Terminal ${TERMNAME} not found.
		fi
	}

	#
	#	Prompt user for terminal name, reject a NULL reply
	#
	echo
	echo "Enter terminal name to be located: \c"
	read TERMNAME
	if [ -n "${TERMNAME}" ]
		then disp_msg
		else echo Null reply ignored!
	fi
}
#
#	Search for the given terminal name - If found compile it
#	into /usr/tmp and then move the SINGLE terminal entry to
#	${PERMLOC}. Perform all necessary links.
#
single_file()
{
	#
	#	This routine performs the actual build, moves
	#	and links.
	#
	tmpbuild()
	{
		#
		#	Clean up from prior run
		#
		rm -rf ${TMPLOC}
		mkdir ${TMPLOC}

		#
		#	Compile entire file into a temporary location
		#
		TERMINFO=${TMPLOC} tic ${FILE}

		#
		#	Locate the subdirectory of the requested device
		#
		PREFIX=`expr ${TERMNAME} : '\(.\)' \| ${TERMNAME}`

		#
		#	To perform links we get the inode of the actual
		#	file created by tic, then search for all files
		#	in the ${TMPLOC} directory with the same inode.
		#	Those files with the same inode are aliases for
		#	The original entry.
		#
		CURDIR=`pwd`
		cd ${TMPLOC}
		INODE=`echo \`ls -i ${PREFIX}/${TERMNAME}\` | cut -f 1 -d ' '`
		echo Working in ${PERMLOC}

		#
		#	Ensure ${PERMLOC} directory exists
		#
		if [ ! -d "${PERMLOC}" ]
			then mkdir ${PERMLOC}
			chmod 775 ${PERMLOC}
			chown bin ${PERMLOC}
			chgrp bin ${PERMLOC}
		fi

		#
		#	Ensure directory exists for upcoming copy
		#
		if [ ! -d "${PERMLOC}/${PREFIX}" ]
			then mkdir ${PERMLOC}/${PREFIX}
		fi

		cp ${TMPLOC}/${PREFIX}/${TERMNAME} ${PERMLOC}/${PREFIX}
		echo Created ${PREFIX}/${TERMNAME}
		ls -i */* | grep ${INODE} | cut -c7- | while read LINKTO
		do
			PARTIAL=${PREFIX}/${TERMNAME}
			DEST=${PERMLOC}/${LINKTO}
			#
			#	Locate the subdirectory of the requested device
			#
			LNKPRE=`expr ${LINKTO} : '\(.\)' \| ${LINKTO}`

			#
			#	Ensure LNKPRE dir exists
			#
			if [ ! -d "${PERMLOC}/${LNKPRE}" ]
				then mkdir "${PERMLOC}/${LNKPRE}"
			fi

			if [ "${PARTIAL}" != "${LINKTO}" ]
				then ln ${PERMLOC}/${PARTIAL} ${DEST}
				echo Linked ${LINKTO}
			fi
		done
		cd ${CURDIR}
		rm -rf ${TMPLOC}
	}

	#
	#	This routine determines the file which contains the
	#	terminal desired. If found it is compiled via tmpbuild()
	#
	looktic()
	{
		FILE=`grep -l "^${TERMNAME}\|" *.ti`
		if [ -z "${FILE}" ]
			then
			FILE=`grep -l "^[^#].*\|${TERMNAME}\|" *.ti`
		fi
		if [ -n "${FILE}" ]
			then tmpbuild
			else echo Terminal ${TERMNAME} not found.
		fi
	}

	#
	#	Prompt user for terminal name, reject NULL reply
	#
	echo
	echo "Enter terminal name: \c"
	read TERMNAME
	if [ -n "${TERMNAME}" ]
		then looktic
		else echo Null reply ignored!
	fi
}
#
#	List all eligible files, and allow building of any one file
#
tic_file()
{
	#
	#	Display list of available files
	#
	list_files()
	{
		echo
		echo "The following terminfo files may be selected for installation:"
		echo
		ls -aFx *.ti
	}

	#
	#	The user's file must be in our list
	#
	valid_file()
	{
		echo /usr/tmp/all.ti ${TIFILES} | grep ${FILE} > /dev/null
		return $?
	}

	#
	#	Ensure only one file is specified
	#
	multiple()
	{
		echo ${FILE} | grep "[ 	]" > /dev/null
		if [ $? -eq 0 ] 
			then echo "Error: Only one file may be specified!"
				return 0
			else return 1
		fi
	}

	#
	#	Display file names, and loop over the user's replies
	#
	list_files
	while :;
	do
		rm -rf /usr/tmp/all.ti
		echo
		echo "Enter a file name, 'all', 'done', or 'files': \c"
		read FILE
		if [ -n "${FILE}" ]
			then if [ "${FILE}" = "all" ]
				then rm -rf /usr/tmp/all.ti
					cat *.ti > /usr/tmp/all.ti
					FILE=/usr/tmp/all.ti
			fi
			if multiple 
				then :;
				#
				#	If the user's reply is not NULL
				#	continue parseing
				#
				elif [ "${FILE}" = "done" ] 
						then return
		
					elif [ "${FILE}" = "files" ]
						then list_files
		
					#
					#	If user gave us a file name,
					#	verify it as a .ti file, and 
					#	compile it
					#
					elif [ -f "${FILE}" ] 
						then if valid_file
							then ${COMPILE} ${FILE}
							else echo Error: ${FILE} is not in the list!
						fi
		
						else echo Error: ${FILE} is not a file!
					fi
		else echo Null reply ignored!
		fi
	done
}

tic_file

CONF=/etc/conf
export CONF

if grep '^TD_MAPCH[ 	]' $CONF/cf.d/mtune >/dev/null 2>&1
then :
	echo TD_MAPCH : Terminal Driver support already in mtune file.
else
	echo '* TD_MAPCH : Terminal Driver tunable' >> $CONF/cf.d/mtune
	echo 'TD_MAPCH	0	0	1' >> $CONF/cf.d/mtune

# if SCO system, see if emaddmap is defined

	if grep 'MPX_SYSTEM[ 	]' $CONF/cf.d/mtune > /dev/null 2>&1
	then :
		XX=`echo "nm emaddmap\nq" | crash | grep "does not match"`
		if [ $? -eq 0 ] ; then
			$CONF/bin/idtune -f TD_MAPCH 1
		fi
	fi
fi