:::: MENU ::::

FriendlyARM where to start ?

A lot of you out there started to questioning yourself this question as soon as you un boxed your micro/mini/tiny FriendlyARM packet. I spent a lot of my free time to get all the info you will get reading this article to the end.
My friend come with installed Linux and QT environment, but as many i was aimed to put the Android on it. So i have started to look for a way to use SD card to boot Android from it and leave the original OS without touching it. At this point my main issue was to translate Chinese manuals in me more suitable English.

I guess you all have a small SD cards at home for this experiment i have used a 2GB card. =) i have to be honest …. my first attempt was in few words “big fiasco” still now i don’t know what went wrong but my card is un writable – read only.

Build environment:

I have tried all my experiments on a VM with Ubuntu 10.10 OS. Cos this is a easy to setup and easy to use Linux distribution for a newbies all you that doesn’t have a lot of experience with Linux i suggest you to use it.

Cross compile tools and build environment

Whole process was tested as mentioned before on Ubuntu 10.10 32bit. No other additional deb files were installed before. So how to prepare the Ubuntu environment to allow us compile the Android 2.3 source code. At this point the first thing to do is to ensure that gcc compiler is installed and paths are correct.

Install the gcc build environment

  • In ubuntu terminal copy from the DVD (x:/linux/) this files: “arm-linux-gcc-4.5.1.tgz”, “mktools.tar.gz” , “logomaker.tgz” to /tmp folder.

# cp /media/cdrom/linux/arm-linux-gcc-4.5.1.tgz /tmp
# cp /media/cdrom/linux/mktools.tar.tgz /tmp
# cp /media/cdrom/linux/logomaker.tgz /tmp


  • Uncompressed it with the follow command:

# cd /tmp
# sudo tar xvzf arm-linux-gcc-4.5.1-v6-vfp-20101103.tgz –C /
# sudo tar xvzf mktools.tar.gz –C /
# sudo tar xvzf logomaker.tgz –C /


  • Add Path in your environment file ~/.bashrc file to add a new path with editor (gedit )

PATH=$PATH:/opt/FriendlyARM/toolschain/4.5.1/bin


  • To apply this change, login again or restart the .bashrc

# source .bashrc


  • Check the tool-chain path to see if it is set up correctly or not, whether it show gcc version 4.5.1

# arm-linux-gcc –v


Create a working folder

  • Create a tiny6410 folder (only the sky is your limit, you can create the folder where ever you would like to, but i suggest is it in your – user folder.)

# mkdir ~/tiny6410
# cd ~/tiny6410


  • Copy the android folder from CD to PC Tiny6410 folder

# cp -fr /media/cdrom/android/
# cd android


  • linux-2.6.28.6-android, uncompress the linux kernel for android file,

#tar xvzf android-kernel-2.6.28-20100812.tar.gz


  • Android-2.1, Android system source code

# tar xvzf android-2.1-fs-20100812.tar.gz


  • rootfs_android, Root file system folder

# tar xvzf rootfs_android-20100812.tar.gz


Till now nothing extraordinary, just manipulating with files, extracting them and no »cira cara abra kadabra«. This process will take about 20 minutes but it should be easy to finish.

Configure and compile linux kernel

A lot of FriendlyARM are equiped with NEC 4.3” LCD display with resistive toucharea. This is why we will use _43 files as a default system configuration file. To see parameters used to configure kernel you can use

#less config_android_n43


  • Now the configuration and compile can start. Go to

# cd linux-2.6.28.6-android


  • Next step is to create .config file using next command

# cp config_android_n43 .config


  • Create kernel

# make zImage

  • if the kernel build is successful, there must be in “arch/arm/boot/ file »zImage« approximately 2Mb – Android 2.1
  • if the kernel build is successful, there must be in “arch/arm/boot/ file »zImage« approximately 3Mb – Android 2.3

Configure and compile Android system

  • Create kernel

# cd android-2.3
# cp config_android_n43 .config
# ./build-android


 

If you are using UBUNTU 10.10 many error may occur while compiling. To solve them use this commands below.

Error: / Usr / include / gnu / stubs.h: 7:27: error: gnu/stubs-32.h: No such file or directory

make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp.o] Error 1

sudo apt-get install libc6-dev-i386


Error: make: *** [out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp] error 1

sudo apt-get install g + +-multilib


Error: external / clearsilver / cgi / cgi.c: 22: fatal error: zlib.h: No such file or directory compilation terminated.

make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libneo_cgi_intermediates/cgi.o] Error 1

sudo apt-get install zlib1g-dev


Error: / Usr / bin / ld: cannot find-lz collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] Error 1

sudo apt-get install lib32z1-dev


Error: bison-d-o out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks / base / tools / aidl / aidl_language_y.y / Bin / bash: bison: command not found

make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 127

sudo apt-get install bison


Error: Lex: aidl <= frameworks / base / tools / aidl / aidl_language_l.l / Bin / bash: flex: command not found

make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 127

sudo apt-get install flex


Error: / Usr / bin / ld: cannot find-lncurses collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1

sudo apt-get install lib32ncurses5-dev
sudo apt-get install libncurses5-dev


Error: prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h: 55: fatal error: X11/Xlib.h: No such file or directory compilation terminated.

make: *** [out/host/linux-x86/obj/EXECUTABLES/emulator_intermediates / Android / Main-common.o] Error 1

sudo apt-get install libx11-dev


Error: sh: gperf: not found

calling gperf failed: 32512 at. / makeprop.pl line 96.

make: *** [out / target / product / generic / obj / STATIC_LIBRARIES / libwebcore_intermediates / WebCore / css / CSSPropertyNames.h] Error 25

make: *** Deleting file `out / target / product / generic / obj / STATIC_LIBRARIES / libwebcore_intermediates / WebCore / css / CSSPropertyNames.h ‘

sudo apt-get install gperf

  • At the end crate a root file system.

# ./genrootfs.sh

If you can build Android system successfully, you will have »rootfs_dir« folder.

Make yaffs filesystem

# cd ~/mini6410/android/Android-2.1
# mkyaffs2image-128M rootfs_dir rootfs_android.img

If you can do it successfully, you will have “rootfs_android.img” in the same folder.

Make UBIFS filesystem

# cd ~/mini6410/android/Android-2.1
# mkubimage rootfs_dir rootfs_android.ubi

If you can do it successfully, you will have “rootfs_android.ubi” in the same folder.

Make Ext3 filesystem

# cd ~/mini6410/android/Android-2.1
# mkext3image rootfs_dir rootfs_android.ext3

If you can do it successfully, you will have “rootfs_android.ext3” in the same folder.

— TO BE CONTINUE —

List of useful links:

  • http://my.opera.com/vinodamunikoti/blog/manual-for-compiling-android-for-mini2440
  • http://code.google.com/p/mini6410-debian/wiki/Tutorial
  • http://billforums.station51.net/viewtopic.php?f=1&t=5
0