Personal tools

Recipe for building Android9 for NX8MM-35

From ICOP tech wiki

Jump to: navigation, search

Recipe for building Android 9 for NX8MM-35


Download the Android p9.0.0_2.0.0_GA document on NXP website.


Download the Android P9.0.0_2.0.0_GA Android release package:

Suggest O/S: Ubuntu 18.04 or later.

Storage: Please make sure the capacity of your storage has 300GB or bigger space.

RAM: Please make sure the physical memory + swap has 16GB or bigger capacity.

Procedure

Step 1. After downloaded the imx-p9.0.0_2.0.0.tar.gz file, put it under /opt.

The vendor/nxp file is the source code provided by NXP, and we will copy the content in this file to vendor/nxp in Android BSP.


The software package that need to be downloaded first:

$ sudo apt-get install gnupg flex bison gperf build-essential zip zlib1g-dev libc6-dev \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev tofrodos \
python-markdown libxml2-utils xsltproc uuid-dev:i386 liblzo2-dev:i386 gcc-multilib \
g++-multilib subversion openssh-server openssh-client uuid uuid-dev zlib1g-dev liblz-dev \
liblzo2-2 liblzo2-dev lzop git-core curl u-boot-tools mtd-utils android-tools-fsutils \
openjdk-8-jdk device-tree-compiler gdisk liblz4-tool m4 libz-dev phablet-tools

Develop a director for evk BSP to develop the construction for Android 9.


Step 2. Downloading Android 9.0.0-2.0.0 source code:

Create the bin folder in the home directory:

mkdir ~/bin
curl curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
export PATH=${PATH}:~/bin

Modifying repo file:

Open ~/bin/repo file with 'gedit' and Change google address
From
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
To
REPO_URL = ' https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/ '

Setting email address:

git config —global user.name “xxxx”
git config —global user.email “xxxx@xxx”

Download the source code:

mkdir ~/imx-android cd ~/imx-android repo init -u https://github.com/nxp-imx/imx-manifest -b imx-android-pie -m imx-p9.0.0_2.0.0-ga.xml repo sync


Step 3. Making the Android image:

Before starting to make the Android image, please be reminded to move the /vendor/nxp directory in imx-p9.0.0_2.0.0.tar.gz to /vendor/nxp in the BSP. Since there are a directory under /vendor/nxp in the BSP, there will have 10 directories in /vendor/nxp in the BSP.

Switch to the directory under BSP, and execute:

export MY_ANDROID=~/imx-android
export ARCH=arm64
export CROSS_COMPLOE=${MY_ANDROID}/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
source build/envsetup.sh
lunch evk_8mm-userdebug
make -j8

After the process is done, the image for EVK has been made.


Step 4. Install the patch for NX8MM-35

Please put the patch in the link in the file below and run it:

https://ftp.icop.com.tw/share/7P5RuLPk

cd ~/imx-android

Apply command:

git apply --whitespace=nowarn <patch filename>

dm446_full_patch.patch

Remake the image, and the Android image for NX8MM-35 will be made.

make -j8
MAKE.png





Copy the files in ~/imx-android/out/target/product/evk_8mm and the uuu utility to your PC for restoring the image to NX8MM-35.

boot.img
u-boot-imx8mm.imx
u-boot-imx8mm-evk-uuu.imx
dtbo-imx8mm.img
partition-table.img
system.img
vbmeta-imx8mm.img
vendor.img
uuu_imx_android_flash.sh
UUU Utility

Apply command:

./uuu_imx_android_flash.sh -f imx8mm -a -c

After restore the image to NX8MM-35, the Android could be bootable.