|
在X86的機(jī)器上編譯安裝android,做一個(gè)簡單快速的上網(wǎng)本.我的編譯環(huán)境為VMwave+ubuntu10.04,編譯時(shí)對內(nèi)存占用很大,建議多分一點(diǎn)兒,我分了1.5G.參考網(wǎng)站:
android-x86官方網(wǎng)站:http://www.android-x86.org/
Google OS實(shí)驗(yàn)室:http://blog.livedoor.jp/moonlight_aska/
一、編譯環(huán)境配置:
1、安裝必要組件
$ sudo apt-get update
$ sudo apt-get -y install git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
2、安裝repo
$ cd ~
$ mkdir bin
$ curl http://android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ export PATH=$PATH:~/bin
二、獲取android-x86源代碼
$ mkdir android2.1
$ cd android2.1
$ repo init -u git://git.android-x86.org/platform/manifest.git -b eclair-x86
$ repo sync
-b eclair-x86為制定版本,這里采用的是2.1-eclair來編譯的
三、開始編譯,一般機(jī)器采用eeepc的模式編譯。
$ cd android2.1
$ make iso_img TARGET_PRODUCT=eeepc
iso_img為打包為ISO鏡像,如果想打包為USB鏡像的話可以采用:
$ cd android2.1
$ make usb_img TARGET_PRODUCT=eeepc
錯(cuò)誤修正:在編譯的過程中碰到了幾處錯(cuò)誤,修改方法如下:
錯(cuò)誤1、錯(cuò)誤提示:
host Executable: aapt (out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)
/usr/bin/ld: out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): in function thread_store_set:system/core/libcutils/threads.c:36: error: undefined reference to 'pthread_key_create'
/usr/bin/ld: out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): in function thread_store_set:system/core/libcutils/threads.c:44: error: undefined reference to 'pthread_setspecific'
/usr/bin/ld: out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): in function thread_store_get:system/core/libcutils/threads.c:27: error: undefined reference to 'pthread_getspecific'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] 錯(cuò)誤 1
解決方法:修改./framework/base/tools/aapt/Android.mk文件
LOCAL_LDLIBS := -lz
ifeq ($(HOST_OS),linux)
-LOCAL_LDLIBS += -lrt
+LOCAL_LDLIBS += -lrt -lpthread
endif
ifeq ($(HOST_OS),windows)
錯(cuò)誤2、錯(cuò)誤提示:
host C++: acc <= system/core/libacc/tests/main.cpp
host C++: libacc <= system/core/libacc/acc.cpp
host SharedLib: libacc (out/host/linux-x86/obj/lib/libacc.so)
host Executable: acc (out/host/linux-x86/obj/EXECUTABLES/acc_intermediates/acc)
/usr/bin/ld: out/host/linux-x86/obj/EXECUTABLES/acc_intermediates/main.o: in function symbolLookup(void*, char const*):system/core/libacc/tests/main.cpp:41: error: undefined reference to 'dlsym'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/acc_intermediates/acc] 錯(cuò)誤 1
解決方法:修改./system/core/libacc/tests/Android.mk文件
LOCAL_SHARED_LIBRARIES :=
libacc
+LOCAL_LDLIBS := -ldl
#LOCAL_MODULE_TAGS := tests
LOCAL_SHARED_LIBRARIES :=
libacc
+LOCAL_LDLIBS := -ldl
LOCAL_CFLAGS := -O0 -g
LOCAL_SHARED_LIBRARIES :=
libacc
+LOCAL_LDLIBS := -ldl
LOCAL_MODULE_TAGS := tests
LOCAL_SHARED_LIBRARIES :=
libacc
+LOCAL_LDLIBS := -ldl
LOCAL_CFLAGS := -O0 -g
錯(cuò)誤3、錯(cuò)誤提示:
host Executable: localize (out/host/linux-x86/obj/EXECUTABLES/localize_intermediates/localize)
/usr/bin/ld: out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): in function thread_store_set:system/core/libcutils/threads.c:36: error: undefined reference to 'pthread_key_create'
/usr/bin/ld: out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): in function thread_store_set:system/core/libcutils/threads.c:44: error: undefined reference to 'pthread_setspecific'
/usr/bin/ld: out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): in function thread_store_get:system/core/libcutils/threads.c:27: error: undefined reference to 'pthread_getspecific'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/localize_intermediates/localize] 錯(cuò)誤 1
解決方法:修改./framework/base/tools/localize/Android.mk文件
libcutils
ifeq ($(HOST_OS),linux)
-LOCAL_LDLIBS += -lrt
+LOCAL_LDLIBS += -lrt -lpthread
endif
編譯成功后,可在out/target/product/eeepc/eeepc.iso找到ISO鏡像,用虛擬機(jī)載入該鏡像即可。
已知不完善的地方,gapps安裝后會FC,電子市場FC
鍵位綁定:
鼠標(biāo)左鍵:點(diǎn)擊
鼠標(biāo)中鍵:menu
鼠標(biāo)右鍵/鍵盤ESC:返回
鍵盤Home鍵:home鍵 |
|