Android Kernel compilation

Source: Internet
Author: User

The previous article recorded the Android source code compilation process: http://blog.csdn.net/jiguangcanhen/article/details/42081229

But we are in the process of compiling, using Google to compile our kernel source code, location:/prebuilt/android-arm/kernel/kernel-qemu

So how do we compile our own kernel source?

First download Kernel source code: Kernel source code

After downloading the kernel source code, I then the Android source kernel folder, set up a folder Private_guo, and then put the downloaded folder into it.

Enter the root directory of the kernel source:/usr/local/android/android_2.3.7/kernel/private_guo/kernel

Modify Makefile file: sudo gedit Makefile

After that, you can execute the compile command, and this time your shell should be in the root directory of the kernel source code:

Make Goldfish_defconfig

Make


You will then find an error:

I can't find the arm-eabi-gcc .

Then download this tool: Http://pan.baidu.com/s/1eQ3WSU2

You can also go to git and get it: https://github.com/android/platform_prebuilt/tree/master/linux-x86/toolchain/arm-eabi-4.4.3

I am here to provide the whole prebuild, everyone just get inside the platform_prebuilt-master\linux-x86\toolchain\arm-eabi-4.4.3 on it.

Then put it into the/usr/lib, then you can configure the environment variables.

sudo gedit/etc/profile

Then add the/usr/lib/arm-eabi-4.4.3/lib in the Classpath

Add/usr/lib/arm-eabi-4.4.3/bin in Path

Then execute the source/etc/profile to apply the environment variable (lazy restart).

In this way, the above compile command is executed again, and an error is found at this time:

Include/asm is a directory but a symlink was expected

This is also very simple: the Linux/include/asm folder is created during kernel compilation, the result is a link to the folder Asm-arm, indicating that the platform of the system is arm architecture, and before compiling the system kernel, there is no ASM this link, so, during the compilation process , the file name conflicts with the ASM folder name when the link was created, and an error occurred.

After that, execute the compile command again:

Objcopy Arch/arm/boot/zimage appears

Kernel:arch/arm/boot/zimage is ready

This means that the compilation was successful.

Here's how to start the simulator with us:

Export path= $PATH:/usr/local/android/android2.3.7/out/host/linux-x86/bin

Export Android_product_out=/usr/local/android/android_2.3.7/out/target/product/generic

Emulator-kernel./kernel/private_guo/kernel/arch/arm/boot/zimage

After a while, our simulator starts up:


OK, so our kernel is compiled. Good luck!


Android Kernel compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.