Getting started

Three steps: add SWUpdate to your image, describe your update in sw-description, and pack it into an update package (SWU). The documentation explains every step in detail.

1. Add SWUpdate to your image

Yocto / OpenEmbedded. Add the meta-swupdate layer (it depends on meta-oe), use the branch that matches your Yocto release, and install SWUpdate in your image:

git clone -b <yocto-release> https://github.com/sbabic/meta-swupdate
bitbake-layers add-layer meta-swupdate

IMAGE_INSTALL:append = " swupdate"

See Building with Yocto.

Buildroot. Enable BR2_PACKAGE_SWUPDATE, and configure SWUpdate with make swupdate-menuconfig.

Debian and derivatives. SWUpdate is packaged:

apt install swupdate

Other build systems. SWUpdate uses Kconfig like the Linux kernel: make menuconfig, then make.

2. Describe the update

sw-description is the first file of the update package. It lists the artifacts and how to install them, for example an image written to a partition:

software =
{
    version = "1.0.0";
    hardware-compatibility: [ "1.0" ];

    images: (
        {
            filename = "rootfs.ext4.gz";
            device = "/dev/mmcblk0p2";
            type = "raw";
            compressed = "zlib";
            installed-directly = true;
        }
    );
}

See the syntax of sw-description and the handlers.

3. Create the update package

With Yocto, meta-swupdate builds the SWU from a recipe. On any other build system, use swugenerator:

pip install swugenerator
swugenerator -s sw-description -a <artifacts dir> -k RSA,priv.pem -o update.swu create

The SWU is signed with your key, and every artifact is verified on the device against the hash in sw-description.

4. Install it

swupdate -v -i update.swu -k public.pem

or start SWUpdate with its web server and upload the SWU from the browser, or let it poll a server such as Eclipse hawkBit.

Next steps