Use Cyanogenmod7 source code to compile and create the Nexus One mobile phone system installation package

Source: Internet
Author: User
 

0. Install the system and development environment:
A) install Ubuntu10.04
B) install the Android SDK. You need the adb command to connect to the device!

1. install necessary software:
$ Sudo apt-get install git-core gnupg
$ Sudo apt-get install flex bison gperf libsdl1.2-dev libesd0-dev
$ Sudo apt-get install libwxgtk2.6-dev squashfs-tools
$ Sudo apt-get install build-essential zip curl libncurses5-dev
$ Sudo apt-get install zlib1g-dev pngcrush schedtool
$ Sudo apt-get install sun-java6-jdk

2. Create a directory:
Store Cyanogenmod source code
$ Mkdir-p ~ /Cyanogenmod

3. Download Cyanogenmod:
Generally, download the repo first, and then download the Cyanogenmod source code with the downloaded repo program.
A) create a bin directory to store the repo program:
$ Mkdir ~ /Bin

B) modify environment variables:
$ Sudo gedit ~ /. Bashrc
After opening the. bashrc file, add the following sentence: export PATH = $ PATH :~ /Bin: Configure environment variables.
CTRL + N open a new window and run the echo $ PATH command. The new PATH takes effect.

C) download the repo program:
$ Sudo curl http://git-repo.googlecode.com/files/repo-1.12> ~ /Bin/repo
Many posts say using $ sudo curl http://android.git.kernel.org/repo> ~ /Bin/repo: Obtain the repo program. After testing, each time an HTTP Error is prompted, the repo cannot be downloaded!

D) modify the downloaded ~ /Bin/repo file:
REPO_URL = 'https: // code.google.com/p/git-repo /'
Change
REPO_URL = 'HTTP: // code.google.com/p/git-repo /'

E) Set repo permissions:
$ Sudo chmod a + x ~ /Bin/repo

F) using repo to download CM source code takes a long time:
$ Repo init-u git: // github.com/CyanogenMod/android.git-B gingerbread
$ Repo sync-j8

4. computer USB data cable connection N1 mobile phone:
$ Sudo adb kill-server
$ Sudo adb devices
The device list should be displayed. If the command cannot be found, install the Android SDK!


5. Start to compile the source code:

A) read the mobile phone configuration file and find the corresponding directory based on your model:
$ Cd ~ /Cyanogenmod/device/htc/passion
$./Extract-files.sh

B) Execute the get-rommanager file under the vendor:
$ Cd ~ /Cyanogenmod/vendor/cyanogen
$./Get-rommanager

C) execute the extract-google-files file under the vendor:
$./Extract-google-files

D) copy an object. Make sure the names are the same:
$ Cp ~ /Cyanogenmod/vendor/cyanogen/products/cyanogen_passion.mk ~ /Cyanogenmod/buildspec. mk

E) execute the script in the cyanogenmod root directory and configure the variables:
$ Cd ~ /Cyanogenmod/
$. Build/envsetup. sh

F) Lunch: select the version you want to compile and select based on your machine:
$ Lunch cyanogen_passion-eng
If you do not know what the parameter is, you can use $ lunch. In this case, you can select the option you want to compile.

G) Start compilation, long wait:
$ Make-j4 CYANOGEN_WITH_GOOGLE = true otapackage
When compilation ends ~ The/cyanogenmod/out/target/product/passion/directory contains many files, including boot. img system. img userdata. img is the image file we need to install. It can be packaged into a zip file for Installation Reference step h). You can also use the following method to test, shut down, and press the power key of your phone and track ball, go to the FASTBOOT interface and run the following command to update the mobile phone system:
$ Sudo fastboot flash boot. img
$ Sudo fastboot flash system. img
$ Sudo fastboot flash userdata. img
$ Sudo fastboot reboot

H) Packaging signature:
$./Vendor/cyanogen/tools/squisher
In ~ /Cyanogenmod/out/target/product/passion/generate update-cm-7.1.0-n1-kang-signed.zip
File, you can refer to the Xiaomi N1 MIUI zip package flash tutorial, the method is the same, below is the tutorial address:

Http://www.miui.com/a-19.html

References:

Http://www.iteye.com/topic/1113040

Http://hi.baidu.com/lizhengjun2010/blog/item/0b84aa406f2d579eb2b7dcf7.html

Http://www.cnrgb.com/compile-cyanogenmod-for-hero-gsm-android-from-source-code

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.