Skip to content

Commit

Permalink
Merge pull request #56 from epics-containers/terminalServer
Browse files Browse the repository at this point in the history
Fix _global/install.sh to do its own symlinks
  • Loading branch information
gilesknap authored Oct 4, 2024
2 parents c464e40 + 91e5cf5 commit 5b32852
Show file tree
Hide file tree
Showing 12 changed files with 188 additions and 9 deletions.
5 changes: 4 additions & 1 deletion _global/install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash

# global install script for support all support modules to reference
# global install script for all support modules to reference
set -xe
NAME=${1}
FOLDER=$(dirname $(readlink -f $0))

x86_cfg='configure/CONFIG_SITE.Common.linux-x86_64'
support_x86=${SUPPORT}/${NAME}/${x86_cfg}
Expand All @@ -16,3 +17,5 @@ if [[ $EPICS_TARGET_ARCH == "RTEMS"* ]]; then
echo "VALID_BUILDS=Host" >> ${support_x86}
fi

# prepare *.bob, *.pvi, *.ibek.support.yaml for access outside the container.
ibek support generate-links ${FOLDER}
2 changes: 1 addition & 1 deletion asyn/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ibek support add-config-macro ${NAME} TIRPC YES
sed -i -E 's/(^[^#].*(test|iocBoot).*$)/# \1/' ${SUPPORT}/${NAME}/Makefile

# global config settings
${FOLDER}/../_global/install.sh
${FOLDER}/../_global/install.sh ${NAME}

# compile the support module
ibek support compile ${NAME}
Expand Down
2 changes: 1 addition & 1 deletion busy/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ibek support add-dbds busySupport.dbd
sed -i '/testBusy/d' ${SUPPORT}/${NAME}/busyApp/src/Makefile

# global config settings
${FOLDER}/../_global/install.sh
${FOLDER}/../_global/install.sh ${NAME}

# compile the support module
ibek support compile ${NAME}
Expand Down
2 changes: 1 addition & 1 deletion calc/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ibek support add-dbds aCalcoutRecord.dbd calc.dbd calcSupport.dbd sCalcoutReco
sed -i -E 's/tests/# tests/' ${SUPPORT}/${NAME}/Makefile

# global config settings
${FOLDER}/../_global/install.sh
${FOLDER}/../_global/install.sh ${NAME}

# compile the support module
ibek support compile ${NAME}
Expand Down
2 changes: 1 addition & 1 deletion iocStats/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ibek support add-libs devIocStats
ibek support add-dbds devIocStats.dbd

# global config settings
${FOLDER}/../_global/install.sh
${FOLDER}/../_global/install.sh ${NAME}

# comment out the test directories from the Makefile
sed -i -E 's/(^[^#].*+= test.*$)/# \1/' ${SUPPORT}/${NAME}/Makefile
Expand Down
2 changes: 1 addition & 1 deletion ipac/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ibek support add-libs Ipac
ibek support add-dbds drvIpac.dbd

# global config settings
${FOLDER}/../_global/install.sh
${FOLDER}/../_global/install.sh ${NAME}

# comment out directories that don't build from the Makefile
sed -i -E 's/(^[^#].*(tyGSOctal).*$)/# \1/' ${SUPPORT}/${NAME}/Makefile
Expand Down
2 changes: 1 addition & 1 deletion lakeshore340/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ibek support register ${NAME}
sed -i -E 's/(^[^#].*documentation)/# \1/' ${SUPPORT}/${NAME}/Makefile

# global config settings
${FOLDER}/../_global/install.sh
${FOLDER}/../_global/install.sh ${NAME}

# compile the support module
ibek support compile ${NAME}
Expand Down
2 changes: 1 addition & 1 deletion motor/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ibek support add-libs motor softMotor
ibek support add-dbds motorRecord.dbd devSoftMotor.dbd motorSupport.dbd

# global config settings
${FOLDER}/../_global/install.sh
${FOLDER}/../_global/install.sh ${NAME}

# compile the support module
ibek support compile ${NAME}
Expand Down
2 changes: 1 addition & 1 deletion sequencer/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ibek support register ${NAME} --macro SNCSEQ
ibek support add-libs pv seq

# global config settings
${FOLDER}/../_global/install.sh
${FOLDER}/../_global/install.sh ${NAME}

