skip menu and go to main content

body start

ODROID-T -S -7

Wiki

Project News

Project Info

  • This project has not yet categorized Software Map
  • Member count : 5
  • Registered:  : 2010.05.10
  • Activity Percentile:  : 100%

activity viewforum,download view

1 Preface

This page will explain how to compile Android for Odroid.
Current version is android 2.2(Froyo) with modified from Samsung rtm1.0

2 Build environment

Tested with Ubuntu 8.10/9.04/9.10/10.04

Please note,
To follow below instructions, you need to update your system to 2010-11-11 firmware.

http://dev.odroid.com/projects/odroid-t/download

3 Download and Install essential packages

Android requires the following system packages:

  • flex: This lexical analyzer generator is used to read a given input file for a description of a scanner to generate.
  • bison: This is a general-purpose parser generator.
  • gperf: This is a perfect hash function generator.
  • libesd0-dev: This enlightened sound daemon (dev files) is used to mix digitized audio streams for playback by a single device.
  • libwxgtk2.6-dev: This package provides GUI components and other facilities for many different platforms.
  • build-essential: This package contains a list of packages considered fundamental to building Debian packages.
  • Android source code includes a hard dependency on the Java Developer Kit (JDK) 5.0 Update 12 or greater.

Please refer this link first !!! http://source.android.com/source/download.html

  • Download packages.
# sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl valgrind

  • Android also need Phython 2.4 or higher. But, Ubuntu has Python 2.5 in general.
  • Install JDK 5.0 Update12 or later. JDK 6.0 has no problem to build the latest source.
sudo gedit /etc/apt/sources.list and add "deb http://archive.canonical.com/ lucid partner"
# sudo apt-get update
# sudo apt-get install sun-java6-jdk

  • Your system may need a mkimage to make a ramdisk image.
# sudo apt-get install uboot-mkimage

  • Add Path in your environment file. Modify your ~/.bashrc file to add a new path with editor (gedit or vi)
export PATH=/home/$USER/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.16  ---> Java Home Directory you've installed.
export ANDROID_JAVA_HOME=$JAVA_HOME

  • To apply this change login again or restart the .bashrc
source ~/.bashrc

4 Getting source code and extraction

Source code can be obtained from this link. File name of compressed source code may be different.
# mkdir mydroid
# cd mydroid
# mydroid$ tar xfz odroid-c110.android.tar.gz
With this process, you will have a full source code in mydroid directory.

5 Obtain restricted files from Odroid-T/S/7

There are some restricted object files which have no source code. We have no right to release even the objects. Those files should be extracted from Odroid device.

In the android/vendor/sec/odroidt/AndroidBoard.mk file, vendor/confidential contents have no source code. Refer the AndroidBoard.mk file to make a list of restricted.

5.1 Case 1: ADB of android-sdk

You need to install ADB driver first and connect your Odroid to your host PC.
== Make proper directory ==
# mydroid$ cd android/vendor
# mydroid/android/vendor$ mkdir confidential
# mydroid/android/vendor$ cd confidential
# mydroid/android/vendor/confidential$ mkdir module
# mydroid/android/vendor/confidential$ mkdir lib
# mydroid/android/vendor/confidential$ mkdir bin
== Extract modules ==
# mydroid/android/vendor/confidential$ cd module
# mydroid/android/vendor/confidential/module$ adb pull /modules/pvrsrvkm.ko .
# mydroid/android/vendor/confidential/module$ adb pull /modules/s3c_lcd.ko .
# mydroid/android/vendor/confidential/module$ adb pull /modules/s3c_bc.ko .
# mydroid/android/vendor/confidential/module$ cd ..
== Extract library files ==
# mydroid/android/vendor/confidential$ cd lib
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/egl/libEGL_POWERVR_SGX540_120.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/egl/libGLESv2_POWERVR_SGX540_120.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/libsrv_um.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/libsrv_init.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/libIMGegl.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/libpvr2d.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/libPVRScopeServices.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/libglslcompiler.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/libpvrANDROID_WSEGL.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/hw/gralloc.s5pc110.so .
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/hw/copybit.odroidt.so .   ===> odroid7 or odroids
# mydroid/android/vendor/confidential/lib$ adb pull /system/lib/hw/sensors.odroidt.so .   ===> odroid7 or odroids
# mydroid/android/vendor/confidential/lib$ cd ..
== Extract binary files ==
# mydroid/android/vendor/confidential$ cd bin
# mydroid/android/vendor/confidential/bin$ adb pull /system/bin/pvrsrvinit .
# mydroid/android/vendor/confidential/bin$ adb pull /system/bin/geomagneticd .
# mydroid/android/vendor/confidential/bin$ adb pull /system/bin/orientationd .
# mydroid/android/vendor/confidential/bin$ adb pull /system/bin/logtool .
# mydroid/android/vendor/confidential/bin$ cd ..
== Change access permission ==
# mydroid/android/vendor/confidential$ chmod -R 755 *

5.2 Case 2: Extract files from T-Flash(Micro-SD) Card reader

You can extract restricted files with Terminal Console and USB T-Flash card reader.
== Because *.ko module files are located in ramdisk image, you can't copy it directly. Before eject the T-Flash, you must copy the *.ko files from ramdisk to normal root file system in serial terminal program.
# cp -a /modules/*.ko /data
# sync
After system shutdowm, eject the T-Flash card and plug it into T-flash memory card reader. In the linux host PC, you need to copy all the restricted files as described in Case-1.


