CyanogenMod rom compilation attempt (note)

Source: Internet
Author: User

Compiling environment:

Vmware workstation 7 + ubuntu 10.04 32-bit

 

 

1. Install the android sdk

 

2. packages for 32-bit and 64-bit installation:

Git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool

 

3. 64-bit software packages to be installed:

G ++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g ++-4.3-multilib

 

4. Create a directory under the home Directory of the current user

Mkdir-p ~ /Bin

Mkdir-p ~ /Android/system

 

5. Install and initialize the repo.

Curl http://android.git.kernel.org/repo> ~ /Bin/repo

Chmod a + x ~ /Bin/repo

 

Cd ~ /Android/system/

Repo init-u git: // github.com/CyanogenMod/android.git-B gingerbread

Repo sync-j16

 

6. copy the file corresponding to the mobile phone

Cd ~ /Android/system/device/htc/bravo/

/Extract-files.sh

 

7. Download RomManager

~ /Android/system/vendor/cyanogen/get-rommanager

 

8. Check for updates

Cd ~ /Android/system/

Repo sync

 

9. Start Compilation

. Build/envsetup. sh & brunch bravo

Simple command explanation :. build/envsetup. sh adds some functions defined in this file to the Current shell environment. These functions are used during compilation, such as obtaining relative paths and absolute paths.

The brunch after the above command line is one of the functions, which is used to compile the rom of a branch device. Here it is bravo (HTC Desire ).

The & symbol in the middle of the above command line indicates that after the current command is successfully executed, the subsequent brunch bravo Command will be executed.

 

Therefore, we can also execute. build/envsetup. sh to add the function to the shell variable, and then execute the brunch bravo to compile the Desire ROM.

 

 

Final file :~ /Android/system/out/target/product/bravo/update.cm-XXXXX-signed.zip

 

Record the compilation time: if the ROM has been compiled before, the re-Compilation Time will be much shorter after the source code is synchronized, And the Compilation Time will not exceed 10 minutes.

Of course, if it is the first compilation, it will take a long time. According to your machine configuration, it usually takes more than half an hour.

 

My machine configuration: I3 M380 2.53 GHZ
Memory: 4 GB


First compilation: 37 minutes
Second compilation: 6 minutes

 


Supplement:
1. Change the default language to Chinese.

 

Modify build \ target \ product \ full_base.mk:

PRODUCT_LOCALES: = zh_CN

 

2. Modify the language to be compiled

Modify build \ target \ product \ languages_full.mk:

PRODUCT_LOCALES: = en_US \

Zh_CN

Compile only English and simplified Chinese.

 

 

3. repo undo local modification

Repo forall-c git reset -- hard HEAD

Sometimes the local code is modified, and an error is reported during the next synchronization. You can execute this command when you need to clear the code.


4. compile related configuration files:
Verdor \ cyanogen \ products \ cyanogen_bravo.mk
This file defines the compiled kernel and the final file name for compilation.


Supplement
5. You can delete unnecessary items to reduce synchronization time and data. The specific operation is to find android/system /. project under the repo directory. list and manifest. xml files can be used to delete devices, htc, and other such entries (device files are mainly required for different mobile phones. If we only need to compile a rom of a mobile phone, you can delete all other items. To avoid errors, you can delete them one by one.) After deletion, run repo sync in the android/system directory again for synchronization. If no error is reported, in this way, the modification is successful. In the future, the deleted items will not be synchronized.


6. When initializing the git database, the following error occurs: android.git.kernel.org [0: 149.20.4.77]: errno = Connection refused. solution:
Find the repo file and modify REPO_URL = 'https: // github.com/android/tools_repo.git.


 

From aswang's focus

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.