Getting Android5.1.1 Source Code (For China only)

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Android5.1.1 Source Code (For China only)

No ratings

Getting Android5.1.1 Source Code (For China only)

Some Chinese customers using i.MX series SoC maybe encounter some issues when they download android , u-boot & kernel source code by 'git' command, the following steps will show customer how to get them:

1. Getting repo

--No.1 methord

# cd ~

# mkdir myandroid

# mkdir bin

# cd bin

# git clone git://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/

<if git failed, use : git clone https://aosp.tuna.tsinghua.edu.cn/android/git-repo.git/>

# cd git-repo

# cp ./repo ../

--No.2 methord

# cd ~

# mkdir bin

# curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo

# chmod a+x ~/bin/repo

[Note]Customers can select one of above to get "repo"

2. 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 = 'git://aosp.tuna.tsinghua.edu.cn/android/git-repo'

       like following:

## repo default configuration

##

REPO_URL = 'git://aosp.tuna.tsinghua.edu.cn/android/git-repo'

REPO_REV = 'stable'

3Setting email address

# cd ~/myandroid

# git config --global user.email "weidong.sun@nxp.com"

# git config --global user.name "weidong.sun"

[ Email & Name should be yours]

4Getting manifest

# ~/bin/repo init -u https://aosp.tuna.tsinghua.edu.cn/android/platform/manifest -b android-5.1.1_r1

# cd ~/myandroid/.repo

# gedit manifest.xml

       Then change the value of fetch to " git://aosp.tuna.tsinghua.edu.cn/android/ ", like following:

<manifest>

  <remote name="aosp"

           fetch="git://aosp.tuna.tsinghua.edu.cn/android/" />

  <default revision="refs/tags/android-5.1.1_r1"

......

[Note] android-5.1.1_r1 is version of branch,customer can change it to another.

5# ~/bin/repo sync

         [Note] During runing repo sync, maybe errors will occur like the following:

......

* [new tag]         studio-1.4 -> studio-1.4

error: Exited sync due to fetch errors

         Then 'repo sync' exits. But don't worry about it, continue to run the command please !

" ~/bin/repo sync", downloading source code will be continous.

6Getting Cross Compiler

# cd ~/myandroid/prebuilts/gcc/linux-x86/arm

# git clone https://aosp.tuna.tsinghua.edu.cn/android/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6

# cd arm-eabi-4.6

# git checkout android-4.4.3_r1

7Getting linux kernel source code

       Probably, customer can't normally get linux kernel by using "git clone" command, she can download it directly from the following weblink:

       http://git.freescale.com/git/cgit.cgi/imx/linux-2.6-imx.git/

无标题11.png

       At first, create a temperary directory, then download kernel into the directory. see following steps:

# cd ~ /Downloads

# mkdir linux-kernel

  Atfer downloading l5.1.1_2.1.0-ga.tar.gz, use 'tar zxvf l5.1.1_2.1.0-ga.tar.gz' command to decompress it.

       Then you can find a subdirectory name " l5.1.1_2.1.0-ga" is created, linux source code is in the directory, we should copy all files in the directory to ~/myandroid/kernel_imx/

# cd ~/myandroid

# mkdir kernel_imx

# cd kernel_imx

# cp -a ~ /Downloads/linux-kernel/l5.1.1_2.1.0-ga ./

8Getting uboot source code

              Probably, customer can't normally get linux kernel by using "git clone" command, she can download it directly from the following weblink:

      http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/

无标题11.png

       We can use similar way to that of linux kernel to get u-boot source code:

# cd ~ /Downloads

# mkdir u-boot

       Download l5.1.1_2.1.0-ga.tar.gz file, and save it in ~ /Downloads/ u-boot, then decompress it, then u-boot source code will be in ~ /Downloads/ u-boot / l5.1.1_2.1.0-ga/, we should copy all file in the path to ~/myandroid/bootable/bootloader/uboot-imx/

# cd ~/myandroid/bootable/bootloader

# mkdir uboot-imx

# cd uboot-imx

# cp -a ~ /Downloads/u-boot/l5.1.1_2.1.0-ga/* ./

9Patch android BSP source code

       android_L5.1.1_2.1.0_consolidated-ga_core_source.gz is the name of patch. Run following command to patch android.

# copy android_L5.1.1_2.1.0_consolidated-ga_core_source.gz /opt/

# tar zxvf android_L5.1.1_2.1.0_consolidated-ga_core_source.gz

# cd /opt/ android_L5.1.1_2.1.0_consolidated-ga_core_source/code/

# tar zxvf L5.1.1_2.1.0_consolidated-ga.tar.gz

# cd ~/myandroid

# source /opt/ android_L5.1.1_2.1.0_consolidated-ga_core_source/code/ L5.1.1_2.1.0_consolidated-ga/ and_patch.sh

# help

# c_patch /opt/ android_L5.1.1_2.1.0_consolidated-ga_core_source/code/ L5.1.1_2.1.0_consolidated-ga/ imx_L5.1.1_2.1.0-ga

       If everything is OK, the following logs will display on console:

              **************************************************************

       Success: Now you can build the Android code for FSL i.MX platform

              **************************************************************

10Patch Freescale extended feathures code

       Please refer to chapter 3.3 of Android_User's_Guide.pdf to patch another 2 files:

       (1) android_L5.1.1_2.1.0_consolidated-ga_omxplayer_source.gz

       (2) android_L5.1.1_2.1.0_consolidated-ga_wfdsink_source.gz

[Note]

      As for other steps, such as compiling etc, please refer to Android_User's_Guide.pdf that released by NXP.

TICS team

Weidong Sun

04/01/2016

Comments

mark

Version history
Revision #:
1 of 1
Last update:
‎01-03-2016 09:51 PM
Updated by: