📄 install_wmsnmp_from_srctree.sh
字号:
#!/bin/bash#### Copyright 2000-2004 Wind River Systems, Inc.# All rights reserved. Provided under license only.# Distribution or other use of this software is only# permitted pursuant to the terms of a license agreement# from Wind River Systems (and is otherwise prohibited).# Refer to that license agreement for terms of use.## Clearcase# modification history# --------------------# 01f,01dec04,job fix install script so that it only does CDF stuff now# 01e,03aug04,job don't complain if you can't find 00network.cdf# 01d,05dec03,job update copyright information# 01c,02jul03,ps move SNMP archives into T22 prescribed locations, # if we are on T22.# 01b,25apr03,job fix typo# 01a,18apr03,ps remove reference to "tae"## $Log: install_wmsnmp_from_srctree.sh,v $# Revision 1.12 2003/01/24 22:10:50 meister# util/common --> common## Revision 1.11 2002/06/18 21:56:12 meister# fix typos## Revision 1.10 2002/06/18 18:27:55 meister# Changes to install libraries in Tornado 2.2 style## Revision 1.9 2002/06/17 23:53:18 meister# t22 needs slightly different CDFs## Revision 1.8 2002/06/13 15:04:45 tneale# Modification that allows calling this shell from a makefile (for THG)## Revision 1.7 2002/03/19 19:28:43 meister# chmod u+w them before extraction of the library as well.## Revision 1.6 2002/03/19 19:18:22 meister# chmod u+w all .o files before adding them back into the vxWorks library# to work around strange AR behaviour which is inexplicably zero's out an# archive file that already exists but is not writable.## Revision 1.5 2001/12/12 17:04:32 meister# Add in functions to remove old WindNet SNMP objects## Revision 1.4 2001/12/07 00:21:38 meister# this version calls an AWK script to patch the 00network.cdf## Revision 1.3 2001/12/04 01:27:05 meister# modified 00network.cdf install## Revision 1.2 2001/12/04 00:07:13 meister# fix typo## Revision 1.1 2001/12/03 23:46:02 meister# T2 version ; pretty much identical except for location of CDFs and no# user components### old log from tae version# Revision 1.6 2001/12/03 23:30:58 meister# remove cxrDoc.cat as part of CDF install## Revision 1.5 2001/12/03 23:17:12 meister# more typos## Revision 1.4 2001/12/03 22:56:12 meister# Create user components as well## Revision 1.3 2001/12/03 22:49:00 meister# UpdateVxWorksCDFS -> UpdateVxWorksCDFs## Revision 1.2 2001/12/03 22:45:27 meister# have install source script also copy the tae CDFS.# remove checks for arch-specific tae versions## Revision 1.1 2001/11/30 21:50:28 meister# replacement for install_envoylibs_from_srctree.sh##UpdateVxWorksCDFs (){ set +x TGT_DIR=${WIND_BASE}/target/config/comps/vxWorks T2_CDFS=./snmp/vxagent/t2_cdf cd ${T2_CDFS} for I in *.cdf do if [ ! -f ${TGT_DIR}/$I ]; then cp $I ${TGT_DIR} chmod 644 ${TGT_DIR}/${I} fi done #cp 00network.cdf.2.0.2 ${TGT_DIR}/00network.cdf # # back up original 00network.cdf (if present), and then # patch it to remove the old WindNetSNMP component # if [ -f ${TGT_DIR}/00network.cdf ] ; then if [ ! -f ${TGT_DIR}/00network.cdf.prepatch ]; then set -x echo "Backing up and patching 00network.cdf.." cp ${TGT_DIR}/00network.cdf ${TGT_DIR}/00network.cdf.prepatch awk -f patch00network.awk < ${TGT_DIR}/00network.cdf.prepatch \ > ${TGT_DIR}/00network.cdf fi fi cd ${REFDIR}}UpdateT22VxWorksCDFs (){ set +x TGT_DIR=${WIND_BASE}/target/config/comps/vxWorks T22_CDFS=./snmp/vxagent/t22_cdf cd ${T22_CDFS} for I in *.cdf do cp $I ${TGT_DIR} done cd ${REFDIR} CONFIGLETTE_SRC_DIR=${WIND_BASE}/target/config/comps/src/net T22_CONFIGLETTES=./snmp/vxagent/t22_configlettes cd ${T22_CONFIGLETTES} for I in *.c do cp $I ${CONFIGLETTE_SRC_DIR} done cd ${REFDIR}}## Figure out what sort of an installation the tae location is; PPC, Pentium, # etc. Bail out if it doesnt look like a TAE file tree.#DetermineTaeInstallType (){ TEST_DIR=${1} if [ ! -d ${TEST_DIR} ]; then TAEINSTALLTYPE="NOEXIST" return fi # # is there a target and host subdirectories? # if [ ! -d ${TEST_DIR}/target -o ! -d ${TEST_DIR}/host ]; then TAEINSTALLTYPE="NOTTORNADO" return fi # # is this a Tornado AE install? check for target/h/make/rules.domain file # if [ ! -f ${TEST_DIR}/target/h/make/rules.domain ]; then TAEINSTALLTYPE="T2" return else TAEINSTALLTYPE="TAE" fi}## check to see if the current directory looks like an epilogue source tree.#SanityCheckWmSnmpSrcTree(){ if [ ! -d snmp/engine -o ! -d demo -o ! -d common ] then echo "It doesnt look like you are at the top level directory of the" echo "Wind River SNMP sources. This script must be run from the" echo "target/src/wrn/wm directory of the Wind River SNMP source tree." exit 255 fi if [ ! -f makefile.wmsnmp ]; then echo "I dont see a top-level makefile.wmsnmp here. Are you sure you are " echo "in the target/src/wrn/wm directory of the Wind River SNMP source" echo "tree?" exit 255 fi}## main script starts here#if [ X${WIND_BASE} = "X" ]; then echo "WIND_BASE environment variable is undefined. Make sure" echo "you have executed the correct torVars script before" echo "running this installation script."fiTAEINSTALLTYPE="UNKNOWN"REFDIR=`pwd`DetermineTaeInstallType ${WIND_BASE}case $TAEINSTALLTYPE in NOEXIST) echo "Directory ${WIND_BASE} doesn't exist. Exiting install." exit 255 ;; NOTTORNADO) echo "${WIND_BASE} doesn't look like a Tornado installation." echo "Exiting installation." exit 255 ;; NOTTAE) echo "${WIND_BASE} doesn't look like a Tornado AE installation." echo "There is no rules.domain file in ${WIND_BASE}/target/h/make" echo "Exiting installation." exit 255 ;; UNKNOWN) echo "I cannot determine what kind of Tornado installation" echo "${WIND_BASE} contains. Exiting installation." exit 255 ;;esacSanityCheckWmSnmpSrcTreeSanitizeRefDir(){ case ${REFDIR} in //*) echo "changing REFDIR path format." echo "Was: ${REFDIR}" DRIVE=`pwd | awk -F/ '{ print $3 }'` REFDIR=`pwd | sed -e "s,//${DRIVE},${DRIVE}:,"` echo "Using ${REFDIR} instead." ;; *) ;; esac} UpdateVxWorksCDFsUpdateT22VxWorksCDFs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -