Running Mender together with Automotive Grade Linux (AGL)

One of our demos at Embedded World 2019 was running Automotive Grade Linux on a Up Squared board with Mender integrated obviously :slight_smile: .

Wanted to share how we set this up in the hope that it will be useful to someone.

NOTE! This probably work just as well on any other ‘intel-corei7-64’ based device, e.g the Minnowboard Turbot or Intel NUC.

Instructions on how to setup AGL + Up Squared + Mender

Prerequisites:

  • A supported Linux distribution and dependencies installed on your workstation/laptop as described in the Yocto Mega Manual
    • Instructions depend on which Yocto version you intend to use. (rocko in this case)
  • Google repo tool installed and in your PATH .
  • Up Squared board
  • USB Flash drive (Used as a Live disk, to provision eMMC)

Create a working directory:

mkdir agl && cd agl

Down the repo manifest file for AGL sources (rocko based):

repo init -b flounder -m eel_6.0.4.xml -u https://gerrit.automotivelinux.org/gerrit/AGL/AGL-repo

Fetch the sources:

repo sync

Clone Mender layers:

git clone https://github.com/mendersoftware/meta-mender.git -b rocko

Setup the environment for ‘intel-corei7-64’ target:

source meta-agl/scripts/aglsetup.sh \
-m intel-corei7-64 \
-b build \
agl-devel agl-demo agl-appfw-smack agl-netboot agl-audio-4a-framework

Append the following to ‘conf/bblayers.conf’:

BBLAYERS =+ "\
    ${METADIR}/meta-mender/meta-mender-core \
    ${METADIR}/meta-mender/meta-mender-demo \
"

Append the following to ‘conf/local.conf’:

# Mender
#
# Appended fragment from meta-mender-community/templates
#
# # This really saves a lot of disk space!
INHERIT += "rm_work"
#
# # The name of the disk image and Artifact that will be built.
# # This is what the device will report that it is running, and different updates
# # must have different names because Mender will skip installation of an Artifact
# # if it is already installed.
MENDER_ARTIFACT_NAME = "release-1"
#
INHERIT += "mender-full"
#
# # 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 = ""
#
# # Build for Mender demo server
# #
# # https://docs.mender.io/getting-started/create-a-test-environment
# #
# # Uncomment below and update IP address to match the machine running the
# # Mender demo server
# #MENDER_DEMO_HOST_IP_ADDRESS = "192.168.0.100"
#
# # Build for Mender production setup (on-prem)
# #
# # https://docs.mender.io/artifacts/building-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! 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 = "https://docker.mender.io"
# #FILESEXTRAPATHS_prepend_pn-mender := "<DIRECTORY-CONTAINING-server.crt>:"
# #SRC_URI_append_pn-mender = " file://server.crt"

#MENDER_STORAGE_DEVICE = "/dev/sda"
MENDER_STORAGE_DEVICE = "/dev/mmcblk0"
MENDER_GRUB_STORAGE_DEVICE = "hd0"

# # The size of core-image-base is 936 MB, meaning that if one tries to build
# # that specific image you get an build error saying that it does not fit in the
# # allocated part. This is because the default *total size* is set to 1024MB in
# # mender-setup.bbclass, this value is used to calculate IMAGE_ROOTFS_MAXSIZE
# #
# # Lets increase the total storage as the core-image-base target is quite
# # common and is the only image type that fully supports target device hardware.
MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT = "8192"
#
# # Easier to transfer compressed images for provisioning
IMAGE_FSTYPES_append = " uefiimg.gz"

Now you can start the build with:

bitbake agl-demo-platform

Follow instructions on Mender Hub on how to provision an Up Squared board

2 Likes