8,367
edits
Changes
no edit summary
<br>
=== '''Download Linux Source Code''' ===
<br>
You could download the source code from the official website: <br>
http://www.orangepi.online/downloadresources/
<div>[[文件:Orange-pi-pc2-img48.png|800px|]]</div>
<br>
Subsection and compress the file, then unzip it after finish downloaded:
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img49.png|600px|]]</div>
<br>
buildroot: Project compilation script<br>
brandy: gcc-linaro, boot and uboot source code and open source cross compiler tool<br>
linux-3.10: Kernel source code <br>
tools: Tools of project compilation <br>
build.sh: compilation script<br>
<br>
=== '''Compile Project Source Code''' ===
<br>
You need to compile the entire project while it is your first time to use the source code. You can use the following commands in the /lichee directory to complete the project:<br>
* Enter into content of lichee, command<br>
$ ll -a<br>
Check if there is an executable permission on build.sh, if not, modify the permissions<br>
$ chmod 755 build.sh<br>
* If there is .buildconfig after commanded ll –a, delete it<br>
$ rm –rf .buildconfig
<div>[[文件:Orange-pi-pc2-img50.png|800px|]]</div>
<br>
* Use the following command to compile the entire project<br>
$ ./build.sh config
<div>[[文件:Orange-pi-pc2-img51.png|800px|]]</div>
<br>
At this point the system will prompt the choice of the chip, as shown below, for OrangePi, select sun50iw2p1<br>
At this point, the system will be prompted to select the platform, as shown below, for OrangePi, select Android<br>
At this point, the system will be prompted the choice of the board, as shown below, for the OrangePi, select dolphin-p1
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img52.png|400px|]]</div>
<br>
Appear this interface indicates waiting for the compiler.
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img53.png|400px|]]</div>
<br>
Wait fifteen minutes or so, compile complete.
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img54.png|400px|]]</div>
<br>
=== '''Update the Kernel Image File and Replace Library''' ===
<br>
* After compilation is finished, the following files will be generated in the directory:
libs: lichee/out/sun50iw2p1/android/common/lib/modules/3.10.65 Download image from official website:<br>
http://www.orangepi.online/downloadresources/
<div>[[文件:Orange-pi-pc2-img55.png|800px|]]</div>
<br>
* Write the image:<br>
$ sudo dd bs=4M if=*.img of=/dev/sdb<br>
<br>
<div>[[文件:Orange-pi-pc2-img56.png|800px|]]</div>
<br>
Pull out the card reader, and then insert it again.<br>
At this time, the SD card is inserted into PC, view the SD card mount point (if you don't know how to get a mount point for the SD card, please refer to the diagram below).
<div>[[文件:Orange-pi-pc2-img57.png|800px|]]</div>
<br>
The first boot partition
<div>[[文件:Orange-pi-pc2-img58.png|800px|]]</div>
<br>
The second rootfs partition
<div>[[文件:Orange-pi-pc2-img59.png|800px|]]</div>
<br>
Copy the kernel image file generated by the compiler to the first partition (boot partition)<br>
Copy the lib library which generated after compilation to the second partition (rootfs partition)<br>
'''We would suggest using compilation system on github of official website.'''
<div>[[文件:Orange-pi-pc2-img60.png|800px|]]</div>
<br>
build.sh Execute script into the graphical interface of compilation <br>
extenal Inside are patch and some configuration kernel file <br>
output File generated<br>
script Script compiled <br>
toolchain Cross compiler location <br>
uboot uboot source code<br>
<br>
Execute./build.sh enter into graphical interface and select PC2
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img61.png|600px|]]</div>
<br>
Enter password of root
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img62.png|600px|]]</div>
<br>
Update Kernel directory and module
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img63.png|600px|]]</div>
<br>
Select corresponding file directory and update uImage and modules
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img64.png|600px|]]</div>
<br>
== '''Android Kernel Source Code Compilation''' ==
<br>
Hardware: Orange Pi development board*1, Card reader*1, TF card*1, power supply*1
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img65.png|800px|]]</div>
<br>
Software<br>
Linux host computer, which hard disk space at least 50G (to meet a fully compiled need)<br>
Linux host computer needs: <br>
Version 2.7.3 of Python;<br>
Version 3.81-3.82 of GNU Make; JDK 6;<br>
Version 1.7 or higher version of Git.<br>
<br>
=== '''Install JDK''' ===
<br>
The following will be illustrating jdk1.6 installation, it would be same for jdk1.7 installation.
* Download and install JDK, you will obtain jdk-6u31-linux-x64.bin
* Modify the permission of jdk-6u31-linux-x64.bin, which has no prior permission
* $./jdk-6u31-linux-x64.bin <br>
It will generate a folder:
<div>[[文件:Orange-pi-pc2-img66.png|800px|]]</div>
<br>
* Input at terminal<br>
Note that JAVA_HOME is the name of the current directory, you need to fill in according to your own storage directory.
<div>[[文件:Orange-pi-pc2-img67.png|800px|]]</div>
<br>
$ export JAVA_HOME=*/jdk1.6.0_31<br>
$ export PATH=$PATH:/$JAVA_HOME/bin<br>
$ export CLASSPATH=.:$JAVA_HOME/lib<br>
$ export JRE_HOME=$JAVA_HOME/jre
<div>[[文件:Orange-pi-pc2-img68.png|800px|]]</div>
<br>
* Command line input Jav and press tab to see whether it can auto completion (Java), which indicates it can successfully installed<br>
<br>
=== Install Platform Supported Software ===
<br>
$ sudo apt-get install git gnupg flex bison gperf build-essential \ zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \ libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386<br>
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/libGL.so<br>
<br>
=== '''Download Android Source Package''' ===
<br>
Download website: http://www.orangepi.online/downloadresources/ <br>
Then you will obtain the following directories:
<div>[[文件:Orange-pi-pc2-img69.png|300px|]]</div>
<br>
=== '''Install Compiler Tool Chain''' ===
<br>
The compiler tool chain has been integrated in Android SDK. Tool chain is on: lichee/brandy/gcc-linaro/ of Android SDK(already exist)<br>
<br>
<div>[[文件:Orange-pi-pc2-img70.png|800px|]]</div>
<br>
=== '''Compile Lichee source Code''' ===
<br>
There are Android and Lichee after unzipped the package, enter the directory of Lichee:<br>
$ cd lichee<br>
$ ./build.sh lunch <br>
Select sun50iw2p1<br>
Print information of successful compilation
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img71.png|400px|]]</div>
<br>
=== '''Compile Command of Android Code''' ===
<br>
Input the command:<br>
$ cd android<br>
$ source ./build/envsetup.sh
<div>[[文件:Orange-pi-pc2-img72.png|800px|]]</div>
<br>
$ lunch dolphin_fvd_p1-eng # Select the scheme number
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img73.png|600px|]]</div>
<br>
$ extract-bsp # Copy the kernel and the drive module
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img74.png|600px|]]</div>
<br>
$ make The rear values of # is for the simultaneous compilation process, dependent on the host configuration
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img75.png|600px|]]</div>
<br>
$ pack #Packaged into firmware
<div>[[文件:Orange-pi-pc2-img76.png|600px|]]</div>
<br>
$ cd */lichee/tools/pack/
<div>[[文件:Orange-pi-pc2-img77.png|600px|]]</div>
<br>
'''Write image:'''<br>
Copy the generated image file i to the SD card, switch to the windows operating system. Programming software download website:<br>
http://www.orangepi.online/downloadresources/
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img78.png|800px|]]</div>
<br>
Download the compressed package, unzip and get the folder
<div style="padding-left:200px;">[[文件:Orange-pi-pc2-img79.png|200px|]]</div>
<br>
Enter the folder, open the program to run as Administrator
<div>[[文件:Orange-pi-pc2-img80.png|600px|]]</div>
<br>
Write Android image on Windows with this tool:
<div>[[文件:Orange-pi-pc2-img81.png|800px|]]</div>
<br>
Insert the TF card with written image to OrangePi, turn on the computer then you could enter to Android system.<br>
<br>