.. _sec_ref: Reference ========= .. contents:: :local: :depth: 1 .. _sec_ref_slot_config: System Configuration File ------------------------- A configuration file located in ``/etc/rauc/system.conf`` describes the number and type of available slots. It is used to validate storage locations for update images. Each board type requires its special configuration. This file is part of the root file system. .. note:: When changing the configuration file on your running target you need to restart the RAUC service in order to let the changes take effect. Example configuration: .. code-block:: cfg [system] compatible=FooCorp Super BarBazzer bootloader=barebox data-directory=/srv/rauc bundle-formats=-plain [keyring] path=/etc/rauc/keyring.pem [handlers] system-info=/usr/lib/rauc/info-provider.sh post-install=/usr/lib/rauc/postinst.sh [slot.rootfs.0] device=/dev/sda0 type=ext4 bootname=system0 [slot.rootfs.1] device=/dev/sda1 type=ext4 bootname=system1 .. _system-section: **[system] section** ``compatible`` A user-defined compatible string that describes the target hardware as specific enough as required to prevent faulty updating systems with the wrong firmware. It will be matched against the ``compatible`` string defined in the update manifest. ``bootloader`` The bootloader implementation RAUC should use for its slot switching mechanism. Currently supported values (and bootloaders) are ``barebox``, ``grub``, ``uboot``, ``efi``, ``custom``, ``noop``. .. _bundle-formats: ``bundle-formats`` This option controls which :ref:`bundle formats` are allowed when verifying a bundle. You can either specify them explicitly by using a space-separated list for format names (such as ``plain verity``). In this case, any future changes of the built-in defaults will have no effect. Alternatively, you can use format names prefixed by ``-`` or ``+`` (such as ``-plain``) to enable or disable formats relative to the default configuration. This way, formats added in newer releases will be active automatically. ``mountprefix`` Prefix of the path where bundles and slots will be mounted. Can be overwritten by the command line option ``--mount``. Defaults to ``/mnt/rauc/``. ``grubenv`` Only valid when ``bootloader`` is set to ``grub``. Specifies the path under which the GRUB environment can be accessed. ``barebox-statename`` Only valid when ``bootloader`` is set to ``barebox``. Overwrites the default state ``state`` to a user-defined state name. If this key not exists, the bootchooser framework searches per default for ``/state`` or ``/aliases/state``. ``barebox-dtbpath`` Only valid when ``bootloader`` is set to ``barebox``. Allows to set a path to a separate devicetree (dtb) file to be used for reading `barebox state `_ definition from. This is mainly useful for systems that do not use devicetrees by default, like x86 systems. .. note:: Requires to have at least `dt-utils `_ version 2021.03.0 ``boot-attempts`` This configures the number of boot attempts to set when a slot is marked good through the D-Bus API or via the command line tool. The configured value should match the bootloader's reset value for attempts. This is currently only supported when ``bootloader`` is set to ``uboot`` or ``barebox`` and defaults to 3 if not set. ``boot-attempts-primary`` This configures the number of boot attempts to set when a slot is marked as primary (i.e., when an update was installed successfully). This is currently only supported when ``bootloader`` is set to ``uboot`` or ``barebox`` and defaults to 3 if not set. ``efi-use-bootnext`` Only valid when ``bootloader`` is set to ``efi``. If set to ``false``, this disables using efi variable ``BootNext`` for marking a slot primary. This is useful for setups where the BIOS already handles the slot switching on watchdog resets. Behavior defaults to ``true`` if option is not set. .. _activate-installed: ``activate-installed`` This boolean value controls if a freshly installed slot is automatically marked active with respect to the used bootloader. Its default value is ``true`` which means that this slot is going to be started the next time the system boots. If the value of this parameter is ``false`` the slot has to be activated manually in order to be booted, see section :ref:`mark-active`. .. _statusfile: ``statusfile`` For backwards compatibility, this can be set to point to a central file where slot status information should be stored (e.g. slot-specific metadata, see :ref:`slot-status`). However, if a per-slot status is required as one of the above-noted requirements cannot be met, one can use the value ``per-slot`` to document this decision. For backwards compatibility this option is not mandatory and will default to per-slot status files if not set. .. important:: This file must be located on a non-redundant filesystem which is not overwritten during updates. See ``data-directory`` below as well. .. _data-directory: ``data-directory`` This path configures the directory where RAUC should store its slot status and any other internal information. In most cases, a shared RAUC data directory is preferable, as it allows storing data also for read-only or filesystem-less slots. We have multiple levels of backwards compatibility: * per-slot status and no shared data directory (by default or explicitly with ``statusfile=per-slot``) * central status file and no shared data directory (``statusfile=/data/central.raucs``) * central status file and shared data directory (``statusfile=/data/central.raucs`` and ``data-directory=/data/rauc``) * central status file in shared data directory (``data-directory=/data/rauc``, implies ``statusfile=/data/rauc/central.raucs``) .. important:: This directory must be located on a non-redundant filesystem which is not overwritten during updates. ``max-bundle-download-size`` Defines the maximum downloadable bundle size in bytes, and thus must be a simple integer value (without unit) greater than zero. It overwrites the compiled-in default value of 8388608 (8 MiB). ``variant-name`` String to be used as variant name for this board. If set, neither ``variant-file`` nor ``variant-dtb`` must be set. Refer chapter :ref:`sec-variants` for more information. ``variant-file`` File containing variant name for this board. If set, neither ``variant-name`` nor ``variant-dtb`` must be set. Refer chapter :ref:`sec-variants` for more information. ``variant-dtb`` If set to ``true``, use current device tree compatible as this boards variant name. If set, neither ``variant-name`` nor ``variant-file`` must be set. Refer chapter :ref:`sec-variants` for more information. .. _keyring-section: **[keyring] section** The ``keyring`` section refers to the trusted keyring used for signature verification. Both ``path`` and ``directory`` options can be used together if desired, though only one or the other is necessary to verify the bundle signature. ``path`` Path to the keyring file in PEM format. Either absolute or relative to the system.conf file. ``directory`` Path to the keyring directory containing one or more certificates. Each file in this directory must contain exactly one certificate in CRL or PEM format. The filename of each certificate must have the form hash.N for a certificate or hash.rN for CRLs; where hash is obtained by ``X509_NAME_hash(3)`` or the ``--hash`` option of ``openssl(1)`` ``x509`` or ``crl`` commands. See documentation in ``X509_LOOKUP_hash_dir(3)`` for details. ``use-bundle-signing-time=`` If this boolean value is set to ``true`` then the bundle signing time is used instead of the current system time for certificate validation. .. _allow-partial-chain: ``allow-partial-chain=`` If this boolean value is set to ``true``, RAUC will also treat intermediate certificates in the keyring as trust-anchors, in addition to self-signed root CA certificates. This makes it possible to trust only one (or more) sub-tree(s) in a larger PKI. Note that without the root CA certificate in the keyring, CRLs signed by it can not be authenticated. If CRL checking is needed, the PKI needs to be structured with this in mind. ``check-crl=`` If this boolean value is set to ``true``, RAUC will enable checking of CRLs (Certificate Revocation Lists) stored in the keyring together with the CA certificates. Note that CRLs have an expiration time in their signature, so you need to make sure you don't end up with an expired CRL on your device (which would block further updates). .. _check-purpose: ``check-purpose`` This option can be used to set the OpenSSL certificate purpose used during chain verification. Certificates in the chain with incompatible purposes are rejected. Possible values are provided by OpenSSL (``any``, ``sslclient``, ``sslserver``, ``nssslserver``, ``smimesign``, ``smimeencrypt``) and RAUC (``codesign``). See ``-purpose`` and ``VERIFY OPERATION`` in the OpenSSL verify_ manual page and the :ref:`sec-key-usage` section for more information. .. _verify: https://www.openssl.org/docs/man1.1.1/man1/verify.html .. _streaming-config-section: **[streaming] section** The ``streaming`` section contains streaming-related settings. For more information about using the streaming support of RAUC, refer to :ref:`http-streaming`. ``sandbox-user`` This option can be used to set the user name which is used to run the streaming helper process. By default, the `nobody` user is used. At compile time, the default can be defined using the ``--with-streaming-user=USERNAME`` configure option. ``tls-cert`` This option can be used to set the path or PKCS#11 URL for the TLS/HTTPS client certificate. ``tls-key`` This option can be used to set the path or PKCS#11 URL for the TLS/HTTPS client private key. ``tls-ca`` This option can be used to set the path of the CA certificate which should be used instead of the system wide store of trusted TLS/HTTPS certificates. **[encryption]** The ``encryption`` section contains information required to decrypt a 'crypt' bundle. For more information about encrypted RAUC bundle bundles, refer to :ref:`sec-encryption`. ``key`` Path or PKCS#11 URL for the private key used to decrypt bundles. This is mandatory for decrypting encrypted bundles. ``cert`` Path or PKCS#11 URL for the certificate matching the encryption key. This is optional but allows to speed up key lookup and thus is especially useful for larger number of recipients. **[casync] section** The ``casync`` section contains casync-related settings. For more information about using the casync support of RAUC, refer to :ref:`casync-support`. ``install-args`` Allows to specify additional arguments that will be passed to casync when installing an update. For example it can be used to include additional seeds or stores. ``storepath`` Allows to set the path to use as chunk store path for casync to a fixed one. This is useful if your chunk store is on a dedicated server and will be the same pool for each update you perform. By default, the chunk store path is derived from the location of the RAUC bundle you install. ``tmppath`` Allows to set the path to use as temporary directory for casync. The temporary directory used by casync can be specified using the TMPDIR environment variable. It falls back to /var/tmp if unset. If ``tmppath`` is set then RAUC runs casync with TMPDIR sets to that path. By default, the temporary directory is left unset by RAUC and casync uses its internal default value ``/var/tmp``. ``use-desync=`` If this boolean value is set to ``true``, RAUC will use desync instead of casync. Desync support is still experimental, use with caution. **[autoinstall] section** The auto-install feature allows to configure a path that will be checked upon RAUC service startup. If there is a bundle placed under this specific path, this bundle will be installed automatically without any further interaction. This feature is useful for automatically updating the slot RAUC currently runs from, like for asymmetric redundancy setups where the update is always performed from a dedicated (recovery) slot. ``path`` The full path of the bundle file to check for. If file at ``path`` exists, auto-install will be triggered. **[handlers] section** Handlers allow to customize RAUC by placing scripts in the system that RAUC can call for different purposes. All parameters expect pathnames to the script to be executed. Pathnames are either absolute or relative to the system.conf file location. RAUC passes a set of environment variables to handler scripts. See details about using handlers in `Custom Handlers (Interface)`_. ``system-info`` This handler will be called when RAUC starts up, right after loading the system configuration file. It is used for obtaining further information about the individual system RAUC runs on. The handler script must print the information to standard output in form of key value pairs ``KEY=value``. The following variables are supported: ``RAUC_SYSTEM_SERIAL`` Serial number of the individual board ``pre-install`` This handler will be called right before RAUC starts with the installation. This is after RAUC has verified and mounted the bundle, thus you can access bundle content. ``post-install`` This handler will be called after a successful installation. The bundle is still mounted at this moment, thus you could access data in it if required. ``bootloader-custom-backend`` This handler will be called to trigger the following actions: * get the primary slot * set the primary slot * get the boot state * set the boot state if a custom bootloader backend is used. See :ref:`sec-custom-bootloader-backend` for more details. .. note:: When using a full custom installation (see :ref:`[handler] section `) RAUC will not execute any system handler script. .. _slot.slot-class.idx-section: **[slot..] section** Each slot is identified by a section starting with ``slot.`` followed by the slot class name, and a slot number. The `` name is used in the *update manifest* to target the correct set of slots. It must not contain any `.` (dots) as these are used as hierarchical separator. ``device=`` The slot's device path. This one is mandatory. ``type=`` The type describing the slot. Currently supported ```` values are ``raw``, ``nand``, ``nor``, ``ubivol``, ``ubifs``, ``ext4``, ``vfat``. See table :ref:`sec-slot-type` for a more detailed list of these different types. Defaults to ``raw`` if none given. ``bootname=`` Registers the slot for being handled by the :ref:`bootselection interface ` with the ```` specified. The value must be unique across all slots. Only slots without a ``parent`` entry can have a ``bootname``. The actual meaning of the name provided depends on the bootloader implementation used. ``parent=`` The ``parent`` entry is used to bind additional slots to a bootable root file system ````. Indirect parent references are discouraged, but supported for now. This is used together with the ``bootname`` to identify the set of currently active slots, so that the inactive one can be selected as the update target. The parent slot is referenced using the form ``.``. ``allow-mounted=`` Setting this entry ``true`` tells RAUC that the slot may be updated even if it is already mounted. Such a slot can be updated only by a custom install hook. ``readonly=`` Marks the slot as existing but not updatable. May be used for sanity checking or informative purpose. A ``readonly`` slot cannot be a target slot. .. _install-same: ``install-same=`` If set to ``false``, this will tell RAUC to skip writing slots that already have the same content as the one that should be installed. Having the 'same' content means that the hash value stored for the target slot and the hash value of the update image are equal. The default value is ``true`` here, meaning that no optimization will be done as this can be unexpected if RAUC is not the only one that potentially alters a slot's content. This replaces the deprecated entries ``ignore-checksum`` and ``force-install-same``. ``resize=`` If set to ``true`` this will tell RAUC to resize the filesystem after having written the image to this slot. This only has an effect when writing an ext4 file system to an ext4 slot, i.e. if the slot has``type=ext4`` set. ``extra-mount-opts=`` Allows to specify custom mount options that will be passed to the slots ``mount`` call as ``-o`` argument value. .. _sec_ref_manifest: Manifest -------- The manifest file located in a RAUC bundle describes the images packed in the bundle and their corresponding target slot class. A valid RAUC manifest file must be named ``manifest.raucm``. .. code-block:: cfg [update] compatible=FooCorp Super BarBazzer version=2016.08-1 [bundle] format=verity verity-hash=3fcb193cb4fd475aa174efa1f1e979b2d649bf7f8224cc97f4413b5ee141a4e9 verity-salt=4b7b8657d03759d387f24fb7bb46891771e1b370fff38c70488e6381d6a10e49 verity-size=24576 [image.rootfs] filename=rootfs.ext4 size=419430400 sha256=b14c1457dc10469418b4154fef29a90e1ffb4dddd308bf0f2456d436963ef5b3 [image.appfs] filename=appfs.ext4 size=219430400 sha256=ecf4c031d01cb9bfa9aa5ecfce93efcf9149544bdbf91178d2c2d9d1d24076ca .. _sec-manifest-update: **[update] section** ``compatible`` A user-defined compatible string that must match the compatible string of the system the bundle should be installed on. ``version`` A free version field that can be used to provide and track version information. No checks will be performed on this version by RAUC itself, although a handler can use this information to reject updates. ``description`` A free-form description field that can be used to provide human-readable bundle information. ``build`` A build id that would typically hold the build date or some build information provided by the bundle creation environment. This can help to determine the date and origin of the built bundle. **[bundle] section** ``format`` Either ``plain`` (default) or ``verity``. This selects the :ref:`format` use when wrapping the payload during bundle creation. .. _verity-metadata: ``verity-hash`` The dm-verity root hash over the bundle payload in hexadecimal. RAUC determines this value automatically, so it should be left unspecified when preparing a manifest for bundle creation. ``verity-salt`` The dm-verity salt over the bundle payload in hexadecimal. RAUC determines this value automatically, so it should be left unspecified when preparing a manifest for bundle creation. ``verity-size`` The size of the dm-verity hash tree. RAUC determines this value automatically, so it should be left unspecified when preparing a manifest for bundle creation. ``crypt-key`` The encryption key of the dm-crypt. RAUC generates the key automatically when creating a `crypt` bundle. **[hooks] section** ``filename`` Hook script path name, relative to the bundle content. ``hooks`` List of hooks enabled for this bundle. See :ref:`sec-install-hooks` for more details. Valid items are: ``install-check`` .. _sec-manifest-handler: **[handler] section** ``filename`` Handler script path name, relative to the bundle content. Used to fully replace default update process. ``args`` Arguments to pass to the handler script, such as ``args=--verbose`` .. _image.slot-class-section: **[image.] section** .. _image.slot-filename: ``filename`` Name of the image file (relative to bundle content). RAUC uses the file extension and the slot type to decide how to extract the image file content to the slot. ``sha256`` sha256 of image file. RAUC determines this value automatically when creating a bundle, thus it is not required to set this by hand. ``size`` size of image file. RAUC determines this value automatically when creating a bundle, thus it is not required to set this by hand. ``hooks`` List of per-slot hooks enabled for this image. See :ref:`sec-slot-hooks` for more details. Valid items are: ``pre-install``, ``install``, ``post-install`` ``adaptive`` List of ``;``-separated per-slot adaptive update method names. These methods will add extra information to the bundle, allowing RAUC to access only the parts of an image which are not yet available locally. Together with streaming, this reduces the amount of downloaded data. As the full image is still available in the bundle, older RAUC versions can ignore unsupported adaptive methods. Currently implemented adaptive methods: * ``block-hash-index`` .. _meta.label-section: **[meta.