How to Make an Android SD Card Flash Image for MIPS CI20

From eLinux.org
Jump to: navigation, search

Tool Chain

Before attempting the steps below please follow the directions for downloading and installing the appropriate tool chain here.

Build steps

Create a directory to hold the source tree

       mkdir <CI20 Android Directory>

Enter new directory

       cd <CI20 Android Directory>

Create repo and fetch contents

       # Nougat
       repo init -u git://github.com/MIPS/manifests.git -b dev-mips-nougat-mr1 -m ci20-ng-7.1.1_r28.m1.xml
       repo sync
       
       # Marshmallow
       repo init -u git://github.com/MIPS/manifests.git -b dev-mips-marshmallow -m ci20-mm-6.0.0_r1.m1.xml
       repo sync
       
       # Lollipop
       repo init -u git://github.com/MIPS/manifests.git -b dev-mips-lollipop-mr1 -m ci20-lp-5.1.1_r6.m1.xml
       repo sync
       
       # KitKat
       repo init -u git://github.com/MIPS/manifests.git -b dev-mips-kitkat -m ci20-kk-4.4.2_r3.m1.xml
       repo sync

Set up environment variables needed to build image (Note. this takes 50Gb of space and quite a bit of time)

       export TOP=`pwd`
       source build/envsetup.sh
       lunch aosp_ci20-userdebug
       export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
       # 'export JAVA_HOME=/usr/lib/jvm/java-6-oracle' will be needed for some of the releases older than Nougat

Run "make"

       # UBIFS
       make -j <N> # You may need to adjust the number depending on your build system
       # EXT4
       make WITH_EXT4=true -j <N> # You may need to adjust the number depending on your build system

Insert an SD card to be written into the host system then run the following commands

       cd device/imgtec/ci20/sdcardinstaller/
       # UBIFS
       ./mksdcard /dev/sdX # The name of the SD card device may vary across systems
       # EXT4
       ./mksdcard-ext4 /dev/sdX
       

If you are using UBIFS the SD card can now be used to flash the CI20 NAND.

If you are using EXT4, the SD image is used as the boot image:

       * Place the JP3 jumper to position 2-3,
       * Plug in the SD card and power on the board,

Github links

These repositories host the sources for the the kernel, u-boot and android.

https://github.com/MIPS/CI20_linux/tree/dev-mips-kitkat-v3.0.8
https://github.com/MIPS/CI20_u-boot/tree/dev-mips-kitkat-v2013.10
https://github.com/MIPS/CI20_android/tree/dev-mips-kitkat