|
Hey Guys. I started to read WiKI section but don have so many experience. I really liked artickle about building your own image from scratch of Android.
I just wonder--has anyone tried to do it? Is it difficult to do?
Here is artickle:
http://www.orangepi.org/Docs/BuildingyourownAndroidfirmware.html
Building your own Android firmware Jump to: navigation, search
Contents
Initializing a Build EnvironmentThe environment setting up has been tested under Ubuntu 12.04 Desktop and Ubuntu 14.04 Sever.
Install JDK on PCsudo apt-get install software-properties-commonsudo add-apt-repository ppa:webupd8team/javasudo apt-get updatesudo apt-get install oracle-java6-installer
Install Essential PackagesInstall some packages:
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
Link the libGL library:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Attention1. Sometimes, when we use Ubuntu 12.04 Desktop, we may encounter that the desktop GUI is missing after we set up the Android environment. We need fix this:
sudo apt-get install ubuntu-desktop xorg
2. Under Ubuntu 14.04 Sever, we may also need to install:
sudo apt-get install libswitch-perl u-boot-tools
Download Android SDKAt current, we can only get Android 4.2 SDK for Orange Pi/mini Pi .Download the Android 4.2 SDK for Orange Pi/mini Pi from the Cloud:
Github: Github Page
Extract the files in the download package:
xz -d OP_Android.tar.xztar -xvf OP_Android.tar
We can see two directory in OP_Andoird: android and lichee.The content in the android directory is the source code for android system.
The content in the lichee directory contains the kernel, u-boot, toolchain and some other tools maybe needed.
Build lichee packagesFirst we need compile the kernel and uboot. They are in lichee directory. Enter the lichee directory:
cd OP_Android/lichee/
And then compile:
./build.sh -p sun7i_android
After the first compile, we need upgrade the kernel configuration to open some drivers such as GMAC:
cd linux-3.4cp /arch/arm/configs/op-config .config
After this, you can also tweak the kernel as you like:
make ARCH=arm menuconfig
and then save it.
Compile the kernel again to make the added drivers work:
cd .../build.sh -p sun7i_android
After all is ready, you will find a directory named out appear under lichee directory. In it, there are files needed by Android system, when we compile the android source code, these files in out directory will be copied into Android.
Build AndroidEnter the android directory:
cd ../android
Configure the compile environment:
source build/envsetup.sh
Select the right project for Orange Pi/mini Pi. We have a default project called sugar-orangepi:
lunch
it will let you enter a number for the project. The sugar_orangepi-eng is 16 by default.
And then:
extract-bspmake
You can also use make -jN, N represents the core of your host PC. This will take some hours depends on your PC performance.(My ThinkPad T440 takes about 80 minutes, and my Dell sever takes about 50 minutes).After build, you can pack the system to form an Android image file:
pack
And then, you can find the compiled image file under /lichee/tools/pack called sun7i_android_sugar-orangepi.img .
When building Android, it also produce a new folder called out under android directory.
Burn the Android imageAfter all compiling process, you can burn the new image created by yourself into SD card with PhoenixCard tool. More information please see: TF_card_installation#Installing_the_Android_OS_image.
Useful files for customize your Android systemUnder android/devices/softwinner , there are three folders specially related to our Orange Pi/mini Pi android project:
commonwing-commonsugar-orangepiWe eventually use the files in the sugar-orangepi. sugar-orangepi depends on wing-common, wing-common depends on common.
The specific files or folders may be useful:
sugar-orangepi/sugar_orangepi.mksugar-orangepi/BoardConfig.mksugar-orangepi/init.sun7i.rcsugar-orangepi/camera.cfgsugar-orangepi/vold.fstabwing-common/ProductCommon.mkwing-common/apkwing-common/preinstallapk
|
|