Skip to content

Building CyanogenMod

mingyuan-xia edited this page Dec 18, 2014 · 1 revision

Overview

  • I need to mention that I am building CyanogenMod for Samsung Galaxy S (code name "maguro") on Windows.
  • I am building both CM10 (jellybean 4.1.x) and CM10.1(4.2.x).

Flash a pre-built ROM

I would suggest to first flash a stable CM10 rom to get the basics about how to flash new ROMs.

  • Although the tutorial starts with the recovery ROM, I would suggest to first download the stable CM10 ROM and adb push to /sdcard/.
  • Then letz flash the recovery ROM.
    • Specifically, for maguro, press DOWN+UP+POWER to enter bootloader.
    • When the maguro is in bootloader, type "fastboot devices" on PC to check if the PC sees the phone.
    • If not, try 1. run cmd as admin and then run fast boot commands (as mentioned by the tutorial) 2. install this fastboot driver
    • Ok, then flash the recovery ROM using fastboot. Use UP & DOWN to select "RECOVERY" and press POWER. DO NOT RESTART the phone, otherwise the stock recovery will be back (you will see Android lying down with a red triangle). If you see it, never mind, use fastboot to flash again, then select recovery and go!
  • Ok backup and flash the main ROM from sdcard, as the tutorial has told you.
  • Boot, if everything goes well. You should see~~
  • REMEMBER to factory reset the phone first and then flash the main ROM!! I forgot the first step and bogged for half day!

Then build it!

Follow the tutorial! The CyanogenMod build guide is concise and informative.

Common troubleshooting:

  • "repo sync" exits with "GC error". Dont worry, everything sync-ed before the error will be preserved. Use "repo sync -j1" to use only one thread again. In almost all cases, this will not give the same error (although a little bit slow).
  • "breakfast maguro" complains with some HTTP connection when fetching maguro rom Github. First check that your repo is in PATH. Then do "breakfast" and "repo sync -j1" repeatedly. Actually "breakfast" will detect that maguro is not there then tries to "repo sync". The error popups when network has some problem. But at that time, the repo already knows what to fetch. You just need to "repo sync -j1" to let it retrieve. A little slow though, as I fetched almost 1.2G for the maguro target.
  • also if you see the python script complains when "breakfast maguro". It is probably breakfast tries to fetch more file. As I have inspected the tool chain source code, this is completed by first retrieve a list of repo on github. But this procedure is limited by the server side. That is to say, if you are greedy retrieving more than one projects (just like what I am doing), the server will ask you to slow down~~ You can take a look at this url to see if you are over-speeding. If it is like:
{
    "message": "API Rate Limit Exceeded for "
}

Then take a coffee. Dont work too hard.

  • "./extract_files" fails due to "adb does not find device, permission, etc". Sudo adb kill-server and then sudo adb start-server
  • Cannot find a weried tool called '''schedtool'''? schedtool_amd64

Useful rpms

  • optipng, pngcrush, schedtool