We're hiring!
*

Running Android and Wayland on embedded devices

Robert Foss avatar

Robert Foss
May 02, 2019

Share this post:

Let's get Android running next to Wayland on an i.MX6 based Nitrogen6_MAX board.

A previous post introduced the SPURV Android compatibility layer for Wayland based Linux environment.

In this post, we're going to dig into how you can run an Android application on the very common i.MX6 based Nitrogen6_MAX board from Boundary Devices.

Install dependencies

sudo apt install \
    apt-transport-https \
    bmap-tools \
    ca-certificates \
    curl \
    git \
    gnupg2 \
    repo \
    software-properties-common \
    u-boot-tools \
    qemu-kvm

Set up Docker container for building

Docker is needed for generating the Debian root filesystem later on.

# Install Docker
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
sudo apt update
sudo apt install docker-ce

# Set up privileges for Docker
sudo usermod -aG docker ${USER}
su - ${USER}

# Fetch Docker image
docker pull godebos/debos:latest

Build Android

For building Android we've chosen to target version  9.0.0_r10, but this is mostly in order to ensure that these instructions remain correct going forward. This work should all be viable for later versions of Android too.

mkdir android; cd android
repo init -u https://android.googlesource.com/platform/manifest -b android-9.0.0_r10
git clone https://gitlab.collabora.com/spurv/android_manifest.git .repo/local_manifests/
repo sync -j15
. build/envsetup.sh
lunch spurv-eng
make -j12
cd ..

Build Linux Kernel

We're using a kernel branch which is very close to upstream modulo one or two patches. The kernel we're going to build will be targeting i.MX 6 & 7 series SOCs.

git clone https://gitlab.collabora.com/spurv/linux.git -b android-container_v5.1-rc5
cd linux
sh ../android/device/freedesktop/spurv/build-kernel.sh
cd ..

Create & flash root filesystem

Just a kernel does not make an OS, so we're using Debian as a base. The way we're going to create the root filesystem is using debos, which is a tool for creating Debian based OS images. You can learn more about it here.

Now we're ready to integrate all of the above into one coherent image. This is where the Nitrogen6_MAX devboard targeting comes in.

git clone https://gitlab.collabora.com/spurv/debos.git
sudo debos/build_image.sh -b /dev/mmcblk0

The platform specific parts are contained in uboot_nitrogen6qp-max.scr and build_image.sh.

Boot!

Pop the flashed SD-card into your device and restart it, and then log in as root/root.

In order to start Android, run one of these two commands:

# Launch Weston and an Android application
/home/aosp/run.sh

Starting the Android application might take a minute or two, but Weston should start immediately.

Acknowledgments

A lot of different contributors enabled this work, both directly and indirectly.

  • Boundary Devices
  • Pengutronix
  • Zodiac

 


Visit Robert's blog.

Comments (5)

  1. piec:
    May 05, 2019 at 12:14 PM

    Great work
    Typo: I think the git url should be "https://gitlab.collabora.com/spurv/debos/" in the "Create & flash root filesystem" paragraph

    Reply to this comment

    Reply to this comment

  2. Andy KIm:
    Jul 08, 2019 at 07:12 AM

    I want to know why 2 drm driver is needed?
    Does both imx-drm and etnaviv need for what?
    Eg. imx-drm is for Android and etnaviv is for weston.

    Reply to this comment

    Reply to this comment

  3. Andy Kim:
    Jul 10, 2019 at 03:33 AM

    I want to know why 2 drm drivers(imx-drm and etnaviv) is needed?
    Is only etnaviv not enough?

    Reply to this comment

    Reply to this comment

    1. Robert Foss:
      Jul 16, 2019 at 03:49 PM

      Hey Andy,

      Those are drivers for two different things. imx-drm is the display controller, and etnaviv the gpu.
      Those are different parts and are not always shipped together.

      Reply to this comment

      Reply to this comment


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

Virglrenderer and the state of virtualized virtual worlds

28/08/2019

With the release of virglrenderer 0.8.0, getting accelerated OpenGL within a virtual machine (VM) made a big leap forward. Since virglrenderer-0.7.0,…

ROCK Pi and an easy place: Panfrost & Wayland on a Rockchip board

06/08/2019

Ongoing work on the reverse-engineered Panfrost OpenGL ES driver for Arm Mali GPUs has turned the RK3399 SoC into a very attractive platform…

What's new in OpenXR 1.0 & Monado?

02/08/2019

As part of its unwavering commitment to open source and open standards, Collabora is proud to be part of bringing the recently-released…

Zink: Summer Update & SIGGRAPH 2019

25/07/2019

There's been quite a few updates to Zink, an OpenGL implementation on top of Vulkan, since I last wrote about it. Here's an overview of…

GStreamer in Oslo

18/07/2019

A little over a month and a half ago, Collaborans including Aaron Boxer, George Kiagiadakis, Guillaume Desmottes, Stéphane Cerveau and myself…

GNOME meets Panfrost

26/06/2019

In my last Panfrost blog post, I announced my internship goal: improve Panfrost to run GNOME3. GNOME is a popular Linux desktop making heavy…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2019. All rights reserved. Website sitemap.