From 83c4c34dd89fdc1bb6cd60d93c467e59b7331603 Mon Sep 17 00:00:00 2001 From: zimoch Date: Wed, 28 Jun 2017 09:08:54 +0000 Subject: [PATCH] several updates: latest require version, automatic detection of EPICS_HOST_ARCH, IOC and BOOTPC from boot parameters, copy several variables to environment, update zime zone info for 2017 --- startup.script_common | 73 ++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 26 deletions(-) diff --git a/startup.script_common b/startup.script_common index 9455a45..f331945 100644 --- a/startup.script_common +++ b/startup.script_common @@ -3,29 +3,46 @@ # It is included by all generated scripts # The following variables should be set before: -# * IOC the system name of the ioc # * INSTBASE where to boot from # * EPICS the epics release (e.g "R3.13.9") -# * ARCH the vxWorks architecture (e.g. "T1-ppc604") -# do the NFS mounts -< ../../startup/network +EPICS_MODULES = "/ioc/modules" # find a better way later to know current require version -REQUIRE_VERSION="2.1.7" +REQUIRE_VERSION="2.5.2" + +#set EPICS_HOST_ARCH according to vxWorks version and cpu type +VX6=(*runtimeVersion>>24)&255-'5' +VMI=(*runtimeVersion>>8)&255 +EPICS_HOST_ARCH=malloc(16) +sprintf(EPICS_HOST_ARCH,"%s%c-ppc60%d",VX6?"V6":"T",VX6?VMI:VMI>'3'?'2':'1',sysCpu-90) + +#set target name as IOC name +IOC=&sysBootParams+60 + +BOOTPC=&sysBootHost STRINGBUFFER=malloc(256) - -sprintf STRINGBUFFER, "IOC=%s", IOC -putenv STRINGBUFFER - # set the prompt sprintf STRINGBUFFER, "%s (startup.script aborted) > ", IOC shellPromptSet STRINGBUFFER -BOOTPC=&sysBootHost +# time server +putenv "EPICS_TS_NTP_INET=129.129.190.1" -# setup logging on boot PC +# do the NFS mounts and other network dependend stuff +< ../../startup/network + +sprintf STRINGBUFFER, "IOC=%s", IOC +putenv STRINGBUFFER + +sprintf STRINGBUFFER, "BOOTPC=%s", BOOTPC +putenv STRINGBUFFER + +sprintf STRINGBUFFER, "EPICS_HOST_ARCH=%s", EPICS_HOST_ARCH +putenv STRINGBUFFER + +# setup logging to boot PC sprintf STRINGBUFFER, "EPICS_IOC_LOG_INET=%s", BOOTPC putenv STRINGBUFFER putenv "EPICS_IOC_LOG_PORT=6500" @@ -33,30 +50,30 @@ putenv "EPICS_IOC_LOG_PORT=6500" # create some path variables HOME=malloc(80) sprintf HOME, "/ioc/%s", IOC +sprintf STRINGBUFFER, "HOME=%s", HOME +putenv STRINGBUFFER cd HOME CFG=malloc(80) sprintf CFG, "%s/cfg", HOME +sprintf STRINGBUFFER, "CFG=%s", CFG +putenv STRINGBUFFER STREAM_PROTOCOL_DIR=malloc(80) sprintf STREAM_PROTOCOL_DIR, "%s/cfg", HOME LIB=malloc(80) -sprintf LIB, "%s/iocBoot/%s/%s", INSTBASE, EPICS, ARCH -EPICS_MODULES = "/work/iocBoot/modules" +sprintf LIB, "%s/iocBoot/%s/%s", INSTBASE, EPICS, EPICS_HOST_ARCH DBD=malloc(80) sprintf DBD, "dbd:%s/iocBoot/%s/dbd", INSTBASE, EPICS -sprintf STRINGBUFFER, "EPICS_DRIVER_PATH=.:bin:snl:%s:%s", EPICS_MODULES, LIB +sprintf STRINGBUFFER, "EPICS_DRIVER_PATH=.:bin/%s_%s:bin:snl:%s:%s", EPICS, EPICS_HOST_ARCH, EPICS_MODULES, LIB putenv STRINGBUFFER TEMPLATES=malloc(80) sprintf TEMPLATES, ".:%s/iocBoot/templates", INSTBASE -# time server (must be set before any drivers are configured) -putenv "EPICS_TS_NTP_INET=129.129.190.1" - # Release memory above 32 MB # Code loaded after this must be compiled with -mlongcall # at the moment snp24 does not work with this @@ -64,15 +81,17 @@ memAddToPool (sysMemTop(),sysPhysMemTop()-sysMemTop()) EXTENDED_MEMORY=0 #EXTENDED_MEMORY=sysPhysMemTop()-sysMemTop() - # load EPICS system core (different names for 3.13 and 3.14) -sprintf STRINGBUFFER, "%s/iocCore%s", LIB, strncmp(EPICS,"R3.13",5) ? "Library.munch" : "" +sprintf STRINGBUFFER, "%s/iocCore%s", LIB, strncmp(EPICS,"R3.13.",6) ? "Library.munch" : "" ld 0, 0, STRINGBUFFER -# TIMEZONE must be set after iocCoreLibrary.munch and before iocInit -# 2016: -putenv "TIMEZONE=MET::-60:032702:103003" +# TIMEZONE must be set after loading iocCoreLibrary.munch and before iocInit +# 2017: +putenv "TIMEZONE=MET::-60:032602:102903" putenv "EPICS_TS_MIN_WEST=-60" +# EPICS 3.13 needs this to not use synchronized timestamps +sprintf STRINGBUFFER,strncmp(EPICS,"R3.13.",6) ? ";" : "TSconfigure(0,10,10,18323,18322,250,1)" +execute STRINGBUFFER # try for user-defined menus scan and convert dbLoadDatabase "dbd/scan.dbd" @@ -85,18 +104,20 @@ sprintf STRINGBUFFER, "require_VERSION=%s", getenv("require_VERSION") ? getenv(" putenv STRINGBUFFER sprintf STRINGBUFFER, "require_DIR=%s/require/%s/%s/", EPICS_MODULES, getenv("require_VERSION"), EPICS putenv STRINGBUFFER -sprintf STRINGBUFFER, "%s/lib/%s/requireLib.munch", getenv("require_DIR"), ARCH +sprintf STRINGBUFFER, "%s/lib/%s/requireLib.munch", getenv("require_DIR"), EPICS_HOST_ARCH ld 0, 0, STRINGBUFFER #load standard drivers (allow user to specify version in environment variable) require "base", getenv("base_VERSION") registerModule "require", getenv("require_VERSION"), getenv("require_DIR") +sprintf STRINGBUFFER,strncmp(EPICS,"R3.13.",6) ? "require_registerRecordDeviceDriver pdbbase" : ";" +execute STRINGBUFFER require "utilities", getenv("utilities_VERSION") require "misc", getenv("misc_VERSION") -require "seq", getenv("seq_VERSION") -require "iocmon", getenv("iocmon_VERSION") +require "seq", getenv("seq_VERSION") ? getenv("seq_VERSION") : "ifexists" -AUTOSRHOST=BOOTPC +# IOC monitoring +require "iocmon", getenv("iocmon_VERSION") # run EPICS only on 1st network port putenv "EPICS_CA_AUTO_ADDR_LIST=NO"