Skip to main content

Installation of Mender Client on ODYSSEY - X86

We can setup Mender Client on an ODYSSEY - X86 board and then receive OTA updates from a Hosted or Self-Hosted Mender Server.

This guide focuses on using the ODYSSEY - X86 board running a custom Linux System compiled using the Yocto Project.

Test results

The Yocto Project releases in the table below have been tested by the Mender community. Please update it if you have tested this integration on other Yocto Project releases:

Yocto ProjectBuildRuntime
dunfell (3.1 / 5.3.0)test workstest works

Build Means that the Yocto Project build using this Mender integration completes without errors and outputs images. Runtime Means that Mender has been verified to work on the board. For U-Boot-based boards, the integration checklist has been verified.

Prerequisites

  • A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Yocto Mega Manual
    • NOTE. Instructions depend on which Yocto version you intend to use.
  • ODYSSEY - X86 board

Configuring the build

Setup Yocto environment

Set the Yocto Project branch you are building for:

Create a directory for your mender-seeed setup to live in and clone the meta information.

mkdir mender-seeed && cd mender-seeed

Get all of necessary layers:

git clone -b dunfell git://git.yoctoproject.org/poky layers/poky
git clone git://git.yoctoproject.org/meta-intel layers/meta-intel
git clone -b dunfell https://github.com/mendersoftware/meta-mender layers/meta-mender
git clone -b dunfell https://github.com/openembedded/meta-openembedded layers/meta-openembedded
git clone https://github.com/Seeed-Studio/meta-odyssey-x86 layers/meta-odyssey-x86

Setup build environment

Initialize the build environment:

source layers/poky/oe-init-build-env 

Add yocto project layers:

bitbake-layers add-layer  ../layers/meta-intel 
bitbake-layers add-layer ../layers/meta-odyssey-x86
bitbake-layers add-layer ../layers/meta-openembedded/meta-oe
bitbake-layers add-layer ../layers/meta-openembedded/meta-python
bitbake-layers add-layer ../layers/meta-openembedded/meta-networking
bitbake-layers add-layer ../layers/meta-mender/meta-mender-core
bitbake-layers add-layer ../layers/meta-mender/meta-mender-demo

Apply Mender configuration to build environment:

CONF_VERSION = "1"
MACHINE = "odyssey-x86-mender"
MENDER_ARTIFACT_NAME = "release-1"
INHERIT += "mender-full"
DISTRO_FEATURES_append = " systemd"
VIRTUAL-RUNTIME_init_manager = "systemd"
DISTRO_FEATURES_BACKFILL_CONSIDERED = "sysvinit"
VIRTUAL-RUNTIME_initscripts = ""
MENDER_STORAGE_DEVICE = "/dev/sda"
MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT = "4096"
MENDER_BOOT_PART_SIZE_MB = "64"
MENDER_DATA_PART_SIZE_MB = "1024"
MENDER_IMAGE_BOOTLOADER_FILE = "wic-initrd"

IMAGE_FEATURES_append = " \
ssh-server-openssh \
"

in your local.conf.

Configure Mender server URL (optional)

This section is not required for a successful build but images that are generated by default are only suitable for usage with the Mender client in Standalone deployments, due to lack of server configuration.

You can edit the conf/local.conf file to provide your Mender server configuration, ensuring the generated images and Mender Artifacts are connecting to the Mender server that you are using. There should already be a commented section in the generated conf/local.conf file and you can simply uncomment the relevant configuration options and assign appropriate values to them.

Build for Hosted Mender:

# To get your tenant token:
# - log in to https://hosted.mender.io
# - click your email at the top right and then "My organization"
# - press the "COPY TO CLIPBOARD"
# - assign content of clipboard to MENDER_TENANT_TOKEN
#
MENDER_SERVER_URL = "https://hosted.mender.io"
MENDER_TENANT_TOKEN = "<copy token here>"

Build for Mender Demo Server:

# https://docs.mender.io/administration/demo-installation
#
MENDER_DEMO_HOST_IP_ADDRESS = "<IP address of Mender demo server>"

Build for Mender Production/ Self-Hosted (on-prem):

