1.check current kernel version of emulator
$ adb shell2.download kernel source
# cat /proc/version
Linux version 2.6.29-00261-g0097074-dirty (digit@digit.mtv.corp.google.com) (gcc version 4.4.0 (GCC) ) #20 Wed Mar 31 09:54:02 PDT 2010
$ git clone git://android.git.kernel.org/kernel/common3.check branch
$ git branchif it shows * android-2.6.27, list all remote available branches
* android-2.6.27
$ git branch -r4.switch branch
origin/HEAD -> origin/android-2.6.27
origin/android-2.6.25
origin/android-2.6.27
origin/android-2.6.29
origin/android-2.6.32
origin/android-2.6.35
origin/android-2.6.36
origin/android-goldfish-2.6.27
origin/android-goldfish-2.6.29
$ git checkout --track -b android-goldfish-2.6.29 origin/android-goldfish-2.6.295.check branch again
$ git branch6.obtain kernel configuration
android-2.6.27
* android-goldfish-2.6.29
$ cd /path/to/kernel/common7.building and compiling the kernel
$ adb pull /proc/config.gz .
$ gunzip config.gz
$ cp config .config
$ ARCH=arm CROSS_COMPILE=/path/to/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make8.successful message
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Build Android source:
1.building and compiling Android source
$ PATH=/path/to/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin2.successful message
$ cd /path/to/android/
$ make
Install system fs image: out/target/product/generic/system.img
Target ram disk: out/target/product/generic/ramdisk.img
Target userdata fs image: out/target/product/generic/userdata.img
Start emulator:
$ emulator -kernel /path/to/kernel/common/arch/arm/boot/zImage -show-kernel -verbose -image /path/to/android/out/target/product/generic/system.img -data /path/to/android/out/target/product/generic/userdata.img -ramdisk /path/to/android/out/target/product/generic/ramdisk.img
reference:
* Howto BUILD the LINUX KERNEL for the ANDROID EMULATOR (Eclair version)
* Building Android kernel images
* 編譯android原始碼到模擬器上執行
沒有留言:
張貼留言