Integrating mender on kontron board

Hello
I’m trying to integrate mender on a kontron board based on imx8mm som ( this is the board https://www.kontron.com/en/products/baseboard-bl-i.mx8m-mini/p158549 ) .
Following the instructions at System updates: Yocto Project | Mender documentation i’m stuck on the boot part .
In a previous project , thankfully to the mender-community layer, we’ve succesfully integrated mender on a product based on rpi4 without issues , and we want to continue to use our self hosted mender server for this new product too .

My issue is that the image is generated without errors , but the board continue to boot from the internal storage instead of the sd-card .
Before starting integrating mender on the OS,i’ve generated an image that boots correctly ( a basic image customized with systemd and connman ) so i’m sure that the issues are introduced when i try to integrate mender .
Also ,i know that mender_server_url and cert. are not set , i will set it when i can boot correctly ( also , i want to install only artifacts from a local usb storage in my tests so there is no need to set those variables …right? )

those are my config files

bblayers.conf

# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
# # changes incompatibly
LCONF_VERSION = "7"

BBPATH = "${TOPDIR}"
BBFILES ?= ""
BBLAYERS ?= " \
  ${TOPDIR}/../layers/poky/meta \
  ${TOPDIR}/../layers/poky/meta-poky \
  ${TOPDIR}/../layers/meta-qt5 \
  ${TOPDIR}/../layers/meta-ktn \
  ${TOPDIR}/../layers/meta-oskar \
  ${TOPDIR}/../layers/meta-mender/meta-mender-core \
  ${TOPDIR}/../layers/meta-ktn-imx \
  ${TOPDIR}/../layers/meta-arm/meta-arm \
  ${TOPDIR}/../layers/meta-arm/meta-arm-toolchain \
  ${TOPDIR}/../layers/meta-freescale \
  ${TOPDIR}/../layers/meta-openembedded/meta-oe \
  ${TOPDIR}/../layers/meta-openembedded/meta-python \
  ${TOPDIR}/../layers/meta-openembedded/meta-networking \
  ${TOPDIR}/../layers/meta-python2 \
  "

meta-oskar is our custom layer, and contains all our customizations .
the u-boot bbappend is in that layer .

local.conf

CONF_VERSION = "1"
# include version variables for source code
include sourcecode-version.conf
# =============================================
# ######### DISTRO ############################
# =============================================
# use our distro configuration from
# layers/meta-ktn/conf/distro/ktn.conf
DISTRO = "oskar"
# =============================================
# ######### MENDER ############################
# =============================================
INHERIT += "mender-full"
# =============================================
# ######### MACHINE ###########################
# =============================================
# set a default MACHINE to build for
# usually this is overriden by the environment variable MACHINE
# (-m parameter of init-env exports MACHINE)
MACHINE ?= "kontron-mx8mm"
# =============================================
# ######### EXTRA FEATURES / ROOT PWD #########
# =============================================
# the default is to use the image feature `debug-tweaks` to remove the
# root password and add some packages (gdbserver, ptool, nano, etc.)
# remove it if you build a release image and set a root password
# by setting ROOT_PWD to a hashed password (`openssl passwd -1 password`)
# Note: you need to escape all '$' characters with '\' manually
# Note: the default value below is 'root'

EXTRA_IMAGE_FEATURES = "debug-tweaks"
#ROOT_PWD ?= "\$1\$/nrGReFp\$Emef9p70yRoahjHctKZ2p0"

# =============================================
# ######### SDK MACHINE #######################
# =============================================
# set a default SDKMACHINE
# possible values are "i686" and "x86_64" to build an SDK for
# 32-bit or 64-bit hosts respectively
SDKMACHINE ?= "x86_64"
# =============================================
# ######### SPECIAL OPTIONS/OVERRIDES #########
# =============================================
# set special options via MACHINEOVERRIDES
#MACHINEOVERRIDES .= ":option"
# =============================================
# ######### LICENSE / EULA RESTRICTIONS #######
# =============================================
# block/allow packages with certain licenses
# (e.g. commercial)
LICENSE_FLAGS_WHITELIST = "commercial"
# for builds including software from Freescale/NXP you might
# need to accept their EULA
ACCEPT_FSL_EULA = "1"
# =============================================
# ######### CACHE / DOWNLOAD PATHS ############
# =============================================
# set default locations for downloads and the sstate cache
DL_DIR ?= "${TOPDIR}/../downloads"
SSTATE_DIR ?= "${TOPDIR}/../sstate-cache"

# =============================================
# ######### PARALLEL TASKS / THREADING ########
# =============================================
# depending on your build host you might want to tweak
# the number of bitbake threads and parallel make tasks
BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()*2}"
PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
# =============================================
# ######### MISC ##############################
# =============================================
# uncomment to remove all temporary files after each build
# to save disk space
#INHERIT += "rm_work"
# =============================================
# ######### Mender integration ################
# =============================================
# enable u-boot and disable grub
MENDER_FEATURES_ENABLE_append = " mender-uboot mender-image-sd mender-image"
MENDER_FEATURES_DISABLE_append = " mender-grub mender-image-uefi"
# choosing kontron mender
PREFERRED_PROVIDER_u-boot = "u-boot-ktn"
# set providers otherwise the image is not generated
PREFERRED_RPROVIDER_u-boot-fw-utils = "libubootenv"
PREFERRED_RPROVIDER_nativesdk-u-boot-mkimage = "nativesdk-u-boot-mkimage"
# total image size
MENDER_STORAGE_TOTAL_SIZE_MB = "2048"
# artifact format
ARTIFACTIMG_FSTYPE = "ext4"
# mender-client version
PREFERRED_VERSION_mender-client = "3.0.0"
# mender-connect version
PREFERRED_VERSION_mender-connect = "1.2.0"
MENDER_ARTIFACT_NAME = "test-imx8mm"
# =============================================
# ######### K-USTOMIZATIONS ###################
# =============================================
# read only rootfs
IMAGE_FEATURES += "read-only-rootfs"
# When using read-only rootfs
SERIAL_CONSOLES_CHECK = ""
# set default time-zone to Europe/Rome
DEFAULT_TIMEZONE = "Europe/Rome"
# set command line utils to coreutils , remove busybox
# in order to remove busybox we need also to set login_manager to shadow
# otherwise busybox will be pulled in
PREFERRED_PROVIDER_virtual/base-utils = "coreutils"
VIRTUAL-RUNTIME_base-utils = "coreutils"
VIRTUAL-RUNTIME_base-utils-hwclock = "util-linux-hwclock"
VIRTUAL-RUNTIME_base-utils-syslog = ""
VIRTUAL-RUNTIME_login_manager = "shadow"
# remove splash screen
EXTRA_IMAGE_FEATURE_remove = "psplash"
# connman version
PREFERRED_VERSION_connman ??= "1.38"

