KasperskyOS Community Edition 1.3
build_kos_qemu_image()
build_kos_qemu_image()
This command is declared in the file /opt/KasperskyOS-Community-Edition-<version>/toolchain/share/cmake/Modules/platform/image.cmake
.
build_kos_qemu_image(NAME ...)
The command creates a CMake
target for building a solution image for QEMU.
Parameters:
NAME
– name of theCMake
target for building a solution image. Required parameter.PERFCNT_KERNEL
– use the kernel with performance counters if it is available in KasperskyOS Community Edition.EINIT_ENTITY
– name of the executable file that will be used to start theEinit
program.EXTRA_XDL_DIR
– additional directories to include when building theEinit
program.CONNECTIONS_CFG
– path to theinit.yaml
file or init.yaml.in template.SECURITY_PSL
– path to thesecurity.psl
file or security.psl.in template.KLOG_ENTITY
– target for building theKlog
system program, which is responsible for the security audit. If the target is not specified, the audit is not performed.QEMU_FLAGS
– additional flags for running QEMU.IMAGE_BINARY_DIR_BIN
– directory for the final image and other artifacts. It matchesCMAKE_CURRENT_BINARY_DIR
by default.NO_AUTO_BLOB_CONTAINER
– solution image will not include theBlobContainer
program that is required for working with dynamic libraries in shared memory. For more details, refer to Including the BlobContainer system program in a KasperskyOS-based solution.PACK_DEPS
,PACK_DEPS_COPY_ONLY
,PACK_DEPS_LIBS_PATH
, andPACK_DEPS_COPY_TARGET
– parameters that define the method used to add dynamic libraries to the solution image.GINGER_ENABLE
– enable (GINGER_ENABLE TRUE
) or disable (GINGER_ENABLE FALSE
) the Ginger template engine.GINGER_DEFINITIONS
– set of variables used when expanding Ginger PSL templates. For example,GINGER_DEFINITIONS "foo=bar baz=quux USE_DYNLD"
sets thefoo
variable tobar
, sets thebaz
variable toquux
, and sets theUSE_DYNLD
variable toTRUE
. TheUSE_DYNLD
variable is set toTRUE
because variables used when expanding Ginger PSL templates are set toTRUE
by default.GINGER_DUMP_DIR
– path to the directory where PSL files received from Ginger PSL templates will be stored. These PSL files are needed only to verify what was obtained as a result of expanding Ginger PSL templates, and are not used to generate source code of the Kaspersky Security Module. (When source code of the security module is generated, Ginger PSL templates are expanded in memory irrespective of whether or not theGINGER_DUMP_DIR
parameter is being used.) The names of PSL files are generated based on the absolute paths to Ginger PSL templates. For example, the PSL file namedfoo!bar!baz.psl
corresponds to the Ginger PSL template located at the path/foo/bar/baz.psl
.IMAGE_FILES
– executable files of applications and system programs (except theEinit
program) and any other files to be added to the ROMFS image.To add multiple applications or files, you can use multiple
IMAGE_FILES
parameters.<path to files>
– free parameters likeIMAGE_FILES
.
Example call:
build_kos_qemu_image ( kos-qemu-image
EINIT_ENTITY EinitQemu
CONNECTIONS_CFG "src/init.yaml.in"
SECURITY_CFG "src/security.cfg.in"
IMAGE_FILES ${ENTITIES})
For an example of using this command, see the article titled CMakeLists.txt files for building the Einit program.
Article ID: cmake_build_qemu, Last review: Feb 20, 2025