现在的位置: 首页 > 综合 > 正文

android 2.3.4 移植 到tiny6410

2013年10月12日 ⁄ 综合 ⁄ 共 5713字 ⁄ 字号 评论关闭

在Fedora 14(32位)上编译android2.3.4 源码,定制厂商 编译记录。

准备 : 下载android 2.3.4的源码,友善t提供的2.3.4 的源码。

工具:友善交叉编译工具

首先看编译源码

#source build/envsetup.sh 
#make

出错
Checking build tools versions...
build/core/main.mk:76: ************************************************************
build/core/main.mk:77: You are attempting to build on a 32-bit system.
build/core/main.mk:78: Only 64-bit build environments are supported beyond froyo/2.2.
build/core/main.mk:79: ************************************************************
build/core/main.mk:80: *** stop.  Stop.

修改build/core/main.mk文件将
#ifneq (64,$(findstring 64,$(build_arch)))
改为
ifneq (i686,$(findstring i686,$(build_arch)))
修改external/clearsilver/cs
external/clearsilver/cgi
external/clearsilver/java-jni
external/clearsilver/util
中的
#LOCAL_CFLAGS += -m64
#LOCAL_LDFLAGS += -m64
改为
LOCAL_CFLAGS += -m32
LOCAL_LDFLAGS += -m32

再编译
#make
几小时后,出错:
sh: gperf: command 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'

安装gperf
#yum install gperf
再次编译
#make

成功生成
Generated: (out/target/product/generic/android-info.txt)

二 定制

新建vendor文件夹及相关子目录文件。参考友善vendor/friendly-arm/mini6410

改成自己想要的名称

/home/android-20120519/Android-2.3.4 友善源码文件路径 //用armv6-vfp,从友善的源码中拷贝。
cp /home/android-20120519/Android-2.3.4/build/core/combo/arch/arm/armv6-vfp.mk build/core/combo/arch/arm/
cp /home/android-20120519/Android-2.3.4/build/core/vm build/core/

拷贝友善的编译脚本和JDK

拷贝 /home/android-20120519/Android-2.3.4/jdk1.6.0_23.tar.gz 

 /home/android-20120519/Android-2.3.4/setenv

 /home/android-20120519/Android-2.3.4/ genimages.sh

 /home/android-20120519/Android-2.3.4/ build-android

到自己编译源码目录

进入自己源码根目录

#build-android

出错
make: *** No rule to make target `out/target/product/DXQ6410/obj/lib/libaudio.so', needed by `out/target/product/DXQ6410/obj/SHARED_LIBRARIES/libaudioflinger_intermediates/LINKED/libaudioflinger.so'.  Stop.

cp /home/android-20120519/Android-2.3.4/external/android-vnc-server/ ./ -rf
cp /home/android-20120519/Android-2.3.4/external/alsa-* ./ -rf
#make clean
#build-android

出错
system/core/debuggerd/vfp.S:21: Error: selected processor does not support `fconstd d15,#15'
make: *** [out/target/product/DXQ6410/obj/EXECUTABLES/vfp-crasher_intermediates/vfp.o] Error 1
make: *** Waiting for unfinished jobs....
修改system/core/debuggerd/vfp.S,加上 #ifdef __ARM_ARCH_7__ endif

#build-android 成功

烧录,启动失败
在system/core/init/init.c 中508行增加:
if (!cur_command->func)
return;

在system/core/rootdir/Android.mk 中修改
file := $(TARGET_ROOT_OUT)/ueventd.rc
$(file) : $(LOCAL_PATH)/ueventd.rc | $(ACP)
$(transform-prebuilt-to-target)
ALL_PREBUILT += $(file)
$(INSTALLED_RAMDISK_TARGET): $(file)
改为:
ifneq ($(TARGET_PROVIDES_UEVENTD_RC),true)
file := $(TARGET_ROOT_OUT)/ueventd.rc
$(file) : $(LOCAL_PATH)/ueventd.rc | $(ACP)
$(transform-prebuilt-to-target)
ALL_PREBUILT += $(file)
$(INSTALLED_RAMDISK_TARGET): $(file)
endif
#make 成功
烧录,启动失败

修改build/core/combo/select.mk 58行
$(combo_target)PRELINKER_MAP := $(BUILD_SYSTEM)/prelink-$(combo_os_arch).map
改为
ifeq ($($(combo_target)PRELINKER_MAP),)
$(combo_target)PRELINKER_MAP := $(BUILD_SYSTEM)/prelink-$(combo_os_arch).map
endif

将友善的build/core/prelink-linux-arm.map 拷贝覆盖到源码相应目录
将友善的external/libusb 复制到源码的external 目录
#make
烧录,启动到android_ 画面,循环打印init: untracked pid 1815 exited
通过logcat 
发现出错在:

I/Zygote  ( 1816): Accepting command socket connections
D/AndroidRuntime( 1836): Shutting down VM
W/dalvikvm( 1836): threadid=1: thread exiting with uncaught exception (group=0x40263560)
E/AndroidRuntime( 1836): *** FATAL EXCEPTION IN SYSTEM PROCESS: main
E/AndroidRuntime( 1836): java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1962]:  request_suspend_state: wakeup (0->0) at 301834277699 (2013-01-07 09:29:35.480607789 UTC)
init: untracked pid 1815 exited
1816 could not load needed library 'libsystem_server.so' for 'libandroid_servers.so' (link_image[1962]:  1816 could not load needed library 'libaudioflinger.so' for 'libsystem_server.so' (link_image[1962]:  1816 could not load needed library 'libaudio.so' for
'libaudioflinger.so' (link_image[1962]:  1816 could not load needed library 'liba2dp.so' for 'libaudio.so' (load_library[1104]: Library 'liba2dp.so' not found))))
E/AndroidRuntime( 1836):        at java.lang.Runtime.loadLibrary(Runtime.java:455)
E/AndroidRuntime( 1836):        at java.lang.System.loadLibrary(System.java:554)
E/AndroidRuntime( 1836):        at com.android.server.SystemServer.main(SystemServer.java:624)
E/AndroidRuntime( 1836):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1836):        at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime( 1836):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime( 1836):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime( 1836):        at dalvik.system.NativeStart.main(Native Method)
I/Process ( 1836): Sending signal. PID: 1836 SIG: 9
E/AndroidRuntime( 1836): Error reporting crash
E/AndroidRuntime( 1836): java.lang.NullPointerException
E/AndroidRuntime( 1836):        at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:76)
E/AndroidRuntime( 1836):        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:854)
E/AndroidRuntime( 1836):        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:851)
E/AndroidRuntime( 1836):        at dalvik.system.NativeStart.main(Native Method)
I/Zygote  ( 1816): Exit zygote because system server (1836) has terminated

由于在 BoardConfig.mk 中我将# Bluetooth 设置为false,导致编译没有生成liba2dp.so 

更改后

BOARD_HAVE_BLUETOOTH := true
重新编译,系统可以启动。
但启动中打印出一些错误:
binder: release 1576:1576 transaction 830 out, still active
binder: 1487:1493 transaction failed 29189, size 4-0
binder: send failed reply for transaction 830, target dead
binder: release 1636:1636 transaction 1109 out, still active
binder: 1487:1493 transaction failed 29189, size 14600-0

binder: send failed reply for transaction 1109, target dead

后续再研究。

抱歉!评论已关闭.