The init.yaml.in template is used to automatically generate a part of the init.yaml file prior to building the Einit program using CMake tools.
When using the init.yaml.in template, you do not have to manually add descriptions of system programs and the IPC channels for connecting to them to the init.yaml file.
The init.yaml.in template must contain the following data:
entities key.The IPC channels that connect this application to other applications are either indicated manually or specified in the CMakeLists.txt file for this application using the EXTRA_CONNECTIONS property.
The @INIT_<program name>_ENTITY_CONNECTIONS@ macro is used to specify a list of IPC channels that connect this program to the system programs included in KasperskyOS Community Edition. During the build, this macro is replaced by a list of IPC channels with all system programs linked with the application. The target and id fields are filled according to the connect.yaml files from KasperskyOS Community Edition located at /opt/KasperskyOS-Community-Edition-<platform>-<version>/sysroot-*-kos/include/<system program name>).
@INIT_<program name>_ENTITY_CONNECTIONS@ macro also adds the list of connections for each program specified in the EXTRA_CONNECTIONS property when building this program.main() function specified in the EXTRA_ARGS property to a program when building this program, you must use the @INIT_<program name>_ENTITY_ARGS@ macro. During the build, this macro is replaced by a list of arguments of the main() function as specified in the EXTRA_ARGS property.EXTRA_ENV property to a program when building this program, you must use the @INIT_<program name>_ENTITY_ENV@ macro. During the build, this macro is replaced by a dictionary of environment variables and their values as specified in the EXTRA_ENV property.@INIT_EXTERNAL_ENTITIES@ – during the build, this macro is replaced with the list of system programs linked to the application and their IPC channels, main() function arguments, and values of environment variables.Example init.yaml.in template
init.yaml.in
entities:
- name: ping.Client
connections:
# The "Client" program can query the "Server"
- target: ping.Server
id: server_connection
@INIT_Client_ENTITY_CONNECTIONS@
@INIT_Client_ENTITY_ARGS@
@INIT_Client_ENTITY_ENV@
- name: ping.Server
@INIT_Server_ENTITY_CONNECTIONS@
@INIT_EXTERNAL_ENTITIES@
When building the Einit program from this template, the following init.yaml file will be generated:
init.yaml
entities:
- name: ping.Client
connections:
# The "Client" program can query the "Server"
- target: ping.Server
id: server_connection
cmake_generated_connections:
- target: kl.VfsEntity
id: {var: _VFS_CONNECTION_ID, include: vfs/defs.h}
args:
- "-v"
env:
VAR1: VALUE1
- name: ping.Server
cmake_generated_connections:
- target: kl.VfsEntity
id: {var: _VFS_CONNECTION_ID, include: vfs/defs.h}
- name: kl.VfsEntity
path: VFS
args:
- "-f"
- "fstab"
env:
ROOTFS: ramdisk0,0 / ext2
Page top