Build an environment for compiling Android source code

Source: Internet
Author: User
Tags imx6

Because Google uses Ubuntu to compile the Android source code, I have installed Ubuntu here. It is convenient and simple to install Ubuntu by using the five-stroke method. The defect is that the root directory size of the installed system is limited. I just tested that the maximum size allowed for installation is 30 GB. In this case, we have installed the system, set up the compiling environment, copy the Android source code, and then compile it. Throughout the process: the system itself occupies 3-5 GB of capacity, and the installation and compilation environment requires a part of capacity. The Android source code requires about 2 GB of capacity, and the compiled Android source code package is about 20 GB. Our 30 GB capacity is basically used up. Therefore, we need to use a USB flash disk to install the Ubuntu system and hard disk to install the system. I tried to install the Ubuntu system according to the tutorial on the Internet, avoiding the trouble of limited installation capacity. The following operations are tested by the user. Of course, different people in different environments will naturally encounter different problems.

Install Ubuntu on Hard Disk

Necessary preparations: EasyBCD Software Ubuntu source code package (taking 12.04LTS32 as an example) Extract the casper folder from the iso image and put it into C: \. Put the initrd. lz and vmlinuz files in it into C: \ and the iso image in C :\. First install EasyBCD. Open the software and click -- add new entry -- NeoGrub option -- configuration. A text file will pop up. You need to write the corresponding installation configuration command to the text file and save it.


The write command is as follows:

Title Install Ubuntu
Root (hd0, 0)
Kernel (hd0, 0)/vmlinuz boot = casper iso-scan/filename =/ubuntu-12.04-i386.iso ro quiet splash locale = zh_CN.UTF-8
Initrd (hd0, 0)/initrd. lz

Ps: the first line does not need to be explained. Most people need to understand three consecutive records (hd0, 0 ). Hdx -- indicates your hard disk number, 0 indicates the first hard disk on your host, and so on. The value 0 indicates the corresponding partition on the hard disk. For win7, drive C is not the first partition of your hard disk, so you need to view the Disk Manager (my computer -- Right-click -- manage -- disk management ). You can also use DiskGenius to view your c disk partition. As shown in, you need to change the second parameter to 1 .. If you enter the installation system entry when you restart the host, an error will be prompted. You can modify the last parameter by pressing E until it is modified to the correct parameter.


After completing the above work, we need to select a disk partition for formatting and hide the partition in Windows (this step must be done, because we want to install the Ubuntu system to this partition, transfer Data before hiding ). Note that the iso file name in the third line is to write your own iso file name. Now you can restart the host. After restarting, select the newly added startup Item to go To the Ubuntu page. The subsequent work is just like what we did in the tutorial.

Build an Android Source Code compiling environment and import the installation package and gcc jdk g ++

My embedded development board is the Mars board IMX6 A9 platform of Marsboard. Here is the reference http://blog.csdn.net/stephenzhu/article/details/11212937? Reload. Thank you for your sharing. Of course, others' success cannot be completely replicated. I also encountered my own problems during the building process. The installation of JDK 6, GCC, and G ++ is really good and practical. When the author needs to install multiple packages in Step 4, we may need to change the package order to solve the dependency. Remember that there was always a problem with GCC when I set it up myself. My solution is to install GCC4.4.3 to replace the original one.

The Android source code is directly copied from the CD, so it is not downloaded from the Internet (after all, it is too slow ). After decompression, enter the corresponding source tree home directory (in my own example) Execution: toshba/android/android-imx6/$ source build/envsetup. sh is to set the compiling environment variables. The toshiba/android/android-imx6/$ lunch marsboard-6q-user represents the compilation at which point the expected results of the compilation you want and the host information you correspond to are displayed. Then you can execute the make command. If your host is a dual-core CPU, You can execute make-j4 to enable multi-threaded compilation to increase the compilation speed .. I personally feel that the first time you execute make, no matter how thoughtful your preparation is, you will always encounter an error. In this case, do not lose heart and make the error Google or Baidu. Then, import the corresponding dependent package. This process is a long estimate of at least two hours. If compilation is successful, you will see binary files such as system. img ramdisk under out/target/product/masrboard-6q. Now the compilation is complete. Of course, I am a newbie. It takes me a week to prepare for installation of the operating system, environment setup, source code compilation, and so on, but it was really difficult for me at the time, but there were quite a lot of shipping items. PS: I started to learn about some blog formats which are messy and the content is superficial. Please kindly advise. Thank you.



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.