# https://docs.mender.io/3.1/system-updates-yocto-project/build-for-production
#
# Uncomment below and update the URL to match your configured domain
# name and provide the path to the generated server.crt file.
#
# Note that a custom server.crt file is only necessary if you are using
# self-signed certificates.
#
# NOTE! It is recommend that you provide below information in your custom
# Yocto layer and this is only for demo purposes. See linked documentation
# for additional information.
MENDER_SERVER_URL = "<URL of Self-Hosted Mender Server>"
FILESEXTRAPATHS_prepend_pn-mender-client := "<DIRECTORY-CONTAINING-server.crt>:"
SRC_URI_append_pn-mender-client = " file://server.crt"

Building the image

You can now proceed with building an image:

MACHINE="odyssey-x86-mender" bitbake odyssey-image-base

Replace odyssey-image-base with your desired image target.

Using the build output

After a successful build, the images and build artifacts are:

  • build/tmp/deploy/images/odyssey-x86-mender/odyssey-image-base-odyssey-x86.uefiimg.bz2

if you already have Mender running on your device and want to deploy a rootfs update using this build, you should use the Mender Artifact files, which have .mender suffix. 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.

Flash instructions

There are two different methods of flashing the image and running on the ODYSSEY - X86 board.

Method 1: Flash to a USB Flash Drive connected to the ODYSSEY - X86 board and boot the system from the flash drive.

Method 2: Flash to an HDD/SSD connected to the ODYSSEY - X86 board and run from the HDD/SSD.

Method 1

  • Step 1. Download balenaEtcher according to your operating system

  • Step 2. Plug a USB Flash Drive to the PC

  • Step 3. Click Flash from file and select mender-seeed/build/tmp/deploy/images/odyssey-x86-mender/odyssey-image-base-odyssey-x86.uefiimg.bz2file

pir

  • Step 4. Click Select target and choose the connected USB drive

  • Step 5. Finally click Flash

  • Step 6. Connect Flash drive to ODYSSEY - X86 board and turn on the board

  • Step 7. While turning on the board, keep pressing DELETE key to enter BIOS setup

  • Step 8. Go to Boot section and set the Boot Option #1 to UEFI: USB, Partition 1

pir

  • Step 9. Go to Save & Exit and select Save Changes and Reset

Now the OS will be successfully booted from the USB Flash Drive

Method 2

  • Step 1. Follow from step 1 - step 9 in above Method 1

  • Step 2. After booting successfully, turn off the board by executing:

poweroff

Note: We need to boot once after flashing because the data partition will grow to take up the remaining space on the flash drive, and we will use that space to store the image we need to flash to the HDD/SSD.

  • Step 3. Remove the flash drive from the ODYSSEY - X86 and connect to the PC

  • Step 4. Open a terminal window and copy the uefiimg from the Yocto compilation to the data partition of the flash drive

sudo cp mender-seeed/build/tmp/deploy/images/odyssey-x86-mender/odyssey-image-base-odyssey-x86.uefiimg /media/username/data

Note: Replace username with the username of your PC

  • Step 5. Remove Flash drive from PC and connect to the ODYSSEY - X86 board. Also connect an external HDD/ SSD to the ODYSSEY board.

  • Step 6. After the board is booted, type the following in the terminal window to list the disk partitions

fdisk -l

pir

We can see that the connected HDD as /dev/sdb

  • Step 7. Flash the .uefiimg file that we copied before to the connected HDD/SSD using dd utility
dd if=/data/odyssey-image-base-odyssey-x86.uefiimg of=/dev/sdb

Note: Replace /dev/sdb with the name corresponding to the connected HDD/SSD

  • Step 8. Once flashing is done, poweroff the ODYSSEY - X86
poweroff
  • Step 9. Remove the USB Flash drive and turn on the ODYSSEY - X86

  • Step 10. While turning on the board, keep pressing F7 to enter BIOS setup

  • Step 11. Go to BOOT section and set the Boot Option #1 to UEFI: USB, Partition 1

pir

  • Step 12. Go to Save & Exit and select Save Changes and Reset

Now the OS will be successfully booted from the HDD/SSD

Loading Comments...