u-boot-ktn_%.bbappend

require recipes-bsp/u-boot/u-boot-mender.inc

PROVIDES += "u-boot"
RPROVIDES_${PN} += "u-boot"

image-oskar.bb (i’ve removed summary and other personal info from this recipe )

require recipes-core/images/image-ktn-minimal.bb

# installed packages

IMAGE_INSTALL += "\
    udev-extraconf \
    packagegroup-core-ssh-dropbear \
    nano \
    vim \
    tree \
    htop \
    jq \
    libstdc++ \
    libssl \
    systemd-analyze \
    connman \
    connman-client \
    avahi-utils \
    tzdata \
    os-release \
    iw \
    curl \
    python3-modules \
    python3-grpcio \
    python3 \
    python3-dbus \
    rng-tools \
    linuxptp \
    ptpd \
    packagegroup-core-full-cmdline \
    coreutils \
    bash \
    less \
    mender-client \
    mender-connect \
    "

as you can see from the logs , the image is generated without errors

leonardo@leonardo5520:~/projects/yocto-ktn/build-ktn-imx$ bitbake image-oskar
Loading cache: 100% |#######################################################################################################################################################################| Time: 0:00:00
Loaded 4200 entries from dependency cache.
Parsing recipes: 100% |#####################################################################################################################################################################| Time: 0:00:04
Parsing of 2782 .bb files complete (2766 cached, 16 parsed). 4216 targets, 437 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "1.46.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-ktn-linux"
MACHINE              = "kontron-mx8mm"
DISTRO               = "oskar"
DISTRO_VERSION       = "4.0.0-beta"
TUNE_FEATURES        = "aarch64 cortexa53 crc crypto"
TARGET_FPU           = ""
DISTRO_CODENAME      = "oskar-dunfell"
GCCVERSION           = "9.%"
PREFERRED_PROVIDER_virtual/kernel = "linux-ktn"
PREFERRED_VERSION_linux-ktn = "5.10"
meta                 
meta-poky            = "HEAD:a13bda44fcda4e79e9aed39ca1495eabecb6a7b7"
meta-qt5             = "HEAD:0d8eb956015acdea7e77cd6672d08dce18061510"
meta-ktn             = "dunfell:86b3ca099e42113d7ab60dde996993c6fde32257"
meta-oskar           = "master:e878c506515000e1166dc30a302635d01b2d0f9e"
meta-mender-core     = "dunfell:fc74c85bae5bfc5663a41881ea945de35318fa69"
meta-ktn-imx         = "HEAD:8a07021c00fae326478abae8c3a0be52d957a4f7"
meta-arm             
meta-arm-toolchain   = "HEAD:02c660521619ddb7a9495d65403aaa2636747ce8"
meta-freescale       = "HEAD:e4f860590ab1177a1ac9eb06dad15d4861c0c485"
meta-oe              
meta-python          
meta-networking      = "HEAD:346681e7bf9c78008a845fc89031be4fd4ceb3a1"
meta-python2         = "HEAD:c96cfe30701ba191903c5f7d560c3ba667d46c9d"

