Depending upon your firmware update strategy, you can create a software update (SWU) package in different ways.

To learn about the characteristics of SWU packages as well as pros and cons of each method, see SWU packages.

Create an image-based SWU

To build a SWU package based on system images, append the suffix -swu to the image recipe. For instance, for dey-image-webkit, run:

$ bitbake dey-image-webkit-swu

This generates the update package dey-image-webkit-swu-ccmp25-dvk-<timestamp>.swu under your project’s tmp/deploy/images/ccmp25-dvk/ folder.

Make sure you have not declared SWUPDATE_FILES, SWUPDATE_FILES_TARGZ_FILE and SWUPDATE_RDIFF_ROOTFS_SOURCE_FILE variables in your project. Otherwise, the resulting image from the above operation will be a SWU package based on files or differences rather than a SWU package based on images.

Refer to SWU packages based on system images for more information on this type of update package.

Create a files-based SWU

To build a SWU package based on files, you need to provide the list of files and folders to include in the package at build time. You can do this in two ways:

  • Define the SWUPDATE_FILES_LIST variable in the conf/local.conf project configuration file with the list of files and folders to include in the update. All the variable entries are copied from the generated rootfs directory at build time and placed in a tar.gz file inside the update package. For this reason, the list of files and folders provided must be all relative to /. The installation process extracts that file to the root folder of the running system. For example:

    conf/local.conf
    SWUPDATE_FILES_LIST = " \
        srv/www \
        mnt/linux/Image.gz-ccmp25-dvk.bin
    "
  • Directly provide a tar.gz file containing all the files and folders to update. To do so, define the SWUPDATE_FILES_TARGZ_FILE variable with the full path of the tar.gz file in your system. All the entries in the tar.gz file must be relative to /, as it is the place where SWU extracts the file during the installation process. For example:

    SWUPDATE_FILES_TARGZ_FILE = "/home/<user>/my_update_files.tar.gz"
You can use SWUPDATE_FILES_LIST and SWUPDATE_FILES_TARGZ_FILE variables at the same time. The resulting update package contains all the files and directories from the provided tar.gz file and also all the entries defined in the SWUPDATE_FILES variable.

Once the list of files and folders is set, use the following command from your project’s directory to build the SWU package:

$ bitbake <image-recipe>-swu

This generates the update package under <project_folder>/tmp/deploy/images/ccmp25-dvk:

dey-image-webkit-swu-ccmp25-dvk-<timestamp>.swu

Refer to SWU packages based on files for more information on this type of update package.

Create a binary-diff-based SWU

To build a SWU package based on binary differences, you need to provide the rootfs partition squashfs base image from which to calculate the differences with respect to the new generated rootfs image. The binary delta file is then automatically generated by the DEY build system. During the update process, the contents of the active rootfs partition are read as the base and written to the inactive rootfs partition, applying the delta binary patch on-the-fly. The boot partition will still be updated but as a full image.

To enable this update type, you must specify the base source file in the project configuration file defining the variable SWUPDATE_RDIFF_ROOTFS_SOURCE_FILE, for example:

conf/local.conf
SWUPDATE_RDIFF_ROOTFS_SOURCE_FILE = "/home/<user>/old_rootfs.squashfs"

Once the rootfs squashfs base file is set, use the following command from your project’s directory to build the SWU package:

$ bitbake <image-recipe>-swu

This generates the update package under <project_folder>/tmp/deploy/images/ccmp25-dvk:

dey-image-webkit-swu-ccmp25-dvk-<timestamp>.swu
If the SWUPDATE_RDIFF_ROOTFS_SOURCE_FILE variable is configured in the project but any SWUPDATE_FILES_LIST or SWUPDATE_FILES_TARGZ_FILE variables are also set, the build system prioritizes a SWU update package based on files instead of a binary diff.

Refer to SWU packages based on binary differences for more information on this type of update package.

Next steps