Home > Uncategorized > Cheat Sheet installing Android 7.1.2 nouget on i.mx6

Cheat Sheet installing Android 7.1.2 nouget on i.mx6

March 6th, 2018

It has been a while since Freescale released nouget 7.1.2. We have clubbed together a cheat sheet to build Android for the Sabre SD platform. This should help you to do a quick copy paste to get whole thing going.

Install following packages

It is possible that you have following packages already installed - but just make sure

sudo apt-get install uuid uuid-dev
sudo apt-get install zlib1g-dev liblz-dev
sudo apt-get install liblzo2-2 liblzo2-dev
sudo apt-get install lzop
sudo apt-get install git-core curl
sudo apt-get install u-boot-tools
sudo apt-get install mtd-utils
sudo apt-get install android-tools-fsutils
sudo apt-get install openjdk-8-jdk

Create a directory - call it myandroid to hold all the packages

$ cd ~
$ 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://android.googlesource.com/platform/manifest -b android-7.1.2_r9
$ ~/bin/repo sync
# Please make sure you have plenty of time. It may take overnight.
$cd ~/myandroid/system/tools
$ git clone https://android.googlesource.com/platform/system/tools/bpt
$ cd bpt
$ git checkout -b n7.1.2_2.0.0-gab7c3059e5d8c408f60222edc898ef1c229d8fc2d

No Get the kernel source code

$cd ~/myandroid
$git clone git://git.freescale.com/imx/linux-imx.git kernel_imx
#the kernel repo is large. Therefore, this process can take a while.
cd kernel_imx
$git checkout n7.1.2_2.0.0-ga

Get the u-boot

$cd ~/myandroid/bootable
$mkdir bootloader
$cd bootloader
$git clone git://git.freescale.com/imx/uboot-imx.git uboot-imx
$cd uboot-imx
$git checkout n7.1.2_2.0.0-ga

Download the file android_N7.1.2_2.0.0_source.tar.gz from nxp / freescale ( requires login) to directory, say, android7.1.2 and unzip it

$cd android7.1.2
$tar xzvf android_N7.1.2_2.0.0_source.tar.gz

$cd ~/myandroid
$source ~/android7.1.2/android_N7.1.2_2.0.0_source/code/N7.1.2_2.0.0/and_patch.sh
Make sure you see a c_patch command available
$c_patch ~/android7.1.2/android_N7.1.2_2.0.0_source/code/N7.1.2_2.0.0/ imx_N7.1.2_2.0.0-ga

If this is successful you should see a message that says something like - you can build the Android code for FSL.

Building Android

$cd ~/myandroid
$source build/envsetup.sh

Select sabresd_6dq-user

The following is required to avoid GC overhead limit error. Increasing heap size helps.

$export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4g"
$./prebuilts/sdk/tools/jack-admin kill-server
$./prebuilts/sdk/tools/jack-admin start-server

Not the make command

$ make 2>&1 | tee build-log.txt

It takes some time ( Like 5 hours of a decent laptop).

The above process generates files for eMMC. To generate it for SD Card, you will need to do following

1. Remove /out/target/product/sabresd_6dq/root directory and boot*.img.
2. Remove /out/target/product/sabresd_6dq/recovery directory and recovery*.img.
3. Build the boot.img and recovery.img as follows:
make bootimage BUILD_TARGET_DEVICE=sd
make recoveryimage BUILD_TARGET_DEVICE=sd

To create SD Card to boot

$cd ~/myandroid/
$sudo chmod +x ./device/fsl/common/tools/fsl-sdcard-partition.sh
$sudo ./device/fsl/common/tools/fsl-sdcard-partition.sh -f /dev/sdX
can is imx6q I.MX6 quad processor

Keep all the required files in the current directory.

Issues and Fixes

Will be coming up with list of issues encountered and their fixes.


  1. No comments yet.
  1. No trackbacks yet.