# Running Mender together with Automotive Grade Linux (AGL)

**URL:** <https://hub.mender.io/t/running-mender-together-with-automotive-grade-linux-agl/284>\
**Category:** General Discussions\
**Tags:** yocto, intel-up-squared, agl\
**Created:** [March 4, 2019, 12:10pm UTC](https://hub.mender.io/t/running-mender-together-with-automotive-grade-linux-agl/284 "2019-03-04T12:10:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [March 4, 2019, 12:10pm UTC](https://hub.mender.io/t/running-mender-together-with-automotive-grade-linux-agl/284/1 "2019-03-04T12:10:12Z")

</div>

One of our demos at Embedded World 2019 was running [Automotive Grade Linux](https://www.automotivelinux.org/) on a [Up Squared](https://up-board.org/upsquared/specifications/) board with Mender integrated obviously 🙂 .

 ![D0Zb-fmW0AAN-4P](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/1X/0179436d4ed573003880011fa9461fa94d3a7446.jpeg)

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](https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#detailed-supported-distros)
  - Instructions depend on which Yocto version you intend to use. (rocko in this case)

- Google repo tool[installed](https://hub.mender.io/t/google-repo/58/2) and in your PATH .
- [Up Squared](https://up-board.org/upsquared/specifications/) board
- USB Flash drive (Used as a Live disk, to provision eMMC)

Create a working directory:

```auto
mkdir agl && cd agl

```

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

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

```

Fetch the sources:

```auto
repo sync

```

Clone Mender layers:

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

```

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

```auto
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’:

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

```

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

```auto
# 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:

```auto
bitbake agl-demo-platform

```

Follow instructions on Mender Hub on how to provision an [Up Squared board](https://hub.mender.io/t/up-squared-up2/126)