6 Building the code


You need to install mkimage package
# sudo apt-get install uboot-mkimage 
or you need to set a PATH of mkimage of uboot directory.


Optional!! If you meet compile error due to JDK version mismatching, add this items in to Synaptic package source. (sudo vi /etc/apt/sources.list)
deb http://archive.ubuntu.com/ubuntu/ jaunty multiverse
deb http://archive.ubuntu.com/ubuntu/ jaunty-updates multiverse
sudo apt-get update

  • To build the files, run make from within your working directory:
# cd ~/mydroid/android
# mydroid/android$
# ln -s vendor/sec/odroidt/build_android.sh  ./odroidt_build.sh <== odroid-T
# ln -s vendor/sec/odroidt/build_android.sh  ./odroids_build.sh <== odroid-S
# ln -s vendor/sec/odroidt/build_android.sh  ./odroid7_build.sh <== odroid-7
# ./odroidt_build.sh
  • If there is no problem, you can see below message. rootfs directory is automatically generated and all root file system of Android is located in that directory.(/mydroid/android/odroidt-img)
ok sucess !!!
#
  • Note: Compile takes about 20 minutes with latest multi-core CPU based computer. Some old computer or virtual machine may need about 2 hours.
  • If you still have a C/C++ compilation error, try sudo apt-get install libc6-dev-i386 fro 64bit host.

7 Write the compiled files to T-Flash under Ubuntu (Must have Linux PC)

  • Insert the T-Flash in to Card reader and connect the card reader to Linux PC.
  • Copy all files in the \odroidt-img\system to EXT4 partition of T-Flash.
  • Normally when you plug the Card reader into Ubuntu PC, Ubuntu will mount it automatically. You need to remember the mounting point.
  • To find the mounting points, perform below commands.
    # mount
    /dev/sdc1 on /media/disk-1 type ext4 (rw,nosuid,nodev,uhelper=hal) ---> Mount T-Flash first partition(Android system): remember this!
    /dev/sdc2 on /media/disk-2 type ext4 (rw,nosuid,nodev,uhelper=hal) ---> Mount T-Flash second partition(Android data) 
    #
     
If the partition table is NOT correct, you need to make partition as below. You also need this process, if you want to use fresh(new) T-flash card.

Or, you can use recovery tool for Windows tool "ODROID_T_TF_Bunner_21a.exe" or later version with the latest .odt image.

7.1 Copy Android system to formatted partition (Overwrite)

  • Copy android system file to EXT4 partition of T-Flash.
    # sudo cp -a ~/mydroid/android/odroidt-img/system/* /media/disk-1 ---> mounting point (You may have different location)
    # sync
     
  • Unmount the T-Flash disk and move the card from PC to Odroid for testing.
    # sudo umount /media/disk-1 (or) sudo umount /dev/sdc1 ---> Unmount T-Flash first partition(Android system)
    # sudo umount /media/disk-2 (or) sudo umount /dev/sdc2 ---> Unmount T-Flash second partition(Android data)
     

7.2 Copy android system to new partition (Clean & Write)

  • Before copying files, format the partition first. All data will be erased.
  • To format the T-Flash, unmount it first.
  • This is an example when device node of T-flash is /dev/sdc.
    # sudo umount /dev/sdc1 ---> Unmount T-Flash first partition(Android system)
    # sudo umount /dev/sdc2 ---> Unmount T-Flash second partition(Android data)
    # sudo mkfs.ext4 /dev/sdc1
     


  • If you want clean install, erase the Android data partition as below.
  • WARNING! : You can delete all of data in you Host PC, if you select wrong disk/partition node name.
    # sudo mkfs.ext4 /dev/sdc2 ---> T-Flash second partition(Android data)
     

  • After formatting, mount the T-flash to /media/disk
    # sudo mount /dev/sdc1 /media/disk ---> T-Flash first partition(Android system)
     


  • You can copy the android system files to T-Flash.
    # sudo cp -a ~/mydroid/android/odroidt-img/system/* /media/disk ---> T-Flash first partition(Android system)
    # sync
     
Note: odroidt-img directory name can be odroids-img or odroid7-img.

  • Unmount the T-Flash disk and move the card from PC to Odroid for testing.
    # sudo umount /media/disk (or) sudo umount /dev/sdc1 ---> Unmount T-Flash second partition(Android system)
     

8 ramdisk-uboot.img write

Need to learn u-boot section of Odroid-T project. http://dev.odroid.com/projects/odroid-t/wiki/UbootPage

In the u-boot prompt, type "run dnwr". In the host PC, type "smdk-usbdl -f ramdisk-uboot.img"

9 T-flash sector map

10 Others


Default boot parameter is
HKDKC110 # print env
bootcmd=movi read kernel 30008000; movi read rootfs 30A00000 180000; bootm 30008000 30A00000 bootargs=root=/dev/tfsr6 rootfstype=cramfs console=ttySAC2,115200 init=/linuxrc androidboot.console=s3c2410_serial2

If you have different parameter, you can reset it with below command
HKDKC110 # run args_ram