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 https://dl-ssl.google.com/dl/googlesource/git-repo/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.