View: 26262|Reply: 23

Has anyone tried to compile his own build of Android according to instructioons?

[Copy link]

6

threads

116

posts

401

credits

Intermediate member

Rank: 3Rank: 3

credits
401
Published in 2015-5-11 04:23:09 | Show all floors |Read mode
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

17

threads

212

posts

1416

credits

Gold member

Rank: 6Rank: 6

credits
1416
Published in 2015-5-11 05:42:56 | Show all floors
Hi,
You can also use this tutorial with 12.04 or 14.04. It works with 14.10 but it need to downgrad make to 3.8
I have tried with 15.04 but no way...
I think it's more easier because there are some scripts to install packages ans compile Android.

The repository of Orange is down, so the repository to use is this one: https://github.com/ChrisP-Android/BananaPi-Android-4.2.2-Liab

6

threads

116

posts

401

credits

Intermediate member

Rank: 3Rank: 3

credits
401
 Author| Published in 2015-5-11 15:25:08 | Show all floors
gaara replied at 2015-5-11 05:42
Hi,
You can also use this tutorial with 12.04 or 14.04. It works with 14.10 but it need to downgrad  ...

THank you for the Tip. And when you did yourself--did you finish it and have image working? Did you test image afterwards if really works?

I just really interested to have it done yourself.

17

threads

212

posts

1416

credits

Gold member

Rank: 6Rank: 6

credits
1416
Published in 2015-5-11 16:11:28 | Show all floors
Edited by gaara at 2015-5-11 11:40

Yes, I have done it. And you can also before the build:

- change the fex file => /ANDROID/lichee/tools/pack/chips/sun7i/configs/android/sugar-lemaker/sys_config.fex (useful to select the wifi, but no need to convert it in bin file)

- change the wallpaper before build => /ANDROID/android/frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.jpg

- add the wifi driver => /ANDROID/android/out/target/product/sugar-lemaker/root/init.sun7i.rc
    insmod /system/vendor/modules/rtl8150.ko
    insmod /system/vendor/modules/8188eu.ko
   And add the source driver here: /ANDROID/lichee/linux-3.4/drivers/net/wireless/rtl8188eu (I don't remember if it is alread here, but you must select it in /ANDROID/scripts/config.sh)

- add some apps => /ANDROID/android/device/softwinner/wing-common/preinstallapk  Some utils: ESfileExplorer, TerminalEmulator etc
- add some external programs if you have the source => /ANDROID/android/external (you must also add an Android.mk file, like this one for i2ctools for example)


Another tricks: To see if there's errors, don't use ./build.sh. Just use it if you do a little modification in the build.
1) ./build_kernel.sh
If ok,
2) ./build_android.sh
if ok,
3) ./build_pack.sh





0

threads

4

posts

180

credits

Registered member

Rank: 2

credits
180
Published in 2015-5-12 17:35:01 | Show all floors
Edited by e7763 at 2015-5-12 17:57


gaara,
An image built by source  https://github.com/ChrisP-Android/BananaPi-Android-4.2.2-Liab does not work usb. In addition there are no files:
sugar-orangepi/sugar_orangepi.mksugar-orangepi/BoardConfig.mk
sugar-orangepi/init.sun7i.rc
sugar-orangepi/camera.cfg
sugar-orangepi/vold.fstab
Image files from here http://www.orangepi.org/downloaded/Android_For_OrangePi.html collected on SDK V1.2, and the old kernel 3.3.0+, kernel configuration in the image closed and making it difficult to add the necessary drivers.
Somebody built a full image Android on sdk v2.0 for Orange Pi with kernel 3.4.39. ?



17

threads

212

posts

1416

credits

Gold member

Rank: 6Rank: 6

credits
1416
Published in 2015-5-12 19:42:46 | Show all floors
Edited by gaara at 2015-5-12 13:45

@e7763:
This not really a source for Orange, but for Banana. But the hardware is very similar of the version 1 of Orange (normal & mini), based on A20 proc. Just the wifi is not the same.
Banana is a product of LeMaker, so you can find all this file in this folder:
~/ANDROID/android/device/softwinner/sugar-lemaker

The kernel used is 3.4, and I don't know for the SDK

6

threads

116

posts

401

credits

Intermediate member

Rank: 3Rank: 3

credits
401
 Author| Published in 2015-5-12 21:09:39 | Show all floors
gaara replied at 2015-5-12 19:42
@e7763:
This not really a source for Orange, but for Banana. But the hardware is very similar of the ...

Gaara can you upload your compiled image in order people who are noobs could try it?

I would be very appreciative.

17

threads

212

posts

1416

credits

Gold member

Rank: 6Rank: 6

credits
1416
Published in 2015-5-12 22:17:06 | Show all floors
Edited by gaara at 2015-5-12 16:20

Yes, it's possible. Just for Orange Pi 1 and mini 1 (soc A20)

My image contains some exotics drivers, like usb touchscreen (calibrate for 17' screen), logitech mouse hid, and apps like termial and ESfileExplorer.
The internal wifi works.
The first boot take about 5 min with my little SD card, but after the first page you must wait again 5 min for the apps installations.
Others boots are more fast of course
You can download here: https://www.dropbox.com/s/8kg05o ... _pi.img.tar.gz?dl=0

6

threads

116

posts

401

credits

Intermediate member

Rank: 3Rank: 3

credits
401
 Author| Published in 2015-5-12 22:43:48 | Show all floors
Edited by OrangePiLinux at 2015-5-12 23:27

Thanks. It is really awesome to try something new.
Is VGA  working in Android or only HDMI can output picture in Orange Pi ? It Outputs picture through VGA in 1024x768. Started immediately which is cool. I have Kingston class 10--maybe thats why--but toook like maybe 20 second and appeared then desktop.
So far so Good--I like it. This is DEsktop which I like in Android.

  Interesting--it has in output VGA up to 1920x1080p. I not sure if real--but I am glad.
Sound works over 3,5mm jack--both speakers. awessome.

GooglePlay works. Android versions is 4.2

17

threads

212

posts

1416

credits

Gold member

Rank: 6Rank: 6

credits
1416
Published in 2015-5-12 23:37:09 | Show all floors
Does wifi works too ?
For VGA, I know you can swich it, but for the first start I don't know. I use HDMI
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list