The Compilation Of Android Q10.0.0_2.1.0 On ubuntu 18.04 LTS Based On VMware Player 14.0

Document created by Wigros Sun Employee on Apr 30, 2020
Version 1Show Document
  • View in full screen mode

In order to improve the speed of compilation, VMWare Player 14.0 is installed on local hard
disk, and Ubuntu 18.04 LTS is installed on a SSD with at least 500GB size and USB3.1 specification.
When installing ubuntu 18.04 LTS to SSD, it should be allocated at least 350GB of disk space,
because compiling this version of android requires a larger disk space.
The following are detailed compilation steps:

Part l Configuring Ubuntu 18.04 LTS

1. Installing Ubuntu 18.04 on VMplayer 14.0
After installation is done, root user should be set at first.
# sudo passwd root
Then follow these steps to configuration ubuntu 18.04 for environment of compiliation
--Changing sources of ubuntu 18.04 mirror
If you are Chinese users, you can do the step, which can improve your system performance.
# sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# sudo geit /etc/apt/source.list

Comment
I.MX customers outside China do not need to modify Ubuntu source list, or can modify it to
local mirror site of Ubuntu 18.04, which can improve the speed of software upgrade.

   Delet all sources and copy following lines here, Then save it and exit

Changing ubuntu source

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

   Then running these 2 commands to update sources and packages
   # sudo apt-get update
   # sudo apt-get upgrade
2. Installing packages for compiliation

Packages for compiliation
# sudo apt-get install flex bison gperf build-essential zlib1g-dev lib32ncurses5-dev x11proto-core-dev libx11-dev
lib32z1-dev libgl1-mesa-dev tofrodos python-markdown libxml2-utils xsltproc
# sudo apt-get install uuid-dev:i386 liblzo2-dev:i386 gcc-multilib g++-multilib subversion openssh-server
openssh-client uuid uuid-dev zlib1g-dev liblz-dev lzop liblzo2-2 liblzo2-dev git-core curl
# sudo apt-get install u-boot-tools mtd-utils android-tools-fsutils openjdk-8-jdk device-tree-compiler aptitude
libcurl4-openssl-dev nss-updatedb
# sudo apt-get install chrpath texinfo gawk cpio diffstat gdisk m4 libz-dev libssl-dev

 

Part 2 Compiling Android Q10.0.0_2.1.0 BSP

1. Downloading NXP source code for Android Q10.0.0_2.1.0
   File name is imx-android-10.0.0_2.1.0.tar.gz.
   Copy the file to ~/, and decompress it.
   # cd ~/
   # tar zxvf ./imx-android-10.0.0_2.1.0.tar.gz
   Then “imx-android-10.0.0_2.1.0” directory is created at ~/, now run the command to
download android source code.
# source ./imx-android-10.0.0_2.1.0/imx_android_setup.sh

Comment
imx_android_setup.sh is a script file, which includes all steps needed by the environment of
android Q10.0.0_2.1.0 BSP.
If network environment is enough good, several hours later, it will be done.

2. Compiling Android Q10.0.0_2.1.0
Referring to steps in Android_User's_Guide.pdf, We summaries steps for compilation here:
(1) Preparing cross-compile tool chain
   In Android_User's_Guide.pdf, 2 kinds of tool chain are recommended for users.
--- gcc-arm-8.3-2019.03-x86_64-aarch64-elf.tar.xz
--- gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz
   Users can select one of them, and then decompress it to /opt/ directory.

On how to download them or more details, see Android_User's_Guide.pdf, page 3.
Here we will use gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz as tool chain.

(2) Beginning to Compile Android Q10.0.0_2.1.0 BSP
   Since this version of Android BSP requires high memory capacity when compiling, if the
memory configuration of the virtual machine is incorrect, it is very likely to cause the compilation
to fail. The following is a list of variable tests for user reference:

# cd android_build
# export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-
# source build/envsetup.sh
# lunch evk_8mp-userdebug
# ./imx-make.sh -j2 2>&1 | tee build-log.txt

Part 3 Errors During Compilation

1. Allocating 8GB Memory For VMware Player
# ./imx-make.sh -j1 2>&1 | tee build-log.txt

2. Allocating 12GB Memory For VMware Player
# ./imx-make.sh -j4 2>&1 | tee build-log.txt

# ./imx-make.sh -j4 2>&1 | tee build-log.txt (Run it again)

# ./imx-make.sh -j4 2>&1 | tee build-log.txt (Run it again)

      So if we use 4 thread to compile BSP, command for compilation will have to be run for 3 times.

 

NXP TIC Team
Weidong Sun
2020/4/30

Attachments

    Outcomes