[vc_row][vc_column][vc_column_text]pcDuino3 supports both Lbuntu and Android. In this post, we will explain the complete process to build Android 4.2 from source files for pcDuino3.
[/vc_column_text][vc_tour][vc_tab title=”Building Envrioment ” tab_id=”1404082753-1-0″][vc_column_text]The building environment is as following:
1. Ubuntu 12.04 64 bits.
2. The memory should be more than 8HB, and the hard disk should be more than 80GB.
[/vc_column_text][/vc_tab][vc_tab title=”Download Android Source Files” tab_id=”1404082753-2-70″][vc_column_text]The Android source files are huge, and there is no way to host them on github. We host them at aws.
The three files are: Android42.aa, Android42.ab, and Android42.ac.
After we download it, we need to merge them by using:
#cat android42.a* > android4.2.tar.bz2
Unzip the source files:
#tar xvf android4.2.tar.bz2 #cd android4.2
The following is the screen shot showing the directory underneath:
[/vc_column_text][/vc_tab][vc_tab title=”Download and Install Dependency Softwares” tab_id=”1404083276010-2-1″][vc_column_text]We install the dependency software by the following:
#sudo apt-get install zlib1g-dev #sudo apt-get install flex #sudo apt-get install bison #sudo apt-get install gperf #sudo apt-get install libsdl-dev #sudo apt-get install libesd0-dev #sudo apt-get install libncurses5-dev #sudo apt-get install libx11-dev
We also need to install Java. Please note that we cannot use OpenJDK. Please download jdk-6u45-linux-x64 from http://www.oracle.com/technetwork/java/javase/downloads/index.html.
#chmod u+x jdk-6u45-linux-x64.bin # ./jdk-6u45-linux-x64.bin
Next we move the unzipped jdk-6u45 directory to /usr/lib. Using sudo, enter into the current jdk directory, and move jdk-6u45 to /usr/lib/jvm:
# sudo mkdir -p /usr/lib/jvm/ # sudo mv jdk-6u45 /usr/lib/jvm/
Next step is to configure the environmental variables. Enter into the home directory, and modify the file .profile. This file is used to configure the environment of current user. If we want to make sure the setting is valid for all users, we need to modify /etc/profile. The commands are as following:
#sudo vim ~/.profile
We are going to append the following lines:
export JAVA_HOME=/usr/lib/jvm/jdk-6u45 export JRE_HOME=/usr/lib/jvm/jdk-6u45/jre export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin:$PATH
Save and quite. If we run ‘#java-version’ it will still complain that java is not installed. We will need to run ‘#source’ to make the .profile into effect:
# source ~/.profile
[/vc_column_text][/vc_tab][vc_tab title=”Build Kernel” tab_id=”1404083976628-3-0″][vc_column_text]We will first build the kernel.
#cd lichee #./build.sh -p sun7i_android
It will use the cross-compile tool to build. After finish, it will prompt:
[/vc_column_text][/vc_tab][vc_tab title=”Prepare Envoriment to Build Android Part, and Configure Hardware” tab_id=”1404084172972-4-2″][vc_column_text]Use the following commands to setup:
#cd ../android #souce build/envsetup.sh
#lunch
Select hardware, here we select 15:
[/vc_column_text][/vc_tab][vc_tab title=”Build Android” tab_id=”1404084317316-5-3″][vc_column_text]Finally, we are ready to build android. The commands are:
#extract-bsp #make -j 16
The parameter after the make command is the number of cores of CPU of the host PC. We are using a PC with 16 cores, so we use 16.
In our case, the build process takes 3 hours!
[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.