Full blog Android SDK compilation details (ii)

Source: Internet
Author: User

Note to make sure that the JDK is installed)

First step: CD Lichee;./build.sh-p sun5i_elite-k 3.0 (Apt-get install uboot-mkimage requires installation of mkimage tools)

1) Open build.sh script found in script only "buildroot/scripts/common.sh [email protected]" This sentence, where [email protected] Accept all input parameters

2) continue to open (VIM) buildroot/scripts/common.sh script read code to compile linux-3.0 kernel and bootloader source to generate kernel image, Uboot and file system, etc. and copy to out/android directory

out/

├──android├──bimage

├──lib

├──toolchain

├──uimage

│──zimage

│──u-boot.bin

│──sun5i_rootfs.cpio.gz

The differences between several Linux kernel files:

1, Vmlinux compiled the most original kernel file, uncompressed.

2, Zimage is vmlinux after gzip compressed file.

3, Bzimage BZ said "Big Zimage", not with bzip2 compression. The difference is that zimage unzip the kernel to low-end memory (the first 640K), bzimage the kernel to high-end memory (1M or more). If the kernel is relatively small, then the use of Zimage or bzimage are OK, if the larger should be used bzimage.

4, Uimage u-boot dedicated image file, it is zimage before adding a length of 0x40 tag.

5. Vmlinuz is a copy of the Bzimage/zimage file or a link to bzimage/zimage.

6, INITRD is "initial ramdisk" shorthand. Typically used to temporarily boot the hardware to the actual kernel vmlinuz to be able to take over and continue the boot state

Step two: CD Android; SOURCE build/envsetup.sh

This command is used to load all the commands in the envsetup.sh into the environment variable, so let's analyze it.

Step three: [Email protected]:/work/shenbao-new/wifi_ddr128x16_shenbao/android# lunch

(a command defined in #lunch命令是envsetup. SH to allow the user to select a compilation item to define the global variables used in the product and compilation process.) )

You ' re building on Linux

Lunch Menu ... pick a combo:
1. Full-eng
2. Full_x86-eng
3. Vbox_x86-eng
4. Full_stingray-userdebug
5. Full_wingray-userdebug
6. Full_crespo4g-userdebug
7. Full_crespo-userdebug
8. Full_maguro-userdebug
9. Full_toro-userdebug
Ten. Full_tuna-userdebug
Apollo_mele-eng.
Apollo_tvdevb-eng.
Crane_evb_v12r-eng.
Crane_evb-eng.
Crane_m1003h6-eng.
Elite_evb-eng.
Elite_nm307_v11-eng.
Elite_nm307-eng.
Nuclear_12_evb-eng.
Nuclear_evb-eng.
Full_panda-eng.

which would? [Full-eng] 17

Fourth Step: android# extract-bsp

EXTRACT-BSP is a script function that is executed when device/softwinner/common/vendorsetup.sh is lunch, meaning extract-bsp is invalid if lunch is not executed first.

Through the analysis of the extract-bsp script found, in fact, the results of the Lichee compiled output to Device/softwinner/vendor directory, in fact, this process is for Android compilation in preparation.

Fifth step: Make

The result of executing the make command is to execute the makefile file in the current directory, and we'll look at its contents:

### DO NOT EDIT THIS FILE ###

include build/core/main.mk

### DO NOT EDIT THIS FILE ###

Let's look at the build/core/main.mk again.

Although the script is not many in the Main.mk file, but it defines the entire Android compilation relationship, it mainly introduces the following important MK files:

Include $ (build_system)/config.mk

Include $ (build_system)/cleanbuild.mk

142 include $ (build_system)/definitions.mk

Full blog Android SDK compilation details (ii)

Related Article

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.