Download the latest cm source code

Source: Internet
Author: User
Tags gnupg

Downloading cm source code is actually similar to downloading Google's pure Android source code. below is the official cm website. You need to download the ROM corresponding to your mobile phone and put it in the sdcard root directory, just in case.

Http://www.cyanogenmod.com/

 

Next I will introduce another website: http://forum.xda-developers.com/index.php

This is an xda developer forum, where experts like cloud will help you

 

Now let's start to show you how to download the source code, compile the source code, and fl it to your mobile phone.

 

1. install required software

I use Ubuntu 11.04.

Sudo apt-Get install <Software List>

The following is the Software List:

Java code
  1. 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

NOTE: If JDK cannot be installed, you can download it by yourself or refer to my blog:

Http://hualang.iteye.com/blog/1132207

 

2. Create a directory

Mkdir-P ~ /Cyanogenmod

Used to store the downloaded source code

 

3. start downloading

 

Java code
  1. Curl http://android.git.kernel.org/repo> ~ /Bin/Repo
  2. Chmod A + x ~ /Bin/Repo

Download cyanogenmod source code with the downloaded Repo

 

Java code
  1. Repo init-u git: // github.com/cyanogenmod/android.git-B gingerbread
  2. Repo sync-j16

The repo sync process is quite slow. Using repo sync-JN, N indicates the number of network connections opened at the same time. Enabling multiple network connections for download will increase the speed.

 

4. Compile the source code below

First, you need to debug the USB of your mobile phone and connect it to your computer.

 

Java code
  1. Cd ~ /Cyanogenmod/device/Samsung/Crespo
  2. /Extract-files.sh

Then

Java code
  1. Cd ~ /Cyanogenmod/vendor/cyanogen
  2. ./Get-rommanager
Java code
  1. ./Extract-Google-Files

5. Copy an object with the same name.

Java code
  1. CP ~ /Cyanogenmod/vendor/cyanogen/products/cyanogen_crespo.mk ~ /Cyanogenmod/buildspec. mk

6. Run the script in the cyanogenmod root directory and configure the variables.

Java code
  1. . Build/envsetup. Sh
  2. Or
  3. Source build/envsetup. Sh

7. Click "lunch" and select the version you want to compile.

Java code
  1. Lunch cyanogen_crespo-eng
  2. Or
  3. Lunch
  4. This will show options, select the option you want to compile

8. Start Compilation

Java code
  1. Make-J4 cyanogen_with_google = true otapackage

9. Execute

Java code
  1. ./Vendor/cyanogen/tools/squisher

 

In this case ~ There is an update zip package under/cyanogenmod/out/target/product/Crespo, which is generated by your compilation.

You can brush it to your cell phone.

In fact, one advantage of CM is that you do not need to compile the kernel source code and generate a zip package directly, saving the trouble of creating a zip package.

 

If you do not have a mobile phone, you can use a simulator to test it. Copy zimage in the kernel/cm-kernel/ARCH/ARM/boot directory to a folder. Note that, you have to install the SDK and download a fastboot tool.

Java code
  1. ADB reboot bootloader
  2. ./Fastboot boot zimage

Then, we will wait to see the effect.

*************************************

This tutorial provides a lot of reference to the slax and g1's noirbright tutorials (because some things are outdated and may cause troubles to some readers ).

First install Ubuntu, 10.10 (I use 10.10. You can use a new version if you have other requirements. We recommend that you use 40g + for partitioning ).
After installation, configure the source.
Here is a few words.
Http://code.google.com/p/ailurus/downloads/list
We recommend that you download the software in the format of Deb and install it directly. This is equivalent to a Windows optimization master. There is a source list in it to help you test the fastest source, after you select this option, you can directly change the source file. You do not need to open the file and save it.

The next step is the establishment of the environment.
JDK
Go to Sun's official website to download JDK.
Under me is
Jdk-6u24-linux-i586.bin.
This file is installed in the current directory when it is running, so find the directory you want to install. I use/usr/lib/JVM/Java,
Code:

  1. CD ..
  2. CD usr/lib
  3. Mkdir JVM
  4. CD JVM
  5. Mkdir Java
  6. CD Java

Copy code

