Some of Chinese customer couldn’t normally download android source code from google site, here give a way to download android source from Mirror site of Tsinghua University. Customers in other areas can refer to the configurations of ubuntu 18.04 in the document.
Updating software packages for ubuntu18.04 LTS
1、Using software updater to update software packages
Press Install Now button to update software.
Restart ubuntu18.04
2、Installing necessary software packages
#sudo apt-get install flex
# sudo apt-get install bison
# sudo apt-get install gperf
# sudo apt-get install build-essential
# sudo apt-get install zlib1g-dev
# sudo apt-get install lib32ncurses5-dev
# sudo apt-get install x11proto-core-dev
# sudo apt-get install libx11-dev
# sudo apt-get install lib32z1-dev
# sudo apt-get install libgl1-mesa-dev
# sudo apt-get install tofrodos
# sudo apt-get install python-markdown
# sudo apt-get install libxml2-utils
# sudo apt-get install xsltproc
# sudo apt-get install uuid-dev:i386 liblzo2-dev:i386
# sudo apt-get install gcc-multilib g++-multilib
# sudo apt-get install subversion
# sudo apt-get install openssh-server openssh-client
# 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
# sudo apt-get install device-tree-compiler
# sudo apt-get install aptitude
# sudo aptitude install libcurl4-openssl-dev nss-updatedb
3、Downloading and unpacking Android release package
--O8.1.0_1.3.0_ANDROID_SOURCE_8MQ_GA
File name is imx-o8.1.0_1.3.0_8m.tar.gz
# cd ~
# tar xzvf imx-o8.1.0_1.3.0_8m.tar.gz
Downloading android8.1.0-1.3.0 source code
# cd ~
# mkdir bin
# cd bin
# curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
# chmod a+x ~/bin/repo
# export PATH=${PATH}:~/bin
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/'
3、Setting email address
# git config --global user.email "xxxx@nxp.com"
# git config --global user.name "xxxx"
[ Email & Name should be yours]
4、Modifying android setup script and Running it
Open ~/ imx-o8.1.0_1.3.0_8m /imx_android_setup.sh and add a line like below:
...
if [ "$rc" != 0 ]; then
echo "---------------------------------------------------"
echo "-----Repo Init failure"
echo "---------------------------------------------------"
return 1
fi
find -name 'aosp-O8.1.0-1.3.0.xml'| xargs perl -pi -e 's|https://android.googlesource.com/|https://aosp.tuna.tsinghua.edu.cn/|g'
fi
# Don't Delete .repo directory and hidden files
#rm -rf $android_builddir/.??*
...
Then save it and exit.
# cd ~/
# source ~/ imx-o8.1.0_1.3.0_8m/imx_android_setup.sh
Then android_build directory is created at ~/
# export MY_ANDROID=~/android_build
48 hours later:
Compiling android8.1.0-1.3.0 BSP
# cd ~/android_build
# gedit ./prebuilts/sdk/tools/jack-admin
And find “JACK_SERVER_COMMAND” ,change it to be:
JACK_SERVER_COMMAND="java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=$TMPDIR $JACK_SERVER_VM_ARGUMENTS -Xmx4096m -cp $LAUNCHER_JAR $LAUNCHER_NAME"
Save and exit. And run:
# ./prebuilts/sdk/tools/jack-admin stop-server
# ./prebuilts/sdk/tools/jack-admin start-server
# export ARCH=arm64
# export CROSS_COMPILE=~/android_build/prebuilts/gcc/linux-x86/aarch64/aarch64-linuxandroid-4.9/bin/aarch64-linux-android-
# export LC_ALL=C
# source build/envsetup.sh
# lunch evk_8mq-userdebug
Begin to build android BSP for i.MX8MQ
# make –j4
NXP TIC weidong sun
2018-08-15