Skip to content

Commit

Permalink
change TARGET_ARCHITECTURE to EPICS_TARGET_ARCH
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknap committed Mar 18, 2024
1 parent 596b798 commit 05de324
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"target": "developer",
"args": {
// Native target development settings ==============================
"TARGET_ARCHITECTURE": "linux-x86_64"
"EPICS_TARGET_ARCH": "linux-x86_64"
// Local cross compilation settings ================================
// "TARGET_ARCHITECTURE": "RTEMS-beatnik",
// "EPICS_TARGET_ARCH": "RTEMS-beatnik",
// "RUNTIME": "ghcr.io/epics-containers/rtems-proxy"
}
},
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
platforms: ${{ matrix.platform }}
target: ${{ matrix.target }}
build-args: |
TARGET_ARCHITECTURE=${{ matrix.epics-target }}
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
IMAGE_EXT=${{ matrix.extension }}
${{ matrix.runtime }}
Expand All @@ -88,7 +88,7 @@ jobs:
platforms: ${{ matrix.platform }}
target: ${{ matrix.target }}
build-args: |
TARGET_ARCHITECTURE=${{ matrix.epics-target }}
EPICS_TARGET_ARCH=${{ matrix.epics-target }}
EPICS_HOST_ARCH=${{ matrix.epics-host }}
IMAGE_EXT=${{ matrix.extension }}
${{ matrix.runtime }}
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/kanikobuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
DESTINATION=$CI_PROD_REGISTRY/$PROJECT_PATH/$CI_PROJECT_NAME
fi

CMDROOT="/kaniko/executor --context $CI_PROJECT_DIR --build-arg TARGET_ARCHITECTURE=${ARCH}"
CMDROOT="/kaniko/executor --context $CI_PROJECT_DIR --build-arg EPICS_TARGET_ARCH=${ARCH}"
CMD=$CMDROOT" --target ${TARGET}"
CMD=$CMD" --destination $DESTINATION-${ARCH}-${TARGET}:$CI_COMMIT_TAG"

Expand Down
8 changes: 4 additions & 4 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

set -e

# set TARGET_ARCHITECTURE to rtems for RTEMS based targets
T_A=${TARGET_ARCHITECTURE:-linux_x86_64}
# set EPICS_TARGET_ARCH to rtems for RTEMS based targets
T_A=${EPICS_TARGET_ARCH:-linux_x86_64}
# set TARGET to runtime for runtime images
TARGET=${TARGET:-developer}
# set TAG to override the default tag
TAG=${TAG:-ec_test}

