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
- 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
- Curl http://android.git.kernel.org/repo> ~ /Bin/Repo
- Chmod A + x ~ /Bin/Repo
Download cyanogenmod source code with the downloaded Repo
Java code
- Repo init-u git: // github.com/cyanogenmod/android.git-B gingerbread
- 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
- Cd ~ /Cyanogenmod/device/Samsung/Crespo
- /Extract-files.sh
Then
Java code
- Cd ~ /Cyanogenmod/vendor/cyanogen
- ./Get-rommanager
Java code
- ./Extract-Google-Files
5. Copy an object with the same name.
Java code
- 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
- . Build/envsetup. Sh
- Or
- Source build/envsetup. Sh
7. Click "lunch" and select the version you want to compile.
Java code
- Lunch cyanogen_crespo-eng
- Or
- Lunch
- This will show options, select the option you want to compile
8. Start Compilation
Java code
- Make-J4 cyanogen_with_google = true otapackage
9. Execute
Java code
- ./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
- ADB reboot bootloader
- ./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:
- CD ..
- CD usr/lib
- Mkdir JVM
- CD JVM
- Mkdir Java
- CD Java
Copy code
(Then copy the file jdk-6u24-linux-i586.bin in .)
- Chmod U + x jdk-6u24-linux-i586.bin
- /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:
- 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:
- 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:
- CD/root/desktop/android-sdk-linux_x86
- CD tools
- ./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:
- 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:
- 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:
- 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:
- Cd ~
- Mkdir Bin
- Gedit ~ /. Bashrc
Copy code
After opening, add at the end:
Export Path = $ path :~ /Bin
Save and exit.
Continue the code after it is finished:
- Curl http://android.git.kernel.org/repo> ~ /Bin/Repo
- Chmod A + x ~ /Bin/Repo
- Cd ~
- Mkdir cm
- CD cm
Copy code
(Create a CM folder in the main directory to store the source code of cm7)
- 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:
- #! /Bin/sh
- Repo sync-j16
- While [$? -Ne 0]
- Do
- Repo sync-j16
- 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:
- Cd ~
- CD cm
- ./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.