Skip to content

Deploy your Application

Welma offers a simple way to deploy an applicative partition image (appro) to your target. It uses a deployment kit to create update artifact from your app folder.

Description

This is the big picture of the deployment process.

welma-update-gen operation block diagram

Notes:

  • welma-update-gen packages your application to be installed on your target (it is included in the SDK).
  • For convenience, imgconf and signkey are integrated in the sdk.

A typical usage scenario would be:

  • bitbake your image and install it on your device
  • bitbake -c populate_sdk your image and install the resulting SDK
  • develop your application and have the resulting files installed in a local directory ./app/
  • execute welma-update-gen to package ./app/ as appro-1.0
  • upload appro-1.0 to your target and install it using updatectl install

Integrating within another SDK

You can have the tools integrated within another of Yocto SDK, by adding the following to your local.conf:

TOOLCHAIN_HOST_TASK:append = " nativesdk-welma-update-gen"

And then build your SDK. Eg:

bitbake meta-toolchain-qt6

Note

In this case the imgconf and signkey files won't be part of the SDK and you will need to get them from the image build.

Usage of welma-update-gen

usage: welma-update-gen [-h] [-c CONFIG_FILE] [--sign-key SIGN_KEY]
                        [--software-version SOFTWARE_VERSION]
                        [--partition-size PARTITION_SIZE]
                        [--fs-extrasize FS_EXTRASIZE]
                        [--uid UID] [--gid GID] [-d]
                        SOURCE_DIR

Arguments

  • SOURCE_DIR: Path to the directory that contains the files to be installed.

  • CONFIG_FILE: Configuration of the Welma image running on the target.

    • If not specified, the default config is searched in the SDK: default-image.imgconf.
    • The format of this file should be:
      MACHINE=                    Name of the Yocto machine
      IMAGE_LINK_NAME=            Name of the Yocto image (not used)
      WELMA_UPDATE=               'swupdate' or 'mender'
      WELMA_SECURE_UPDATE=        1 or 0 (or empty)
      WELMA_SECURE_BOOT=          1 or 0 (or empty)
      PARTITIONS=appro
      PARTITION_SIZE_KB_appro=    <size-kb>
      FSTYPE_appro=ext4
      
  • SIGN_KEY: Key used for signing the swupdate or mender artifact and the dm-verity root hash.

    • If not specified, the default signing key is searched in the SDK: default-image.signkey.
  • SOFTWARE_VERSION: Software version of the app (default: 1.0).

  • PARTITION_SIZE: Size of the partition in KB. This is only informational and will help detect if the final image size exceeds the partition size.

  • UID: User identifier for all files of app (default: 2000).

  • GID: Group identifier for all files of app (default: 2000).

  • -d: Activates debug messages.

Example

  • Build your image and the SDK:

    $ bitbake welma-image-minimal-dev
    $ bitbake welma-image-minimal-dev -c populate_sdk
    

  • Install the SDK and setup the toolchain environment:

    $ tmp/deploy/sdk/welma-glibc-x86_64-welma-image-minimal-dev-cortexa15t2hf-neon-qemuarm-welma-toolchain-1.1.0.sh \
          -d /opt/welma/sdk
    ...
    $ . /opt/welma/sdk/environment-setup-cortexa53-crypto-poky-linux
    

  • Develop your app, compile it and have your files deployed into a local directory app.

  • Package your app:

    $ welma-update-gen ./app --software-version "1.3"
    

  • Deploy your app to your target:

    $ scp appro-1.3.swu target:/var
    $ ssh target updatectl install /var/appro-1.3.swu
    $ ssh target reboot
    ...
    $ ssh target updatectl confirm
    
    (target being configured in ~/.ssh/config)

If you are using mender-connected as your update mechanism, you can also refer to Mender Connected use case.

From now on, you can repeat the process:

  • Modify your app
  • Package your app
  • Deploy to your target
  • Test your app

You can also have a look at our more detailed use case Quick Start Update Partition