@@ -16,7 +16,7 @@ def copy_rtems():
1616 # root of pvc mount into which we copy the IOC files for the RTEMS IOC to access
1717 root = GLOBALS .RTEMS_TFTP_PATH
1818 # root of the path that the RTEMS IOC expects to find the IOC files
19- RTEMS_TFTP_PATH = Path ("/iocs" ) / GLOBALS .IOC_GROUP / GLOBALS . IOC_NAME
19+ RTEMS_TFTP_PATH = Path ("/iocs" ) / GLOBALS .IOC_NAME
2020 # where to copy the Generic IOC folder to (at present only holds the dbd folder)
2121 ioc_dest = root / "ioc"
2222 # where to copy the generated runtime assets to (st.cmd and ioc.db)
@@ -36,8 +36,18 @@ def copy_rtems():
3636 shutil .copy (bin_rtems_src , bin_rtems_dest )
3737 shutil .copytree (GLOBALS .RUNTIME , dest_runtime , dirs_exist_ok = True )
3838
39+ protocol_folder = RTEMS_TFTP_PATH / "protocol"
40+ protocol_files = GLOBALS .SUPPORT .glob ("**/*.proto*" )
41+ for proto_file in protocol_files :
42+ dest = protocol_folder / proto_file .name
43+ shutil .copy (proto_file , dest )
44+
3945 # because we moved the ioc files we need to fix up startup script paths
4046 startup = dest_runtime / "st.cmd"
4147 cmd_txt = startup .read_text ()
4248 cmd_txt = re .sub ("/epics/" , f"{ str (RTEMS_TFTP_PATH )} /" , cmd_txt )
49+ # also fix up the protocol path to point to protocol_folder
50+ cmd_txt = (
51+ cmd_txt + f'\n epicsEnvSet("STREAM_PROTOCOL_PATH", "{ str (protocol_folder )} ")\n '
52+ )
4353 startup .write_text (cmd_txt )
0 commit comments