i.rOWconfig revision 7c478bd95313f5f23a4c958a745db2134aa03244
4139N/A#!/bin/sh
4139N/A#
4139N/A# CDDL HEADER START
4139N/A#
4139N/A# The contents of this file are subject to the terms of the
4139N/A# Common Development and Distribution License, Version 1.0 only
4139N/A# (the "License"). You may not use this file except in compliance
4139N/A# with the License.
4139N/A#
4139N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4139N/A# or http://www.opensolaris.org/os/licensing.
4139N/A# See the License for the specific language governing permissions
4139N/A# and limitations under the License.
4139N/A#
4139N/A# When distributing Covered Code, include this CDDL HEADER in each
4139N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4139N/A# If applicable, add the following below this CDDL HEADER, with the
4139N/A# fields enclosed by brackets "[]" replaced with your own identifying
4139N/A# information: Portions Copyright [yyyy] [name of copyright owner]
4139N/A#
4139N/A# CDDL HEADER END
4139N/A#
4139N/A#
4139N/A#ident "%Z%%M% %I% %E% SMI"
4139N/A#
4139N/A# Copyright (c) 1997 by Sun Microsystems, Inc.
4139N/A# All rights reserved.
4139N/A#
4139N/A
4139N/A#
4139N/A# $new is the new version of the file in the package. Unused.
4139N/A# $old is the old version of the OWconfig file. We rewrite this.
4139N/A#
4139N/A# We need to rewrite the following:
4139N/A# directory names for PMI files that moved.
4139N/A# Three different cases (x2 - one for vga? and one for 8514)
4139N/A# where SUNW was placed in front of identifier - vga4, vga8, 8514
4139N/A#
4139N/A
4139N/Aif [ -h /etc/openwin/server/etc/OWconfig -a -f /tmp/root/etc/openwin/server/etc/OWconfig ]
4139N/Athen
4139N/A cp /tmp/root/etc/openwin/server/etc/OWconfig $PKG_INSTALL_ROOT/etc/openwin/server/etc/OWconfig
4139N/Aelse
4139N/Acat > /tmp/lookup_table <<EOT
4139N/Agxe_43.pmi SUNWs3 number9/gxe-2.xqa mfreq/mfreq38.vda 8 ddxSUNWs3.so.1 SUNWs3Init
4139N/Agxe_60.pmi SUNWs3 number9/gxe-2.xqa mfreq/mfreq48.vda 8 ddxSUNWs3.so.1 SUNWs3Init
4139N/Agxe_70.pmi SUNWs3 number9/gxe-2.xqa mfreq/mfreq56.vda 8 ddxSUNWs3.so.1 SUNWs3Init
4139N/Amach32_60.pmi SUNWati ati/ultrapro2.xqa mfreq/mfreq64.vda 8 ddxSUNWati.so.1 SUNWatiInit
4139N/Amach32_70.pmi SUNWati ati/ultrapro2.xqa mfreq/mfreq64.vda 8 ddxSUNWati.so.1 SUNWatiInit
4139N/Amach32_72.pmi SUNWati ati/ultrapro2.xqa mfreq/mfreq64.vda 8 ddxSUNWati.so.1 SUNWatiInit
4139N/Amach32_76.pmi SUNWati ati/ultrapro2.xqa mfreq/mfreq80.vda 8 ddxSUNWati.so.1 SUNWatiInit
4139N/Amach32_87.pmi SUNWati ati/ultrapro2.xqa mfreq/mfreq85.vda 8 ddxSUNWati.so.1 SUNWatiInit
4139N/Amach32_95.pmi SUNWati ati/ultrapro2.xqa mfreq/mfreq85.vda 8 ddxSUNWati.so.1 SUNWatiInit
4139N/AEOT
4139N/A
4139N/ATMP_FILE=/tmp/`basename $0`.$$
4139N/Atrap 'rm -f $TMP_FILE /tmp/lookup_table' 0 1 2 3 15
4139N/A
4139N/Awhile read new old
4139N/Ado
4139N/A
4139N/A#
4139N/A# If there is no existing file, don't do any of this stuff.
4139N/A# in that case, $old will be /dev/null
4139N/A#
4139N/A if [ -f $old ]; then
4139N/A echo "Converting old OWconfig file to new format."
4139N/A cat $old |\
4139N/A /usr/bin/sed -e 's?vesa/vga?devdata/svpmi/SUNWvga?' \
4139N/A -e 's?vesa/8514?devdata/svpmi/SUNW8514?' \
4139N/A -e 's?name=\"vga?name=\"SUNWvga?' \
4139N/A -e 's?name=\"8514?name=\"SUNW8514?' \
4139N/A -e 's?listOfScreens=\"vga?listOfScreens=\"SUNWvga?' \
4139N/A -e 's?device=\"vga?device=\"SUNWvga?' \
4139N/A -e 's?device=\"8514?device=\"SUNW8514?' \
4139N/A -e 's?InitFunc=\"vga?InitFunc=\"SUNWvga?' \
4139N/A -e 's?InitFunc=\"i8514?InitFunc=\"SUNW8514?' \
4139N/A > /tmp/$$owconfig
4139N/A
4139N/A/usr/bin/nawk -v LKUP_TBL="/tmp/lookup_table" '
4139N/A BEGIN{
4139N/A while (getline < LKUP_TBL > 0)
4139N/A tab[$1] = $0 # Read entire lookup table
4139N/A # in memory.
4139N/A
4139N/A }
4139N/A
4139N/A /XINPUT/,/;/ {print}
4139N/A
4139N/A /XDISPLAY/,/;/ {print}
4139N/A
4139N/A /XSCREENCONFIG/,/;/ { split($0, owcfgflds, " ")
4139N/A for (i=1; i <= NF; i++)
4139N/A {
4139N/A if (owcfgflds[i] ~ /pmifile/)
4139N/A j=split(owcfgflds[i], pmifld, "\"")
4139N/A }
4139N/A #
4139N/A # Obtain the pmi filename (eg. ati.pmi)
# from its absolute path.
#
k=split(pmifld[j-1], pmi, "/")
pmifl = pmi[k]
#
# If pmifile does not exist in the
# lookup table then do not convert the
# OWconfig file.
#
if (tab[pmifl] == "") {print}
else
{
split(tab[pmifl], lkupflds, " ")
dev = lkupflds[2]
xqa = lkupflds[3]
vda = lkupflds[4]
dep = lkupflds[5]
ddx = lkupflds[6]
ddi = lkupflds[7]
for (l=1; l <= NF; l++)
{
if (owcfgflds[l] ~ /pmifile/) owcfgflds[l] = "board=""\""xqa"\" " "monitor=""\""vda"\""
if (owcfgflds[l] ~ /device/) owcfgflds[l] = "device=""\""dev"\""
printf "%s ", owcfgflds[l]
}
printf "\n"
#
# Create a new XSCREEN class
# corresponding to the modifications
# made to the XSCREENCONFIG class.
# Modifying the current XSCREEN class
# is extremely difficult when multiple
# instances of the XSCREENCONFIG class
# are present.
#
printf "class=\"XSCREEN\" "
printf "name=\"%s\" ", dev
printf "ddxHandler=\"%s\" ", ddx
printf "ddxInitFunc=\"%s\";\n", ddi
}
}
/XSCREEN"/,/;/ {print}
' /tmp/$$owconfig > $TMP_FILE
mv $TMP_FILE $old
rm -f /tmp/lookup_table
else
touch $old
rm -f $TMP_FILE /tmp/lookup_table
fi
done
fi
exit 0