Since August 2009, the kernel is no longer part of the standard repo manifest that you get when you follow the instructions to download the source code for an Android open source project. The steps required to successfully load, build, and run a specific kernel on the emulator are as follows:
- Get the Android kernel either by adding it to the repo manifest or manually by doing:
git clone https://android.googlesource.com/kernel/goldfish.git - Check the correct branch for working with the emulator, i.e. goldfish:
git checkout -t origin/android-goldfish-2.6.29 -b goldfish - Create the emulator configuration (the qemu emulator runs the command code, i.e. the console):
make ARCH=arm goldfish_defconfig- If this does not work, try
make ARCH=arm goldfish_armv7_defconfig
- Now create the kernel using the cross-compilation tools distributed with the open source project:
make ARCH=arm CROSS_COMPILE=mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi- - The kernel built in this way should get into the arch / arm / boot folder of your kernel tree (where you put the code from git clone)
- To run the emulator with your kernel, there are two alternatives: either copy it to the previously created open source project kernel folder to replace the standard kernel. Another option is to run the emulator using the kernel option:
emulator -kernel mydroid/kernel/common/arch/arm/boot/zImage
Please note that I used the default paths in the above description, you need to change them to what is relevant to your setting. It's been a while since I last tested it, but I think it should work.
Additional information: In the standard open-source distribution of Android, the kernel is distributed as a pre-built binary in the mydroid/prebuilt/android-arm/kernel folder, and the source code is not included. The kernel outcome was removed from the default manifest for two reasons. One of them is that the platform components require a lot of bandwidth and disk space, with which most people will not work with great difficulty. Another reason is that since the kernel is built using the kernel build system, and not as part of the aosp build system, it makes sense to separate it. A common branch for the kernel is the one used by the emulator. There are also branches for experimental, msm (Qualcomm platform) and Omap (TI platform), and possibly a few more. If you want to use the Android kernel with hardware, this may be more interesting to you.
BMB Feb 17 '10 at 9:26 a.m. 2010-02-17 09:26
source share