KasperskyOS Community Edition 1.3

cas-pm tool

KasperskyOS Community Edition includes the cas-pm tool (the toolchain/bin/cas-pm executable file), which installs KPA packages in a built KasperskyOS-based solution image.

Syntax of the shell command for running the cas-pm tool:

cas-pm {-p|--pkgsdir} <DIR> {-d|--dbpath} <PATH> {-a|--appsdir} <DIR> [--rootdir <DIR>] [{-l|--layout} <PATH>] {-e|--extention} <ARG> {-r|--reinstall} <-v[v...]> [--sign-ext <ARG>] [--index-ext <ARG>] <PACKAGES>... [--version] [-h|--help]

Parameters:

  • {-p|--pkgsdir} <DIR>

    SDK host system path to the directory containing the KPA packages to be installed.

  • {-d|--dbpath} <PATH>

    Full name of the SQLite database file that contains data on the installed KPA packages. If the database has not yet been created, it will be automatically generated upon startup of the tool with the specified name, and information about the installed KPA packages will be added to it.

    To ensure that the PackageManager component can detect the database after startup of the KasperskyOS-based solution, complete the following steps:

    1. After calling the cas-pm tool, copy the database file into the file system that will be put into the KasperskyOS-based solution image. If the full name of the database file was originally specified in this file system, this step can be omitted.
    2. The full name of the database file in the file system that will be put into the KasperskyOS-based solution image must be passed to the CMake command create_package_manager_entity() via the DB_PATH parameter (for more details, see PackageManager component usage scenario).
  • {-a|--appsdir} <DIR>

    SDK host system path to the directory intended for storing KPA packages before they are written to the KasperskyOS-based solution image.

  • --rootdir <DIR>

    Relative directory that will be used for installing KPA packages to the KasperskyOS-based solution image. Specify the directory in the file system that will be put into the KasperskyOS-based solution image. Information about the location of KPA packages will be entered into the database and will be required by the PackageManager component when removing KPA packages.

  • {-l|--layout} <PATH>

    Full name of the JSON file that is used to redefine the paths for installing KPA package components. Specify the full file name in the system where the SDK is installed. By default, when a KPA package is installed, its components are put into directories depending on the specific type of KPA package component (for more details, see the componentType key in the article titled List of "components" objects). To change the names of the default directories, define your own values for the keys: bin, res, lib and manifestLocale. To ensure that the PackageManager component can detect KPA package components after the KasperskyOS-based solution is started, the name of this file must be passed in the CUSTOM_LAYOUT parameter of the CMake command create_package_manager_entity() (for more details, see PackageManager component usage scenario).

    Example of a custom_layout_schema.json file:

    { "bin" : "custom-bin-path", "res" : "CustomResPath", "lib" : "CustomLibPath", "manifestLocale" : "Custom_manifestLocale_Path" }
  • {-e|--extention} <ARG>

    Extension for a KPA package file. The default value is kpa.

  • {-r|--reinstall}

    Reinstallation of KPA packages.

  • -v[v...]

    Log level for actions performed by the tool. The number of v characters indicates the log level. Messages are printed to standard output. Available values:

    • -v

      This level logs non-detailed information about normal operation of the tool, and errors and warnings about potential problems.

    • -vv[v...]

      This level adds detailed logging of tool operation information that may be useful to developers for troubleshooting.

  • --sign-ext <ARG>

    Extension for a KPA package external signature file. For more details about a KPA package external signature, see Working with KPA packages.

  • --index-ext <ARG>

    Extension for a KPA package index file. For more details about a KPA package index file, see Working with KPA packages.

  • <PACKAGES>

    List of full names of installed KPA packages in the system where the SDK is installed. You do not need to specify the file extension. Use a space to separate list items.

  • --version

    Tool version.

  • -h|--help

    Help text.

Examples of shell commands for running the cas-pm tool:

# Reinstall the helloworld.kpa package located in the directory defined by the ${PKG_DIR} variable. # The package will first be put into the directory ${ROOTFS_DIR}/package before it is written to the image of the # KasperskyOS-based solution. The directory ${ROOTFS_DIR}/package resides in the file system # that will be copied to the solution image. The repository.sqlite database containing information about the # packages installed in the image will reside in the directory defined by the ${ROOTFS_DIR} variable. # During installation, the actions performed by the tool are logged in detail. /opt/KasperskyOS-Community-Edition-<version>/toolchain/bin/cas-pm --pkgsdir ${PKG_DIR} --reinstall -vvv --dbpath ${ROOTFS_DIR}/repository.sqlite --appsdir ${ROOTFS_DIR}/package --rootdir ${ROOTFS_DIR}/package --extension kpa ${PKG_DIR}/helloworld