Initialising tasks: 100% |##################################################################################################################################################################| Time: 0:00:02
Sstate summary: Wanted 25 Found 15 Missed 10 Current 1535 (60% match, 99% complete)
NOTE: Executing Tasks
NOTE: Tasks Summary: Attempted 3910 tasks of which 3868 didn't need to be rerun and all succeeded.

the issues starts here .
i can find the sdimg file in the deploy folder , i can write it to an sdcard and it contains 4 partitions

leonardo@leonardo5520:/media/leonardo$ lsa
totale 33K
drwxr-x---+  6 root     root     4,0K gen 25 11:38 .
drwxr-xr-x   3 root     root     4,0K nov 30 08:43 ..
drwxr-xr-x   3 root     root     4,0K gen 25 11:32 adcef5a0-9dcb-412e-a3fd-b5393b7e5443
drwxr-xr-x   3 leonardo leonardo  16K gen  1  1970 boot
drwxr-xr-x   5 root     root     1,0K gen 25 11:32 data
drwxr-xr-x  21 root     root     4,0K gen 25 11:32 e332f554-4c6a-4f0e-a836-862dffba9b1f

but :

  • the e332f554-4c6a-4f0e-a836-862dffba9b1f partition is the rootfs partition and seems to contain all the right folder/files but it’s copy (the adcef5a0-9dcb-412e-a3fd-b5393b7e5443 partition) is empty;

  • the data partition contains 2 folders as you can see below ( seems strange to me but it’s not a real issue )

leonardo@leonardo5520:/media/leonardo/data$ lsa
totale 19K
drwxr-xr-x  5 root root 1,0K gen 25 11:32 .
drwxr-x---+ 6 root root 4,0K gen 25 11:38 ..
drwx------  2 root root  12K gen 25 11:32 lost+found
drwxr-xr-x  2 root root 1,0K mar  9  2018 mender
drwxr-xr-x  2 root root 1,0K mar  9  2018 u-boot
leonardo@leonardo5520:/media/leonardo/data$ cd u-boot/
leonardo@leonardo5520:/media/leonardo/data/u-boot$ lsa
totale 3,0K
drwxr-xr-x 2 root root 1,0K mar  9  2018 .
drwxr-xr-x 5 root root 1,0K gen 25 11:32 ..
-rw-r--r-- 1 root root   61 mar  9  2018 fw_env.config
leonardo@leonardo5520:/media/leonardo/data/u-boot$ cd ..
leonardo@leonardo5520:/media/leonardo/data$ cd mender/
leonardo@leonardo5520:/media/leonardo/data/mender$ lsa
totale 4,0K
drwxr-xr-x 2 root root 1,0K mar  9  2018 .
drwxr-xr-x 5 root root 1,0K gen 25 11:32 ..
-r--r--r-- 1 root root   26 mar  9  2018 device_type
-rw------- 1 root root   76 mar  9  2018 mender.conf

  • finally… the image won’t boot :frowning:

I’m pretty sure the build system is setup correctly ( because of the previous builds that boots correctly )

Am i missing something ?