Introduction
This document outlines the steps of setting up and running Android Automotive images on Linaro’s Trusted Reference Stack (TRS) using prebuilt images. When completed, you will be able to boot the Android Automotive OS (AAOS) image in a DomU (aka VM) running on top of the Xen Hypervisor using TRS in the Dom0. The AAOS image will utilize the AVA platform's frame buffer (unaccelerated) and use VirtIO serial device to enable keyboard and mouse.
If interested in building from source please refer to the following documents [1][2] for details.
Prerequisites
You will need the following to run this demo
AVA Platform
Display connected to the VGS?? interface
Enough disk space
Linux desktop (x86 is fine)
Prebuilt images
Prebuilt images can be pre-downlaoded as follows:
The TRS prebuilt image is:
https://people.linaro.org/~leo.yan/arm_blueprint/aaos_on_xen/trs-image-trs-qemuarm64.wic.The prebuilt Android automotive image is: https://people.linaro.org/~leo.yan/arm_blueprint/aaos_on_xen/cuttlefish.tgz.
Flash the TRS image
TRS image can be flashed on either an NVME or a USB stick. It’s recommended to use the shell script below (select the device you wish to flash to):
$ wget https://people.linaro.org/~leo.yan/arm_blueprint/aaos_on_xen/trs-image-trs-qemuarm64.wic $ sh flash_trs.sh /dev/nvmeXn1 # for flashing TRS on NVME block device $ sh flash_trs.sh /dev/sdX # for flashing TRS on USB stick
This script extends the root file system partition to the end of the device to provide sufficient disk space for storing the Android Automotive OS image.
#!/bin/bash DEV=$1 sudo parted ${DEV} print echo "Please confirm if the partition is right?" while : ; do read -n 1 k <&1 if [[ $k = y ]] ; then printf "\n" break else printf "\nExit\n" exit 0 fi done echo "Copy image to ${DEV}" sudo dd bs=4M if=./trs-image-trs-qemuarm64.wic of=$DEV status=progress && sync sudo growpart $DEV 2 sudo /home/leoy/Downloads/e2fsprogs-1.47.0/e2fsck/e2fsck -f "${DEV}p2" sudo /home/leoy/Downloads/e2fsprogs-1.47.0/resize/resize2fs "${DEV}p2" ## Add comment #sudo /home/leoy/Downloads/e2fsprogs-1.47.0/e2fsck/e2fsck -f "${DEV}2" #sudo /home/leoy/Downloads/e2fsprogs-1.47.0/resize/resize2fs "${DEV}2" sudo parted ${DEV} print
Note 1: The shell script requires the e2fsck
and resize2fs
utilities to be at least version 1.47.0 or newer. if not available, please download the e2fsprogs
source and build it and install it.
Note 2: Because USB stick and NVME device have different block naming, you need to comment out lines 23 and 24, and enable lines 25 and 26.
Run Android Automotive in a Xen virtual machine
Once TRS system booted up, you need to download Android Cuttlefish image and uncompress it into a specific folder (eg. /home/leoy/android-cf-mainline/cf
). Due to the overlay images contains the absolute path. The commands are:
# wget https://people.linaro.org/~leo.yan/arm_blueprint/aaos_on_xen/cuttlefish.tgz # wget https://people.linaro.org/~leo.yan/arm_blueprint/aaos_on_xen/aaos_vm.cfg # wget https://people.linaro.org/~leo.yan/arm_blueprint/aaos_on_xen/u-boot.bin # mkdir -p /home/leoy/android-cf-mainline/cf/ # tar zxvf cuttlefish.tgz -C /home/leoy/android-cf-mainline/cf/
Launch Xfce4 windows manager:
# startxfce &
Run AAOS in a Xen virtual machine:
# export DISPLAY=:0 # xl -vvv create aaos_vm.cfg -c
[1] Xen: maintenance Xen and QEMU repos for TRS
[2] Xen: porting Android Cuttlefish on Xen Virtual Machine