开发者

How can I build a kernel for the Android Emulator? [duplicate]

This question already has answers here: How to com开发者_如何学JAVApile the Android AOSP kernel and test it with the Android Emulator? (8 answers) Closed 9 years ago.

I like to build my own custom kernel to use with the Android Emulator. I know how to build my own Android Emulator image and how to set the kernel that you want use when booting the emulator. But I have no idea how to build a custom kernel for the emulator and what should be in there.

Does anyone has some starting point for me or some documentation?


You can git clone common kernel source from android.git.kernel.org (kernel/common.git) . After clone, checkout remote branch origin/android-goldfish-2.6.29. Then, you can build a kernel image for the emulator. Use arch/arm/configs/goldfish_defconfig for configuration.


Try the Android URL, at the bottom it has detailed instructions on how to build the source.

Then follow this URL for final building (this is for dream release), I am assuming the procedure should hold good for other releases as well.


As of May 2012, the instructions have changed. goldfish (the emulator) now has its own git repository at: https://android.googlesource.com/kernel/goldfish.git

To use this repository, you have to have the commit ID for a known good kernel. (By default, after an initial clone, the repository is bare.) You are supposed to be able to find out the commit id by looking at the last git log message for the file: prebuilts/qemu-kernel/arm/kernel-qemu-armv7 (the prebuilt kernel for the emulator).

You can use this in the goldfish repository, by doing 'git checkout -b mybranch <commit id>' Then do 'make goldfish_defconfig', and then 'make'.

To use your kernel, put it in $ANDROID_PRODUCT_OUT/kernel_qemu (usually, this is out/target/product/generic/kernel_qemu), and the emulator will find it automatically.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