(Then copy the file jdk-6u24-linux-i586.bin in .)

  1. Chmod U + x jdk-6u24-linux-i586.bin
  2. /Jdk-6u24-linux-i586.bin

Copy code

The screen continues to scroll until you enter Yes/No, Of course yes, and press Enter.

After installation:

  1. Gedit/etc/profile

Copy code

Add the following at the end of the opened file:
# Set Java environment
Java_home =/usr/lib/JVM/Java/jdk1.6.0 _ 24
Export jre_home =/usr/lib/JVM/Java/jdk1.6.0 _ 24/JRE
Export classpath =.: $ java_home/lib: $ jre_home/lib: $ classpath
Export Path = $ java_home/bin: $ jre_home/bin: $ path
(Configure the system Java environment)

Restart and check Java:

  1. Java-version

Copy code

Appears:
Java version "1.6.0 _ 24"
Java (TM) se Runtime Environment (build 1.6.0 _ 24-b07)
Java hotspot (TM) server VM (build 19.1-b02, mixed mode)
The installation is successful.

SDK

Go to Android official website download android-sdk_r10-linux_x86.tgz
Directly decompress the package to get the android-sdk-linux_x86 folder. Put the folder in a place you want to put, for example I put it directly on the desktop (/root/desktop/android-sdk-linux_x86 ).
This requires running some code to obtain some commonly used tools, such as ADB, as follows:

  1. CD/root/desktop/android-sdk-linux_x86
  2. CD tools
  3. ./Android

Copy code

A window is opened to select required packages, such as SDK tools and SDK platform-tools. If the network is good, the download speed will be faster.

After the configuration is complete, change the global variable. The Code is as follows:

  1. Gedit ~ /. Bashrc

Copy code

After opening, add:
# Set path for Android SDK tools
Export Path = $ path:/root/desktop/android-sdk-linux_x86/tools/
Export Path = $ path:/root/desktop/android-sdk-linux_x86/platform-tools/
The following folders are similar, so you can use the SDK tool on the terminal.

Detect, connect to your phone, code:

  1. ADB Devices

Copy code

If a string of numbers and serial numbers are displayed, the SDK is successfully installed.

Software Installation
The source of step 1 configuration has an effect here. The following lists the commonly used software to be installed:
• Git-core
• GnuPG
• Flex
• Bison
• Gperf
• Libsdl-Dev
Libesd0-dev
• Libwxgtk2.6-Dev
• Build-essential
• Zip
• Curl
Libncurses5-dev
Zlib1g-dev
• Valgrind
Libreadline5-dev

In the first example, the code is as follows:
I. Create a folder in the main directory to store the source code.
Code:

  1. Apt-Get install Git-core

Copy code

Then, when the screen is in English, you will be asked to select y/N, enter y, and the installation is complete.
Other software is similar.

Source Code Synchronization
Code:

  1. Cd ~
  2. Mkdir Bin
  3. Gedit ~ /. Bashrc

Copy code

After opening, add at the end:
Export Path = $ path :~ /Bin
Save and exit.
Continue the code after it is finished:

  1. Curl http://android.git.kernel.org/repo> ~ /Bin/Repo
  2. Chmod A + x ~ /Bin/Repo
  3. Cd ~
  4. Mkdir cm
  5. CD cm

Copy code

(Create a CM folder in the main directory to store the source code of cm7)

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

Copy code

After the preceding command is completed, the process is relatively short. After the command is completed, you will be asked to fill in the name and email address, and it will be OK.

Then start synchronizing the source code.
Create a file do. Sh In the CM folder.
Edit it in text and copy the following code:

  1. #! /Bin/sh
  2. Repo sync-j16
  3. While [$? -Ne 0]
  4. Do
  5. Repo sync-j16
  6. Done

Copy code

(The above 16 indicates that several threads are executed at the same time. Generally, the download has a peak value, which is too big and ineffective)
After saving, continue to write code on the terminal:

  1. Cd ~
  2. CD cm
  3. ./Do. Sh

Copy code

When the terminal starts to beat, the synchronization starts (this file can be executed repeatedly, that is, the computer is shut down (or the terminal is closed). After the terminal is restarted (the terminal is turned on ), if you execute the command again, you can continue the download without worrying about repeated downloads.

This is basically the case. If you have any questions, you can reply directly.

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.