# comment out tests and examples from the Makefile
sed -i -E 's/(^[^#].*+= (examples|test).*$)/# \1/' ${SUPPORT}/${NAME}/Makefile
Expand Down
36 changes: 36 additions & 0 deletions snmp/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# ARGUMENTS:
# $1 VERSION to install (must match repo tag)
VERSION=${1}
NAME=snmp
FOLDER=$(dirname $(readlink -f $0))

# log output and abort on failure
set -xe

ibek support apt-install libsnmp-dev
ibek support add-runtime-packages libsnmp40

# get the source and fix up the configure/RELEASE files
ibek support git-clone ${NAME} ${VERSION} --org https://github.com/slac-epics/
ibek support register ${NAME}

# declare the libs and DBDs that are required in ioc/iocApp/src/Makefile
ibek support add-libs devSnmp
ibek support add-dbds devSnmp.dbd snmp.dbd

# underlying snmp library installed above is in standard location
ibek support add-config-macro ${NAME} NET_SNMP_PKG
ibek support add-config-macro ${NAME} USR_INCLUDES
ibek support add-config-macro ${NAME} USR_LDFLAGS

# global config settings
${FOLDER}/../_global/install.sh ${NAME}

# compile the support module
ibek support compile ${NAME}
# prepare *.bob, *.pvi, *.ibek.support.yaml for access outside the container.
ibek support generate-links ${FOLDER}


27 changes: 27 additions & 0 deletions terminalserver/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash

# ARGUMENTS:
# $1 VERSION to install (must match repo tag)
VERSION=${1}
NAME=terminalserver
FOLDER=$(dirname $(readlink -f $0))

# log output and abort on failure
set -xe

# get the source and fix up the configure/RELEASE files
ibek support git-clone ${NAME} ${VERSION} --org https://github.com/DiamondLightSource/
ibek support register ${NAME}

# declare the libs and DBDs that are required in ioc/iocApp/src/Makefile
ibek support add-dbds terminalServer.dbd

# global config settings
${FOLDER}/../_global/install.sh ${NAME}

# compile the support module
ibek support compile ${NAME}
# prepare *.bob, *.pvi, *.ibek.support.yaml for access outside the container.
ibek support generate-links ${FOLDER}


113 changes: 113 additions & 0 deletions terminalserver/terminalserver.ibek.support.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# yaml-language-server: $schema=../schemas/ibek.support.schema.json

module: terminalServer

entity_models:
- name: Moxa
description: |-
Root object for Moxa terminal server
parameters:
name:
type: id
description: |-
Object name
P:
type: str
description: |-
PV prefix
R:
type: str
description: |-
PV suffix
HOST:
type: str
description: |-
Host IP address
NCHANS:
type: int
description: |-
Number of channels
pre_init:
- value: |
{% for chan in range(NCHANS) -%}
{{'dbloadrecords("$(TERMINALSERVER)/db/MoxaChannel.template", P={}, R={}, CHAN={}, HOST={}, name={})'.format(P, R, chan+1, HOST, name + "_" ~ (chan+1) ) }}
{% endfor %}
databases:
- file: |
{{ "$(TERMINALSERVER)/db/TerminalServer32.template" if NCHANS > 16 else "$(TERMINALSERVER)/db/TerminalServer16.template" }}
args:
name:
P:
R:
- file: $(TERMINALSERVER)/db/Moxa.template
args:
name: |
{{ name + "_top" }}
P:
R:
HOST:

# - file: $(TERMINALSERVER)/db/Moxa.template
# args:
# P:
# R:
# HOST:
# name:

# - file: $(TERMINALSERVER)/db/MoxaChannel.template
# args:
# P:
# R:
# CHAN:
# HOST:
# name:

- name: Acs
description: |-
TODO:ADD DESCRIPTION
parameters:
name:
type: id
description: |-
Object name
P:
type: str
description: |-
PV prefix
R:
type: str
description: |-
PV suffix
HOST:
type: str
description: |-
Host IP address
NCHANS:
type: int
description: |-
Number of channels
databases:
- file: $(TERMINALSERVER)/db/TerminalServer16.template
args:
P:
R:
name:

- file: $(TERMINALSERVER)/db/Acs.template
args:
P:
R:
HOST:
name:

- file: $(TERMINALSERVER)/db/AcsChannel.template
args:
P:
R:
CHAN:
HOST:
name:

0 comments on commit 5b32852

Please sign in to comment.