Revolution Pi + Debian Bullseye 64 bit

janaperic
Mon, 28 Oct 2024 15:27:21 +0000
Board Integrations

The official Mender documentation explains how Mender works. This is a board-specific complement to the official documentation.

Device description

The Revolution Pi is an industrial-grade, open-source platform based on the Raspberry Pi Compute Module, designed specifically for automation and IoT applications. Created by Kunbus, it offers robust, DIN-rail mountable hardware that meets industry standards, with support for Modbus, PROFINET, and other industrial protocols. Its modularity and open-source nature make it highly customizable for various use cases, from data collection and control to edge computing, making it a versatile choice for industrial automation environments.

Support level

This integration was done on a Revolution Pi Connect SE (powered by a Raspberry Pi Compute Module 4) in combination with DIO and Con CAN modules. Revolution Pi Core and other Kunbus board variations have not been tested.

Getting started

For this integration we are using a recommended workflow for mender-convert. This means that mender-convert should be implemented as the last step, after all necessary changes have been made to the image. Expected workflow:

1. Install a fresh OS to a device storage

2. Boot the device, log in, and make modifications in run-time, e.g. install packages, change
configurations

3. Copy the contents of the golden image back to your workstation (e.g. using dd)

4. Generate a Mender Artifact and disk image from this golden image using mender-convert

5. Deploy the Artifact to all devices

Prerequisites

Linux or a Mac OS machine with Docker Engine installed

Step 1: Install a fresh OS to a device storage

First step is to install an official RevPi (in this case 64 bit Bullseye) to the board.

Step 2: Boot the device, log in, and make modifications in run-time

On the first boot, it is necessary to input board-related information, such as MAC address, board model and serial number. At this step all necessary changes to the image should be made.

Step 3: Copy the contents of the golden image back to your workstation

sudo dd if=/dev/disk4 of=golden-image-revpi.img bs=1M conv=sync

*Note: Memory device can appear under different names than disk4
**Note: For Linux systems, use conv=fdatasync instead if conv=sync

Step 4: Generate a Mender Artifact and disk image from this golden image using mender-convert

git checkout https://github.com/mendersoftware/mender-convert.git
mv golden-image-revpi.img mender-convert/input/
cd mender-convert
./docker-build
MENDER_CONVERT_LOCATION=${PWD}
$MENDER_CONVERT_LOCATION/scripts/bootstrap-rootfs-overlay-hosted-server.sh
--output-dir ${PWD}/input/rootfs_overlay_demo --region eu
--tenant-token "SECRET TOKEN"

*Note: SECRET TOKEN should be replaced with token from this link

Before running mender-convert it is advised to upgrade the Mender client to version 4. Although the default version for Bullseye images is 3.5, it is recommended to use the latest version. To upgrade, use the following patch:

diff --git a/configs/mender_convert_config b/configs/mender_convert_config
index 008be53..71aeca7 100644
--- a/configs/mender_convert_config
+++ b/configs/mender_convert_config
@@ -130,7 +130,7 @@ MENDER_CLIENT_INSTALL="y"
# the latest Mender 3.x client will be installed in those cases.
# If set to "latest", it will install the latest version of the Mender Client
# from the 4.x series.
-MENDER_CLIENT_VERSION="auto"
+MENDER_CLIENT_VERSION="latest"
# Mender flash version
#

Run mender-convert:

MENDER_ARTIFACT_NAME=bullseye-64-release-1 ./docker-mender-convert
--disk-image input/golden-image-revpi.img --config
configs/raspberrypi4_bullseye_64bit_config --overlay
input/rootfs_overlay_demo/

Converted image will be stored in the deploy folder, for example:
golden-image-revpi-1-raspberrypi4_64-mender.img.gz
Extract the .img file from it and flash it to the board.

Step 5: Deploy the Artifact to all devices

Deploying the artifact via Mender hosted can be found in the Getting started documentation. To verify Mender client is working as expected follow the steps in Mender integration checklist.

References

1. Revolution Pi official images

2. mender-convert git repo

Known issues

As RevPi initializes hardware and resizes the rootfs partition on first boot, it is important to implement mender-convert only after these changes have been made. Otherwise, if the image is converted first and first boot is done afterwards, there will be some conflicts with the bootloader which will result in hardware not being initialized properly.

1 post - 1 participant