Mender Guide

From Variscite Wiki
Revision as of 17:58, 12 June 2025 by Nate (talk | contribs) (Created page with "<!-- Set release according to "release" parameter in URL and use mx8mp-yocto-scarthgap-6.6.52_2.2.0-v1.0 as default --> {{INIT_RELEASE_PARAM|mx8mp-yocto-scarthgap-6.6.52_2.2.0-v1.0}}<!-- --> {{#lst:Yocto_Platform_Customization|{{#var:RELEASE_PARAM}}}} <!-- --> {{COMMON_YOCTO_VARS}} <!-- Include common yocto variables --> = Mender Introduction = Mender is an open-source OTA update manager for embedded Linux, providing secure, reliable, and flexible update mechanisms. It...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Warning: This page is designed to be used with a 'release' URL parameter.

This page is using the default release mx8mp-yocto-scarthgap-6.6.52_2.2.0-v1.0.
To view this page for a specific Variscite SoM and software release, please follow these steps:

  1. Visit variwiki.com
  2. Select your SoM
  3. Select the software release





Mender Introduction

Mender is an open-source OTA update manager for embedded Linux, providing secure, reliable, and flexible update mechanisms. It supports seamless over-the-air rollouts, simplified local provisioning, and both self-hosted and cloud-hosted server options. Key features include:

  • A/B atomic updates & rollback: Switch between two rootfs partitions and automatically revert to the last known-good image on failure.
  • Local updates: Install artifacts manually via USB stick, SD card or command-line interface for offline or on-site provisioning.
  • Self-hosted: Deploy and manage updates on your own infrastructure for full control over scheduling, security and integrations.
  • Mender Hosted: Cloud-managed SaaS offering with built-in scalability, monitoring and simplified device grouping.

For more information, see the Mender website and the Technical documentation.

Mender Integration with DART-MX8M-PLUS

This reference guide shows how to integrate Mender on the DART-MX8M-PLUS platform. It covers three common update workflows:

  1. Build: Create a Mender-enabled disk image that can be flashed directly to eMMC.
  2. Serverless updates: Copy the update artifact to the board over an Ethernet link and apply it locally.
  3. Server-based update: Upload the artifact to a self-hosted Mender server and trigger a remote update.

Note: This example is provided for demonstration only. It omits or disables certain security features—such as TLS authentication, image signing, and verification, to simplify the walkthrough. Before deploying in production, review and harden all configurations to meet your product’s security requirements.

Building Mender Image and Artifacts

This guide assumes the user is familiar with how to Build Yocto from source code.

First, add meta-mender-core and meta-mender-demo to conf/bblayers.conf:

$ bitbake-layers add-layer ../sources/meta-mender/meta-mender-core
$ bitbake-layers add-layer ../sources/meta-mender/meta-mender-demo

Next, build your image:

$ bitbake fsl-image-gui

This will generate the following files:

# Partitioned image to be flashed directly to eMMC:
tmp/deploy/images/imx8mp-var-dart/fsl-image-gui-imx8mp-var-dart.sdimg

# Artifact for updating an image that's already flashed to eMMC:
tmp/deploy/images/imx8mp-var-dart/fsl-image-gui-imx8mp-var-dart.mender

Flash a Mender Image

Mender creates a partitioned image that must be written directly to the eMMC. Booting from an SD card is not supported unless you modify the Yocto machine configuration file (`conf/machine/imx8mp-var-dart.conf`) to support SD boot.

One common method to flash the image is via USB OTG using UMS (USB Mass Storage Gadget).

Steps:

1. Connect the USB OTG port on the Variscite Evaluation Kit (EVK) to a Linux host computer using a USB cable.

2. On the target device, in U-Boot, start UMS:

u-boot> ums 0 mmc $mmcdev

3. On the host computer, flash the image using bmaptool. This is preferred over dd because it is faster and verifies blocks:

$ sudo bmaptool copy tmp/deploy/images/imx93-var-som/fsl-image-gui-imx93-var-som.sdimg /dev/sdX

Replace /dev/sdX with the device node that appears when the board is in UMS mode (e.g., /dev/sdb). Be careful to select the correct device to avoid overwriting your host system.

Deploy a Mender Artifact Locally

Once the Mender-enabled image is booted on the target device, you can deploy a `.mender` artifact directly from your development machine without a Mender server.

Steps:

1. Copy the artifact from the host to the target over SSH:

$ scp tmp/deploy/images/imx8mp-var-dart/fsl-image-gui-imx8mp-var-dart.mender root@TARGET_IP_ADDR:
  Replace TARGET_IP_ADDR with the actual IP address of the target device.

2. On the target device, install the update:

root@imx8mp-var-dart:~# mender-update install fsl-image-gui-imx8mp-var-dart.mender

3. Reboot the device to apply the update:

root@imx8mp-var-dart:~# reboot

4. After reboot, commit the update to make it permanent:

root@imx8mp-var-dart:~# mender-update commit

If the update is not committed, the system will automatically roll back to the previous version on the next reboot.