How to build an android 1.5 System Image

Source: Internet
Author: User

Please refer to how to obtain the android source code first

Article, get the latest Android main line code through repo (or take the tag named android-SDK-1.5_r1 ).

1. Prepare the Host OS compiling environment

In the process of obtaining the android source code and compiling the kernel, We have installed at least
Curl, Git-core, ncurses-Dev,
Build-essential and other software packages (python2.5 has been bundled in ubuntu8.04), but this is not enough. To compile the android code tree, I
They also need flex, Bison, gperf, valgrind (optional), libsdl-Dev, libesd0-dev, libwxgtk2.6-
Dev, zlib1g-dev and other software packages, fortunately apt-Get can help us deal with it once.
Sudo apt-Get install flex bison gperf valgrind libsdl-dev libesd0-dev libwxgtk2.6-dev zlib1g-dev

JDK 5.0 is also required during compilation (note that JDK is not supported). go to Sun's official website.

Download and install.

2. tool chain and Environment Variables

Add jdk5.0 to $ path, for example:
$ Export Path = $ path:/home/William/jdk5.0/bin

Then, you can use Java-version to confirm the Java version.

In addition, the environment variables and toolchain settings made by the compiling kernel are not required when compiling the system image. This is done by the android compilation script.

3. Compilation options

The envsetup. mk In the build/Core directory defines the target architecture and OS. The default values are arm and Linux. We do not need to modify the OS because porting is not involved.

4. Start Compilation

After completing the above preparations, you can click make in the root directory of the code tree. The compilation process needs to last for about 1 ~ 2 hours, which requires about GB of available space.

5. Test the generated image

After compilation, if you want to run it in the simulator, except for the kernel image file, the other three image files are: (in the out/target/product/generic/directory)
Ramdisk. img
: Contains the file system required to start android in the simulator.
System. img
: Initial Android system image, including program and library files
Userdata. img
: Initial user data Image File
Module
The parsers first go to the directory where the specified AVD is located to check whether there is a userdata image. If not, they will create one based on the initial userdata. IMG and load the three mappings.
After the file, it mounts system. IMG and userdata. IMG to the system and userdata directories in the ramdisk file system. All
User data is stored in the userdata-qemu.img under the AVD directory, and the initial user data image file is not modified.

You can use the command line parameters to start the simulator and load the compiled system image:
First, set the android_product_out environment variable to point to the out/target/product/generic/directory.
(Update: The experiment proves that this step is unnecessary) and then runs
Emulator @ 1.5 _ L2-system. IMG-ramdisk. img

Or we can add the-Kernel Parameter and start it with the self-compiled kernel.

If the system is successfully started:

Although it takes a lot of time to compile the Android system image, it is still relatively simple in general. The Android build system helps us complete most of the settings.

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.