The official Mender documentation explains how Mender works. This is a board-specific complement to the official documentation.
This is my experiance in adding Mender layer in iMX8 Apalis board and i thought to share this with you.
Device description
The board is Apalis iMX8 | Toradex Developer Center that is used for integration with boot2qt manifests
Support level
We did the initial testing and things seems to be working fine.
Getting started
-
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.
-
Google repo tool installed and in your
PATH
-
A deployment environment using a desktop PC with Ubuntu 20.04 and Google Chrome as a web browser and at least 10 GB free disk space and 2 GB RAM available for Mender.
-
You should have a running Mender demo server. Instructions on how to setup this up can be found here
-
Apalis iMX8 carrier board
-
Apalis iMX8 SOM
-
Working U-boot on the Apalis iMX8
- If you do not have a working U-boot, please consult the iMX Recovery Mode section of the Toradex developer resources.
-
Qt Creator IDE installed on your development PC . On a Debian based operating system you can run:
apt-get install qtcreator
Create workspace and change directory:
mkdir boot2qt && cd boot2qt
Clone meta-boot2qt
:
repo init -u git://code.qt.io/yocto/boot2qt-manifest -m v6.4.3.xml
repo sync
Download mender meta directories using git clone, we used git clone and got to kirkstone branch
cd sources
git clone https://github.com/mendersoftware/meta-mender.git -b kirkstone
git clone https://github.com/mendersoftware/meta-mender-community.git -b kirkstone
cd ..
Initialize the environment:
MACHINE=apalis-imx8 source ./setup-environment.sh
Add Mender layers to environment:
cat <<- 'EOF' >> conf/bblayers.conf
BBLAYERS += "${BSPDIR}/sources/meta-mender/meta-mender-core"
BBLAYERS += "${BSPDIR}/sources/meta-mender/meta-mender-demo"
BBLAYERS += "${BSPDIR}/sources/meta-mender-community/meta-mender-toradex-nxp"
EOF
Also , i updated local.conf
based on findings from this post.
here are local.conf
lines i added/updated.
MENDER_ARTIFACT_NAME = "release-1"
INHERIT += "mender-full"
INIT_MANAGER = "systemd"
INHERIT += "mender-toradex"
MENDER_FEATURES_ENABLE:append = " mender-uboot mender-image-sd"
MENDER_FEATURES_DISABLE:append = " mender-grub mender-image-uefi"
IMAGE_CLASSES += "image_type_mender_tezi"
IMAGE_FSTYPES:append = " mender_tezi"
IMAGE_FSTYPES:remove = " teziimg"
KERNEL_IMAGETYPE:aarch64_mender-grub = "Image"
IMAGE_BOOT_FILES:remove:mender-grub = "boot.scr-verdin-imx8mm;boot.scr"
IMAGE_BOOT_FILES:remove:mender-uboot = "zImage ${KERNEL_DEVICETREE} overlays.txt overlays/*;overlays/"
MENDER_IMAGE_BOOTLOADER_BOOTSECTOR_OFFSET:apalis-imx8 = "0"
MENDER_BOOT_PART_SIZE_MB:apalis-imx8 = "32"
OFFSET_SPL_PAYLOAD:apalis-imx8 = ""
MENDER_STORAGE_DEVICE:apalis-imx8 = "/dev/mmcblk0"
MENDER_STORAGE_TOTAL_SIZE_MB:apalis-imx8 = "12288"
MENDER_UBOOT_POST_SETUP_COMMANDS:append = " ; setenv tdxargs ${tdxargs} ${bootargs}; "
MENDER_UBOOT_POST_SETUP_COMMANDS:append = " ; setenv overlays_file /boot/overlays.txt;setenv overlays_prefix boot/overlays/ "
Build an image:
bitbake b2qt-embedded-qt6-image
for the recommended demo image by Qt, or
bitbake core-image-minimal
There might be a warning or error while applying patches to u-boot-toradex
. In that case refreshing the the patch 0001-Adapt-boot.cmd.in-to-Mender
might be necessary.
After the build completes , .mender
and .mender_tezi.tar
files are available
Follow the standard procedure to update the mender builds afterwards.