:
#
#	@(#) millpci 12.1 95/06/16 
#

set_trap()  {
	trap 'echo "Interrupted! Giving up..."; cleanup 1' 1 2 3 15
}

unset_trap()  {
	trap '' 1 2 3 15
}
 
cleanup() {
	trap '' 1 2 3 15
	echo "\n\007Press [Enter] to continue.\c">&2
	read x
	exit $1
}

set_trap
echo "\n"
/usr/lib/vidconf/scripts/pciinfo -q -d 0x519 -v 0x102B
status="$?"
if [ $status = "1" ]
then
	echo "Cannot find Matrox Millennium PCI in computer!"
	cleanup 1
fi
echo "Scanning PCI BIOS configuration space for Matrox Millennium PCI."
base1=`/usr/lib/vidconf/scripts/pciinfo -d 0x519 -v 0x102B -D 0x10`
sedarg1="s/@MEM_BASE@/$base1/g"
base2=`/usr/lib/vidconf/scripts/pciinfo -d 0x519 -v 0x102B -W 0x16`
sedarg2="s/@FBM_BASE@/$base2/g"
rm -f /usr/lib/grafinfo/matrox/milpci.xgi
sed -e $sedarg1 -e $sedarg2 < /usr/lib/grafinfo/matrox/milpci.tmpl \
	> /usr/lib/grafinfo/matrox/milpci.xgi
echo "Done."
cleanup 0
