Rootfs with explicit version check


This module performs a full rootfs filesystem updates on the device. This is a slightly modified version of the Root Filesystem Image v2 update module. The difference being that this version calls an external script to compare version numbers to ensure older images are not installed.

It supports rollback in the same way as the conventional root filesystem update: rolling back to the old partition on any unforeseen problem. See Mender Architecture documentation to learn more about this design.

The reference implementation of version checking assumes the MENDER_ARTIFACT_NAME field is of the form prefix:number, where prefix is any text. The number is interpreted as a single numeric value and the update is rejected if the new version is less than the currently installed version.


Module name rootfs-version-check
Supports rollback yes
Requires restart yes
Artifact generation script no
Full system updater yes
Source code Update Module

Prepare the device

This section describes how to setup your target device, i.e. the device to be updated. This will also be referred to as the device environment.

All commands outlined in this section should be run in the device environment.


This update module has the following prerequisites for the device environment:

This Update Module has the following prerequisites for the development environment:

Install the Update Module

Download the latest version of this Update Module by running:

mkdir -p /usr/share/mender/modules/v3 && wget -P /usr/share/mender/modules/v3
chmod +x /usr/share/mender/modules/v3/rootfs-version-check 

Download the latest version of the reference version-check script by running:

mkdir -p /usr/share/mender/utils && wget -P /usr/share/mender/utils
chmod +x /usr/share/mender/utils/mender-compare-versions

Prepare the development environment on your workstation

This section describes how to set up your development environment on your workstation.

All commands outlined in this section should be run in the development environment.


This Update Modules has the following prerequisites for the development environment:

Create Mender Artifacts

The Artifact can be generated using mender-artifact tool. To generate a rootfs-version-check Update Module Mender Artifact, you can use command:

mender-artifact write module-image -T rootfs-version-check -n ${ARTIFACT_NAME} -t ${DEVICE_TYPE} -o ${OUTPUT_PATH} -f ${IMAGE}
  • ARTIFACT_NAME - The name of the Mender Artifact
  • DEVICE_TYPE - The compatible device type of this Mender Artifact
  • OUTPUT_PATH - The path where to place the output Mender Artifact. This should always have a .mender suffix
  • IMAGE - The path to the rootfs image to be packaged in the Artifact

You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client only in Standalone deployments.

Artifact technical details

The Mender Artifact used by this Update Module has the root filesystem image as the only payload.

The Mender Artifact contents will look like:

Mender artifact:
  Name: my-update-1.0
  Format: mender
  Version: 3
  Signature: no signature
  Compatible devices: '[my-device-type]'
  Provides group: 
  Depends on one of artifact(s): []
  Depends on one of group(s): []
  State scripts:

    Type:   rootfs-version-check
    Provides: Nothing
    Depends: Nothing
    Metadata: Nothing
      name:     rootfs.ext4
      size:     0
      modified: 2019-04-15 11:59:24 +0200 CEST
      checksum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
1 Like