if [[ ${T_A} != "linux_x86_64" ]]; then
# container image extension is the lcase of TARGET_ARCHITECTURE
# container image extension is the lcase of EPICS_TARGET_ARCH
IMAGE_EXT=-"${T_A,,}"
if [ "$T_A" = "RTEMS-beatnik" ]; then
runtime="--build-arg RUNTIME=ghcr.io/epics-containers/rtems-proxy"
Expand All @@ -33,6 +33,6 @@ if [ ! -d ibek-support ] ; then git submodule update --init ; fi
# build and developer images
set -x
$docker build $buildx -t ${TAG} "${@}" $load \
--build-arg TARGET_ARCHITECTURE=$T_A \
--build-arg EPICS_TARGET_ARCH=$T_A \
--build-arg IMAGE_EXT=$IMAGE_EXT \
$runtime --target $TARGET .
2 changes: 1 addition & 1 deletion ibek-support
51 changes: 51 additions & 0 deletions ioc/.iocsh_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# EPICS IOC Startup Script generated by https://github.com/epics-containers/ibek
cd "/epics/ioc"
epicsEnvSet EPICS_TZ GMT0BST
dbLoadDatabase dbd/ioc.dbd
ioc_registerRecordDeviceDriver pdbbase
# Create IP Port (PortName, IPAddr)
pmacAsynIPConfigure("BRICK1port", "172.23.240.97:1025")
# Configure Model 3 Controller Driver (ControlerPort, LowLevelDriverPort, Address, Axes, MovingPoll, IdlePoll)
pmacCreateController("BRICK1", "BRICK1port", 0, 4, 100, 1000)
# Configure Model 3 Axes Driver (Controler Port, Axis Count)
pmacCreateAxes("BRICK1", 4)
# Create CS (CSPortName, ControllerPort, CSNumber, ProgramNumber)
pmacCreateCS("CS2", "BRICK1", 1, 10)
# Configure Model 3 CS Axes Driver (CSPortName, CSAxisCount)
pmacCreateCSAxes("CS2", 9)
# Create CS (CSPortName, ControllerPort, CSNumber, ProgramNumber)
pmacCreateCS("CS1", "BRICK1", 2, 10)
# Configure Model 3 CS Axes Driver (CSPortName, CSAxisCount)
pmacCreateCSAxes("CS1", 9)
# Create CS (CSPortName, ControllerPort, CSNumber, ProgramNumber)
pmacCreateCS("CS3", "BRICK1", 3, 10)
# Configure Model 3 CS Axes Driver (CSPortName, CSAxisCount)
pmacCreateCSAxes("CS3", 9)
dbLoadRecords /epics/runtime/ioc.db
iocInit
# EPICS IOC Startup Script generated by https://github.com/epics-containers/ibek
cd "/epics/ioc"
epicsEnvSet EPICS_TZ GMT0BST
dbLoadDatabase dbd/ioc.dbd
ioc_registerRecordDeviceDriver pdbbase
# Create IP Port (PortName, IPAddr)
pmacAsynIPConfigure("BRICK1port", "172.23.240.97:1025")
# Configure Model 3 Controller Driver (ControlerPort, LowLevelDriverPort, Address, Axes, MovingPoll, IdlePoll)
pmacCreateController("BRICK1", "BRICK1port", 0, 4, 100, 1000)
# Configure Model 3 Axes Driver (Controler Port, Axis Count)
pmacCreateAxes("BRICK1", 4)
# Create CS (CSPortName, ControllerPort, CSNumber, ProgramNumber)
pmacCreateCS("CS2", "BRICK1", 1, 10)
# Configure Model 3 CS Axes Driver (CSPortName, CSAxisCount)
pmacCreateCSAxes("CS2", 9)
# Create CS (CSPortName, ControllerPort, CSNumber, ProgramNumber)
pmacCreateCS("CS1", "BRICK1", 2, 10)
# Configure Model 3 CS Axes Driver (CSPortName, CSAxisCount)
pmacCreateCSAxes("CS1", 9)
# Create CS (CSPortName, ControllerPort, CSNumber, ProgramNumber)
pmacCreateCS("CS3", "BRICK1", 3, 10)
# Configure Model 3 CS Axes Driver (CSPortName, CSAxisCount)
pmacCreateCSAxes("CS3", 9)
dbLoadRecords /epics/runtime/ioc.db
iocInit
dbl
2 changes: 1 addition & 1 deletion ioc/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
x86_cfg='./configure/CONFIG_SITE.Common.linux-x86_64'

# for RTEMS builds don't build for the host architecture, target only
if [[ $TARGET_ARCHITECTURE == "RTEMS"* ]]; then
if [[ $EPICS_TARGET_ARCH == "RTEMS"* ]]; then
touch ${x86_cfg}
sed -i '/VALID_BUILDS/d' ${x86_cfg}
echo "VALID_BUILDS=Host" >> ${x86_cfg}
Expand Down
2 changes: 1 addition & 1 deletion ioc/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ fi

# Launch the IOC ***************************************************************

if [[ ${TARGET_ARCHITECTURE} == "linux-x86_64" ]] ; then
if [[ ${EPICS_TARGET_ARCH} == "linux-x86_64" ]] ; then
# Execute the IOC binary and pass the startup script as an argument
exec ${IOC}/bin/linux-x86_64/ioc ${final_ioc_startup}
else
Expand Down

0 comments on commit 05de324

Please sign in to comment.