Android 10 Build Guide for RSB-3720
Android BSP Version
- Android: 10.0.0_r35
Introduction
This document describes how to work with the RISC and ELAA Android 10.0.0 Board Support Package (BSP) release. The BSP includes bootloaders, the Android Linux kernel and root file system, and tools and documentation to ease the development, deployment, and execution of Android-based systems.
Setup Ubuntu Host Computer
Required Equipment and Software
- Ubuntu 18.04 LTS 64bit for Android build host OS
- 130 GB bytes free disk space for build image
Install Ubuntu
IMPORTANT! You must be able to log in as root or use
sudoto have root permissions during the installation.
Download the 64-bit PC (AMD64) desktop image from Ubuntu 18.04 Releases for the installation.
Docker Install and Setting
If you don't have Docker in your system, follow the steps below to install and run it first.
Install Docker Engine
Please refer to the Docker Installation Guide for details.
Pull Ubuntu 18.04 Image from Docker Hub
$ docker pull advrisc/u18.04-rk3399abv10
Run Docker Example
Step 1 Run docker container:
$ docker run -it --name android_q10 -v /home/bsp/myandroid:/home/adv/BSP:rw advrisc/u18.04-rk3399abv10 /bin/bash
Step 2 In container, change the user:
adv@7cc0fa834366:~$ sudo chown adv:adv -R BSP
Install Docker and Use Docker
Please use Docker environment to compile Android 10.0.0.
- Android 10.0.0 Docker
- Image Repository: advrisc/u18.04-rk3399abv10
- Image Tag: latest
docker pull advrisc/u18.04-rk3399abv10
docker run --name imx8ABV10 -it advrisc/u18.04-rk3399abv10 /bin/bash
Getting Android Source Code
Related Version Information
- Android 10.0.0_r35
- Kernel Yocto-3.0
- U-Boot Yocto-3.0
Step 1 Pull down the Android source tree to your working directory:
$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com
$ mkdir myandroid
$ mkdir bin
$ cd myandroid/
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ../bin/repo
$ chmod a+x ../bin/repo
$ ../bin/repo init -u https://gitlab.edgecenter.io/nxp/android-manifest.git -b q10.0.0_2.3.0-ga -m release_version.xml
$ ../bin/repo sync
The release_version.xml is as follows:
RSB3720 → RSB3720_Q10_AIV0002.xml
If you get the error
server certificate verification failed, please run:export GIT_SSL_NO_VERIFY=1This lets the Git client ignore SSL certificate verification.
Step 2 Patch to Android Q10.0.0.0:
$ cd ~/myandroid/vendor/nxp-opensource/uboot-imx/
$ patch -p1 < ../../../patches_android-10.0.0_r35/10001-Uboot_Yocto_5.4.24_2.1.0-to-android-10.0.0_r35.patch
$ cd ~/myandroid/vendor/nxp-opensource/kernel_imx/
$ patch -p1 < ../../../patches_android-10.0.0_r35/10001-Linux_Yocto_5.4.24_2.1.0-to-android-10.0.0_r35.patch
$ cd myandroid
Building Android 10.0.0 Image for SD Card
For ROM-5722, the product name is:
$PRODUCT = rsb3720_a1
Build Instructions
Set the $JAVA_HOME environment variable:
$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
$ export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-
Set up the build environment:
$ source build/envsetup.sh
Execute the Android lunch command (for RSB-3720):
$ lunch $PRODUCT-userdebug
Build bootloader:
$ ./imx-make.sh bootloader -j8
The two files
u-boot_crc.binandu-boot_crc.bin.crcwill be located in./out/target/product/product_name.
Build kernel:
$ ./imx-make.sh kernel -j8
Build boot image:
$ ./imx-make.sh bootimage -j4
Build dtbo image (kernel device tree):
$ ./imx-make.sh dtboimage -j4
Build system image:
$ ./imx-make.sh -j8
Burning Image
SD Card Boot
Go to the built image file directory:
# For daily build
$ cd ~/image/
# For local build
$ cd ~/out/target/product/PRODUCT_NAME/
Enter flash command (for RSB-3720):
$ sudo ./fsl-sdcard-partition.sh -super -f imx8mp /dev/sdX # X: SD card device drive
Image from SD Card to eMMC Boot
Download the package for images (e.g., RSB3720-androidQ10-AIV00XX-YYYYMMDD.tar.gz).
Flash SD Card image:
$ tar zxvf RSB3720-androidQ10-AIV00XX-YYYYMMDD.tar.gz # extracts image/ and scripts/
$ cd scripts/
$ sudo ./mk-sdcard-mmc-partition.sh -super -f imx8mp /dev/sdX # X: SD card device drive
Boot from SD Card, then on debug console, flash image to eMMC:
$ su
# cd /data/mkimage/scripts
# ./mk-emmc-mmc-partition.sh -super -f imx8mp /dev/block/mmcblk2