...
References (documents need to be updated)
How-To setup the CPU and IOC boot directories
The instructions differ between production and development due to permission restrictions in production.
Production: lcls, lcls2facet, facetspear, testfacacctest
- Send email to Ken Brobeck requesting:
- Which facility the CPU will boot (e.g. facet, lcls, lcls2spear, testfacacctest). This indicates the path to the path to the startupstartup.cmd script and the and the DHCP server.
- MAC Address of the CPU
- The CPU EPICS target EPICS target architecture (e.g. llinuxRT-x86, linuxRT-i686,linuxRT-x86_64,linuxRTrhel7-x86_64,etc)
- create controls infrastructure for a new linuxRT CPU and / or IOC to a specific facility production server.
- includes $EPICS_IOCS/<cpu,ioc> directories
- includes $IOC_DATA/<ioc>/<autosave, autosave-req, restore, iocInfo,
archive> - archive, yaml> directories
- add
CPU boot information to the DHCP configuration - CPU boot information to the DHCP configuration file, and reboot the DHCP server.
Ken will need the following details:- Proceed to Development Step #3
Development:
- . Create the $IOC_DATA directory for your cpu and iocs as follows:
- cd $IOC_DATA
- mkdir iocInfo archive restore autosave autosave-req yaml
- Create the $EPICS_IOCS cpu and ioc boot directories
- cd $EPICS_IOCS
- mkdir cpu-<area>-<subsystem-prefix><2-digit#>
- mkdir sioc-<area>-<subsystem-prefix><2-digit#>
- Modify your application to add the cpu boot scripts. If your IOC runs on a Shared Platform cpu then modify the SharedPlatform IOC Application :
- add cpuBoot/<faciilty>/<cpu node>/st.cmd
- add any dhcp.config or ethercat xml scripts
- tag and push shared the SharedPlatform tag to production using cram.
- Setup DHCP Server
- Add cpu to the DHCP configuration file under the group for linuxRT CPU diskless boot
- The DHCP Configuration file is at $TFTPBOOT/dhcpd.conf, Ken, Arjun or Charlie will need the following details to update DHCP.
- CPU Node name
- CPU MAC Address
- LinuxRT or Centos7
Example Development DHCP snippedDevelopment;
host cpu-b024-pm01 {
hardware ethernet 74:FE:48:16:3D:D5;
fixed-address 134.79.217.162;
option host-name "cpu-b024-pm01";
option path-mtu-aging-timeout 3600;
if ( substring( option vendor-class-identifier, 0, 5 ) = "udhcp" ) {
filename "/afs/slac.stanford.edu/g/lcls/epics/iocCommon/cpu-b024-pm01/startup.cmd";
option root-path "afsnfs:/afs/slac.stanford.edu:/afs/slac.stanford.edu";
}
}
- Proceed to Development Step #4
Development:
- . Create the $IOC_DATA directory for your cpu and iocs as follows:
- cd $IOC_DATA
- mkdir iocInfo archive restore autosave autosave-req yaml
- Create the $EPICS_IOCS cpu and ioc boot directories
- cd $EPICS_IOCS
- mkdir cpu-<area>-<subsystem-prefix><2-digit#>
- mkdir sioc-<area>-<subsystem-prefix><2-digit#>
- Modify your application to add the cpu boot scripts. If your IOC runs on a Shared Platform cpu then modify the SharedPlatform IOC Application :
- add cpuBoot/<faciilty>/<cpu node>/st.cmd
- add any dhcp.config or ethercat xml scripts
- tag and push shared the SharedPlatform tag to production using cram.
- Setup DHCP Server
- Add cpu boot information to the DHCP configuration. Contact Ken to update the DHCP file and provide the following information:
- CPU Nodename
- CPU MAC Address
- LinuxRT or Centos7
Example LCLS DHCP snippet:LCLS Production
host cpu-li10-pm01 {
hardware ethernet 74:FE:48:55:1D:A9;
fixed-address 172.27.72.103;
option host-name "cpu-li10-pm01";
if ( substring( option vendor-class-identifier, 0, 5 ) = "udhcp" ) {
filename "/usr/local/facet/epics/iocCommon/cpu-li10-pm01/startup.cmd";
option root-path "mccfs2:/export/mccfs/usr/local:/usr/local";
}
}
...
4.Create the <cpu>.ipxe file at:
for LinuxRT: $TFTPBOOT/linuxRT/boot/ipxe/<cpu>.ipxe
for 64-bit cpu:
#!ipxe
# ===============================================================
# Latest Stable version:
# Supports linux kernel = 4.14.139-rt66
# Used with EPICS BASE Version = R7.0.3.1-1.0
# Embedded linuxRT for 64-bit Arch = buildroot-2019.08-x86_64
# ===============================================================
set vers buildroot-2019.08-x86_64
...
for Centos7: $TFTPBOOT/boot/ipxe/<cpu>.ipxe
for 64-bit cpu: cp example.ipxe <cpu>.ipxe
for 32-bit cpu: cp example-32bit.ipxe <cpu>.ipxe
Note: the buildroot version in the IPXE file must match the IOC Application buildroot version defined in configure/CONFIG_SITE
5
...
#!ipxe
# ===============================================================
# Latest Stable version:
# Supports linux kernel = 4.14.139-rt66
# Used with EPICS BASE Version = R7.0.3.1-1.0
# Embedded linuxRT for 64-bit Arch = buildroot-2019.08-i686
# ===============================================================
set vers buildroot-2019.08-i686
...
Note: the buildroot version must correspond to the IOC Application buildroot version defined in the file configure/CONFIG_SITE
4. Setup CPU Boot directory files:
...
- cd $EPICS_IOCS/cpu-<area>-<subsystem-prefix><2-digit#>
- Setup relative symbolic links to the common startup script and EPICS version:.
- ln -s ../common/st.cmd.linuxRT.cpu<type>cpu startup.cmdcmd where type is soft or linuxRT
- ln -s ../common/bin/<epics base version> epicsSpecificRelease
- Generate the file kernel-module.cmd. This file load kernels modules and drivers: kernel-modules.cmd
for examples click here.
New Method: (steps 3d and 3e) - must be base release R7.0.3.1-1.0 or greater - Automatic:
- Manual:
- cd $EPICS_IOCS/cpu-<area>-<subsystem-prefix><2-digit#>
- Setup relative symbolic like to the TOP of the IOC Application first time only, thereafter use cram to upgrade link.
- ln -s ../../iocTop/<app> iocSpecificRelease
- for linuxRT: cp ../template/startup.cmd.linuxRT.cpu.<facility> startup.cmd
- for centos7: cp ../template/startup.cmd.soft.cpu.<facility> startup.cmd
- replace <cpu> with your cpu name
- replace <full path> with the full path to the
directory with the cpu boot st.cmd file.- boot directory in $EPICS_IOCS
5 6.. Setup ioc directory files
- for linuxRT running iocsh: cp ../template/startup.cmd.linuxRT startuplinuxRT startup.cmd
- for linuxRT running cexp: cp ../template/startup.cmd.linuxRT.cexp startup.cm
- for centos7: cp ../template/startup.cmd.soft.ioc startup.cmd
- cd sioc-<area>-<subsystem-prefix><2-digit#
- copy the copy the ioc startup.cmd script from $EPICS_IOCS/templattemplate
- edit startup.cmd
- replace <ioc> with your ioc name and for cexp replace <facility>
- change path of the EPICS_IOC_APP if your st.cmd file is in a non-standard location.
- cp ../template/screenrc screenrc
- edit screenrc and replace <ioc> with your ioc name
- Setup a relative symbolic link to the TOP of the IOC Application release.
- ln -s ../../iocTop/<app>/<version> iocSpecificRelease
6. Modify $EPICS_IOCS/screeniocs – Please note that this is a symbolic link to a CVS:
- cd
- cd <work>
cvs co epics/iocCommon/All/<facility> , where facility is dev,prod,facet,acctest- add line for cpu
format: cpu-<area>-<subsystem-prefix><2-digit #> <ts> <ts port #t> <screen host> [ # comment] - add line for each ioc
format: sioc-<area>-<subsystem prefix><2-digit #> cpu-<area>-<subsystem-prefix><2-digit #> <account> [ # comment] - The "comment" field in screeeniocs is optional and must be precede but "#".
- cd epics/iocCommon/All/<facility>/screeniocs
- edit screeniocs
- verify that the file in use has not been modified without being committed.
- cd $EPICS_IOCS/All/<facility> , where facility is Dev,Prod,facet,acctest
- cvs diff -r HEAD screeniocs
- if there are issues, then send email to whoever made the change or to controls-software that you are about to update this file and uncommitted edits will be lost, so please commit your changes to CVS. If you don't get a response, you can either add the changes to CVS in addition to yours or just add yours.
- check out screeniocs from CVS into your work area
- commit your changes of screeniocs to CVS as follows:
- cvs commit -m "added cpu and ioc blah" screeniocs
- update the screeniocs file in use
- cd $EPICS_IOCS/All/<facility>
- rm -f screeniocs
- cvs update screeniocs
IOC Applications Specific RT constraints:
...
- siocStart.sh <ioc> - starts a specific ioc. However, if the ioc is up nothing will be done, if no ioc is specified all iocs on cpu not already up will be started.
- siocStart.sh - starts all iocs not already running
- iocConsole.sh <ioc> -d (starts the specified ioc, but does not attache to the screen session)
- iocConsole.sh <ioc> -R (graceful reset)
- iocConsole.sh <ioc> -r (fast restart)
- iocConsole.sh --help
How to connect to CPU from a Linux host:
Use either iocConsole or ssh to CPU as follows:
- iocConsole <cpu>
- Using ssh
- from lcls or dev: ssh laci@<cpu>
- from facet: ssh flaci@<cpu
How to check if IOC is running on the linuxRT CPU:
- from laci or flaci type: screen -ls
How-to use screen program:
...