moved lots of stuff to startup-vxWorks, in particular NFS
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
nfsAuthUnixSet &sysBootHost,500,35365
|
||||
|
||||
# Router for SLS machine net (fails otherwise but that's ok)
|
||||
routeAdd "0.0.0.0","172.20.10.1"
|
||||
|
||||
nfsMount "gfa-vfs-ioc", "/usr/local/epics","/epics"
|
||||
nfsMount "gfa-vfs-ioc", "/export/sls/ioc", "/ioc"
|
||||
nfsMount "gfa-vfs-ioc", "/export/sls/ioc_data", "/ioc/data"
|
||||
@@ -1,18 +1,76 @@
|
||||
# totally generic vxWorks startup script
|
||||
# Generic vxWorks startup script
|
||||
|
||||
#set ARCH according to vxWorks version and cpu type
|
||||
STRINGBUFFER=malloc(256)
|
||||
|
||||
# Set target name as IOC name
|
||||
IOC=&sysBootParams+60
|
||||
sprintf STRINGBUFFER, "IOC=%s", IOC
|
||||
putenv STRINGBUFFER
|
||||
puts STRINGBUFFER
|
||||
|
||||
# Set bootpc (still needed?)
|
||||
BOOTPC=&sysBootHost
|
||||
sprintf STRINGBUFFER, "BOOTPC=%s", BOOTPC
|
||||
putenv STRINGBUFFER
|
||||
puts STRINGBUFFER
|
||||
|
||||
# Set the prompt
|
||||
sprintf STRINGBUFFER, "%s (startup.script aborted) > ", IOC
|
||||
shellPromptSet STRINGBUFFER
|
||||
|
||||
# Set EPICS_HOST_ARCH according to vxWorks version and cpu type
|
||||
VX6=(*runtimeVersion>>24)-'5'
|
||||
VMI=(*runtimeVersion>>8)&255
|
||||
ARCH=malloc(16)
|
||||
sprintf(ARCH,"%s%c-ppc60%d",VX6?"V6":"T",VX6?VMI:VMI>'3'?'2':'1',sysCpu-90)
|
||||
printf "ARCH=%s\n",ARCH
|
||||
EPICS_HOST_ARCH=malloc(16)
|
||||
sprintf EPICS_HOST_ARCH, "%s%c-ppc60%d", VX6 ? "V6" : "T", VX6 ? VMI : VMI>'3' ? '2' : '1', sysCpu-90
|
||||
sprintf STRINGBUFFER, "EPICS_HOST_ARCH=%s", EPICS_HOST_ARCH
|
||||
putenv STRINGBUFFER
|
||||
puts STRINGBUFFER
|
||||
|
||||
#set target name as IOC name
|
||||
IOC=&sysBootParams+60
|
||||
cd "/ioc"
|
||||
cd IOC
|
||||
# Router for SLS machine net (fails otherwise but that's ok)
|
||||
routeAdd "0.0.0.0","172.20.10.1"
|
||||
|
||||
BOOTPC=&sysBootHost
|
||||
# Set DNS (if necessary)
|
||||
resolvInit "129.129.190.11","psi.ch"
|
||||
|
||||
# Guess FACILITY from sysBootHost name
|
||||
IS_SLS=(sysBootHost&0xdf000000)==0x58000000||(sysBootHost&0xdfdfdf00)==0x534c5300
|
||||
IS_HIPA=(sysBootHost&0xdfdfdfdf)==0x48495041
|
||||
IS_PROSCAN=(sysBootHost&0xdfdfdf00)==0x50524f00
|
||||
FACILITY=IS_SLS?"sls":IS_HIPA?"hipa":IS_PROSCAN?"proscan":"unknown"
|
||||
printf "FACILITY = %s\n", FACILITY
|
||||
|
||||
# Set NFS user 'ioc' and group 'unx-FACILITY_ioc'
|
||||
nfsAuthUnixSet &sysBootHost,500,IS_SLS?35365:IS_HIPA?35344:IS_PROSCAN?35401:9102
|
||||
|
||||
# Do the NFS mounts (only one /epics mount will succeed)
|
||||
NFS_SERVER="gfa-vfs-ioc"
|
||||
MOUNTDIR=malloc(48)
|
||||
sprintf MOUNTDIR,"/export/%s/ioc/epics",FACILITY
|
||||
nfsMount NFS_SERVER, MOUNTDIR, "/epics"
|
||||
nfsMount NFS_SERVER, "/usr/local/epics", "/epics"
|
||||
nfsMount &sysBootHost, "/usr/local/epics", "/epics"
|
||||
sprintf MOUNTDIR,"/export/%s/ioc",FACILITY
|
||||
nfsMount NFS_SERVER, MOUNTDIR, "/ioc"
|
||||
sprintf MOUNTDIR,"/export/%s/ioc_data",FACILITY
|
||||
nfsMount NFS_SERVER, MOUNTDIR, "/ioc/data"
|
||||
|
||||
# Create some path variables
|
||||
HOME=malloc(80)
|
||||
sprintf HOME, "/ioc/%s", IOC
|
||||
sprintf STRINGBUFFER, "HOME=%s", HOME
|
||||
putenv STRINGBUFFER
|
||||
cd HOME
|
||||
pwd
|
||||
|
||||
CFG=malloc(80)
|
||||
sprintf CFG, "%s/cfg", HOME
|
||||
sprintf STRINGBUFFER, "CFG=%s", CFG
|
||||
putenv STRINGBUFFER
|
||||
|
||||
# load IOC startup script
|
||||
< startup.script
|
||||
|
||||
# Set the final prompt
|
||||
sprintf STRINGBUFFER, "%s > ", IOC
|
||||
shellPromptSet STRINGBUFFER
|
||||
|
||||
@@ -9,64 +9,16 @@ EPICS_MODULES = "/ioc/modules"
|
||||
# Find a better way later to know current require version
|
||||
REQUIRE_VERSION="3.2.2"
|
||||
|
||||
# Set EPICS_HOST_ARCH according to vxWorks version and cpu type
|
||||
VX6=(*runtimeVersion>>24)-'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
|
||||
printf "EPICS_HOST_ARCH = %s\n",EPICS_HOST_ARCH
|
||||
|
||||
# Set target name as IOC name
|
||||
IOC=&sysBootParams+60
|
||||
printf "IOC = %s\n",IOC
|
||||
|
||||
BOOTPC=&sysBootHost
|
||||
printf "BOOTPC = %s\n",BOOTPC
|
||||
|
||||
STRINGBUFFER=malloc(256)
|
||||
|
||||
# Set the prompt
|
||||
sprintf STRINGBUFFER, "%s (startup.script aborted) > ", IOC
|
||||
shellPromptSet STRINGBUFFER
|
||||
|
||||
# Set DNS if necessary
|
||||
resolvInit "129.129.190.11", "psi.ch"
|
||||
|
||||
# autoSR location
|
||||
putenv "SRBASE=/ioc/data"
|
||||
|
||||
# Do the NFS mounts and other network dependend stuff
|
||||
nfsAuthUnixSet &sysBootHost,500,9102
|
||||
< /ioc/startup/network
|
||||
|
||||
# Set environment variables
|
||||
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
|
||||
|
||||
# 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
|
||||
sprintf STRINGBUFFER, "EPICS_DRIVER_PATH=.:bin/%s_%s:bin:snl:../bin:%s", EPICS, EPICS_HOST_ARCH, EPICS_MODULES
|
||||
putenv STRINGBUFFER
|
||||
|
||||
STREAM_PROTOCOL_DIR=malloc(80)
|
||||
sprintf STREAM_PROTOCOL_DIR, "%s/cfg", HOME
|
||||
|
||||
sprintf STRINGBUFFER, "EPICS_DRIVER_PATH=.:bin/%s_%s:bin:snl:../bin:%s", EPICS, EPICS_HOST_ARCH, EPICS_MODULES
|
||||
putenv STRINGBUFFER
|
||||
|
||||
# Release memory above 32 MB
|
||||
# Code loaded after this must be compiled with -mlongcall
|
||||
# at the moment snp24 does not work with this
|
||||
@@ -85,7 +37,7 @@ R3 = strncmp(EPICS,"R3.",3)==0
|
||||
R7 = strncmp(EPICS,"R7.",3)==0
|
||||
|
||||
# Load PVA only on vxWorks 6 with more than 32 MB RAM
|
||||
PVA = R7 && VX6 && sysPhysMemTop()&0xfc000000
|
||||
PVA = R7 && VX6 && sysPhysMemTop()&0xfc000000&!getenv("NOPVA")
|
||||
|
||||
# Time server (must be set before loading iocCoreLibrary.munch for 3.14.12)
|
||||
# Need EPICS_TS_FORCE_NTPTIME for 7.0
|
||||
@@ -113,7 +65,8 @@ dbBptNotMonotonic=1
|
||||
# Start Logging
|
||||
putenv getenv("EPICS_IOC_LOG_INET") ? "" : "EPICS_IOC_LOG_INET=gfa-syslog"
|
||||
putenv getenv("EPICS_IOC_LOG_PORT") ? "" : "EPICS_IOC_LOG_PORT=1514"
|
||||
sprintf STRINGBUFFER, R3_13||R3_14_8 ? "putenv \"EPICS_CA_PUT_LOG_PREFIX=%s\"" : "iocLogPrefix \"%s \"", IOC
|
||||
#sprintf STRINGBUFFER, R3_13||R3_14_8 ? "putenv \"EPICS_CA_PUT_LOG_PREFIX=%s\"" : "iocLogPrefix \"%s \"", IOC
|
||||
sprintf STRINGBUFFER, "putenv \"EPICS_CA_PUT_LOG_PREFIX=%s\"", IOC
|
||||
execute STRINGBUFFER
|
||||
iocLogInit
|
||||
errlogPrintf "Starting EPICS %s\n", EPICS
|
||||
@@ -154,7 +107,7 @@ putenv bootInfo("EPICS_CAS_INTF_ADDR_LIST=%e")
|
||||
# Set up CA search lists for different networks
|
||||
IP_ADDR=bootInfo("%e")
|
||||
|
||||
# Office (only officicial EPICS subnets, not SLS beamlines!)
|
||||
# Office (only official EPICS subnets, not SLS beamlines!)
|
||||
ifEnvSet IP_ADDR, "~129.129.130.*", "EPICS_CA_ADDR_LIST", "129.129.131.255 129.129.137.255"
|
||||
ifEnvSet IP_ADDR, "~129.129.131.*", "EPICS_CA_ADDR_LIST", "129.129.130.255 129.129.137.255"
|
||||
ifEnvSet IP_ADDR, "~129.129.137.*", "EPICS_CA_ADDR_LIST", "129.129.130.255 129.129.131.255"
|
||||
|
||||
@@ -1,5 +1,2 @@
|
||||
# 3rd part of common vxWorks startup
|
||||
|
||||
# set the prompt
|
||||
sprintf STRINGBUFFER, "%s > ", IOC
|
||||
shellPromptSet STRINGBUFFER
|
||||
# Obsolete: Nothing to do.
|
||||
|
||||
Reference in New Issue
Block a user