android 1.5 on gumstix overo

kernel source可從 embinux.org 取得,其中也包含android 1.5的source code,並且有做一些patch
ex: battery, and keyboard layout

Download and Compile Source
$ mkdir your_android_dir
$ cd your_android_dir
$ repo init -u git://labs.embinux.org/repo/android/platform/beaglemanifest.git/
$ repo sync
$ make
ps: 關於repo,參考http://source.android.com/download的Installing Repo
Compile kernel
$ cd your_android_dir/kernel
$ export CC_PATH=/home/vanix/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-
$ make menuconfig
由於板子的關係,額外勾選gumstix overo and USB host
$ vi ../vendor/embinux/support-tools/beagle_build_kernel.sh
comment the codes about make config and make clean
$ ../vendor/embinux/support-tools/beagle_build_kernel.sh
此時只會build,不會刪除剛設定好的.config
Install Android Root Filesystem into SD Card
$ cd your_android_dir/out/target/product/generic
$ cp -a root/* /media/disk/
$ cp -a system/* /media/disk/system/
$ cd /media/disk/
$ chown -R root.root *
$ chmod -R 777 data/ system/
ps: 要注意init.rc的mount ro xxx此行是否有註解掉
Boot arguments
$ setenv mmcargs setenv bootargs console=ttyS2,115200n8 root=/dev/mmcblk0p2 rootdelay=2 omapfb.mode=dvi:800x480MR-16@60 init=/init
$ setenv mmcargs setenv bootargs console=ttyS2,115200n8 androidboot.console=ttyS2 root=/dev/mmcblk0p2 rootdelay=2 omapfb.mode=dvi:800x480MR-16@60 init=/init
dss參數的寫法時常有變動,可參考kernel內的Documentation/arm/OMAP/DSS
Other Setting
參考之前另一篇android on gumstix overo

Other Problems
  1. 800x480 on OLED panel - 1. dss參數下正確即可 2. kernel要support GPIO and 開機時立即執行gpio shell
  2. Battery - 開機後立即halt,android porting discussion有好幾種解法,其中之一的解法:更改的com_android_server_BatteryService.cpp
  3. touch功能 - 板子並無外接touch panel,導致一些apps無法正常運作,android porting 相關discussion,修改frameworks/base/libs/utils/ResourceTypes.cpp
  4. 取出android SDK 1.5的file system - 參考Extract google android file system image
  5. 用android SDK 1.5 fs裡的system/,取代我們編譯好的system/,但是會遭遇上述2跟3的問題,將自己編好的libandroid_servers.so和libutils.so取代原本的檔案即可解決
Alsa Setting
這個部份查到的資料比較繁瑣,另外獨立出來整理
Kernel的部份
$ make menuconfig
Device driver -> sound driver -> alsa -> 將相關的選項都打勾
$ make
$ cp arch/arm/boot/uImage /media/FAT
Android source的部份
$ cd your_android_dir/external 

$ git clone git://android.git.kernel.org/platform/external/alsa-lib.git
$ git clone git://android.git.kernel.org/platform/external/alsa-utils.git
$ 
cd your_android_dir/hardware
$ git clone git://android.git.kernel.org/platform/hardware/alsa_sound.git 

$ vi your_android_dir/build/target/board/generic/BoardConfig.mk 
BOARD_USES_ALSA_AUDIO := true 

BUILD_WITH_ALSA_UTILS=true 

# BOARD_USES_GENERIC_AUDIO := true
$ vi your_android_dir/system/core/init/devices.c
{ "/dev/snd/", 0664, AID_SYSTEM, AID_AUDIO, 1 },
(事後發現這行似乎沒有作用, 還是得自行mkdir /dev/snd, 可參考init.rc)
$ cd your_android_dir
$ make
$ vi your_android_dir/out/target/product/generic/root/init.rc
# set the alsa audio driver
mkdir /dev/snd
symlink /dev/pcmC0D0c /dev/snd/pcmC0D0c
symlink /dev/pcmC0D0p /dev/snd/pcmC0D0p
symlink /dev/controlC0 /dev/snd/controlC0
symlink /dev/timer /dev/snd/timer
chmod 0777 /dev/snd/pcmC0D0c
chmod 0777 /dev/snd/pcmC0D0p
chmod 0777 /dev/snd/controlC0
chmod 0777 /dev/snd/timer
chown root audio /dev/snd/controlC0
chown root audio /dev/snd/pcmC0D0c
chown root audio /dev/snd/pcmC0D0p
chown root audio /dev/snd/timer
setprop alsa.mixer.playback.master Front
setprop alsa.mixer.capture.master Capture
setprop alsa.mixer.playback.earpiece Master
setprop alsa.mixer.capture.earpiece Capture
setprop alsa.mixer.playback.headset Master
setprop alsa.mixer.playback.speaker
$ vi your_android_dir/system/etc/asound.conf
sample: asound.conf for TWL4030 on OMAP
(reference this discussion from android porting)

留言

熱門文章