从 查看各个分支及其TAG
- mkdir /android; cd /android
- curl repo > repo
# repo上android的下载源码脚本 - mkdir -p /android/donut_release; cd /android/donut_release
- ../repo init -u git://android.git.kernel.org/platform/manifest.git -b donut
- ../repo sync
- mkdir /android/donut_kernel; cd /android/donut_kernel
- git clone git://android.git.kernel.org/kernel/common.git
- cd common;
- git branch -a; 查看分支
- git checkout origin/android-goldfish-2.6.29 -b goldfish
- vi Makefile : 设置 ARCH和CROSS_COMPILE为 arm/ arm-eabi-
- make 尝试编译。
- sudo apt-get -y install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind g++ sun-javadb-javadoc
- export JAVA_HOME=/usr/lib/jvm/java-5-sun
- export JRE_HOME=${JAVA_HOME}/jre
- export ANDROID_JAVA_HOME=$JAVA_HOME
- export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:${JAVA_HOME}/lib:$JRE_HOME/lib:$CLASSPATH
- export ANDROID_HOME=/android/donut_release
- export ANDROID_PRODUCT_OUT=$ANDROID_HOME/out/target/product/generic
- export PATH=$PATH:$JAVA_HOME/bin:${JRE_HOME}/bin:$ANDROID_HOME/out/host/linux-x86/bin:$ANDROID_HOME:/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin
- sudo update-alternatives --config javac [java/javadoc]
#配置使用 java-5-sun的配置。(ubuntu 9.10中舍弃了jdk5, 可以自己安装 jdk1.5.bin
- 编译make (make sdk)
- cd $ANDROID_HOME; make #修改做部分修改,详情看最后
- 编译完成后,使用模拟器进行测试。
模拟器
./android list targets ; 查看当前的支持的target
./android create avd --name avd-donut --target 1
./androld list avd
./emulator -avd
avd-donut
调试桥
./adb remount
./adb shell
根文件系统
目录在 out/target/product/generic/ 下
从模拟器中获取默认配置文件
adb pull /proc/config.gz /tmp; cd /tmp
gunzip config.gz
mv config
/android/donut_kernel/.config
测试配置文件
cd
/android/donut_kernel
make ARCH=arm menuconfig
make CROSS_COMPILE=arm-eabi-
- 初始化完成,进行第二步,内核的移植,搭载idea 6410 自带的rootfs
==== 编译android时需要改动的源码地方 BEGIN===E: ‘EAI_NODATA’ undeclared
S: vi external/qemu/Makefile.android
ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
- MY_CFLAGS += -Wa,--32
+ MY_CFLAGS += -Wa,--32 -D_GNU_SOURCE
endif
E: cupcake battery bug
S: vi frameworks/base/services/java/com/android/server/BatteryService.java
private final void sendIntent() {
// Pack up the values and broadcast them to everyone
+ mBatteryLevel = 100;
E:
Build error message:
frameworks/policies/base/PolicyConfig.mk:22: *** No module defined for the given PRODUCT_POLICY (android.policy_phone).
S: modify codes at line 89 in build/tools/findleaves.sh
#find "${@:0:$nargs}" $findargs -type f -name "$filename" -print |
find "${@:1:$nargs-1}" $findargs -type f -name "$filename" -print |E: frameworks/base/tools/aidl/AST.cpp:10: error: 'fprintf' was not declared in this scope的错误
S:下载gcc-4.3和g++-4.3
apt-get install gcc-4.3 g++-4.3
cd /usr/bin
ln -s gcc-4.3 gcc
ln -s g++-4.3 g++
==== 编译android时需要改动的源码地方 END ===
阅读(3966) | 评论(0) | 转发(0) |