Flashing CyanogenMod onto Galaxy SII via Ubuntu

Pre-Requsites

Install Heimdall

Visit the Heimdall home page, select “Linux”, and download the package for your distribution.  On Ubuntu variants you want the latest ‘.deb’ package.  e.g.:

ubuntu13.04-heimdall_1.4.0-0_amd64.deb

Note that the “Frontend” packages are not required.  Everything can be done easily from the command line.

Install Heimdall using dpkg:

sudo dpkg -i ubuntu13.04-heimdall_1.4.0-0_amd64.deb

Install adb

Install adb from the Ubuntu repositories:

sudo apt-get install android-tools-adb

sudo apt-get install android-tools-fastboot

Download ClockworkMod Recovery

Download ClockWordMod Recovery for the Galaxy SII (i9100).  I got it from here.

Download CyanogenMod

Download a compatible version of CyanogenMod for your handset.  You can get it here.

My personal preference is to stick with CM11 (Android 4.x) on the Galaxy SII.  CM12 (Android 5.x) is available too but it’s an old handset now so you need to consider if it’s ideally suited to the newer versions of Android.  CM11 runs really fast on it, so I prefer that.

Download GAPPS

Normally the best place to get GAPPS (Google Applications; Play Store etc) is via OpenGAPPS.  But in my experience the packages provided by OpenGapps are too large for the Galaxy SII.  If you took my advice to install CM11, then you need GAPPS version gapps-kk-20140105-signed.zip, provided here.  This one is small enough to install successfully.

Flash Custom Recovery onto the Galaxy SII

With the handset turned OFF, place it into “Download Mode” by holding VOLUME-DOWN, HOME & POWER.
You should see a screen which looks like this:

IMG_20160717_092817

Press ‘VOLUME-UP’ to confirm and then you should see the Download Mode screen:

IMG_20160717_092840

Connect the handset to your computer via USB.

Now, on your computer, browse to the location where you downloaded the CWM package (see Pr-Requisites section).  Extract it.  It should come out as a filename called “zImage”.  If what you get is named something a bit different don’t worry, just take account for that in the terminal command you’re going to enter next…

Open a terminal and ‘cd’ to the directory where the CWM package was extracted.  Then enter the following command:

sudo heimdall flash --KERNEL zImage --no-reboot

You should see a blue transfer bar appear on the handset download screen.  The transfer is complete when the blue bar has filled, as shown in the photo below.

Downloading

IMPORTANT – Boot into Recovery Next

This next bit is a little important; you need to boot into the custom recovery you just installed next, before you do anything else.  If you don’t, the stock recovery might overwrite CWM.  The consequences of this are minimal; you’ll just have to start again! But to avoid this, boot into recovery as follows:

  • Disconnect your USB cable from the handset.
  • Turn the handset OFF by holding the POWER button.
  • Boot into CWM by holding VOLUME-UP, HOME & POWER.

You should see a screen like this:

IMG_20160717_095032

  • Now, using the VOLUME buttons select “wipe data/factory reset”
  • Press POWER to enter.
  • Select “Yes – Wipe all factory user data”
  • Press POWER to enter.

If factory wipe is successful you will be returned to the main menu.

Flash CyanogenMod

Now for the cool bits.  Connect your handset back to the computer via USB.
Open a terminal and ‘cd’ to the location where you downloaded the CyanogenMod zip file.  Don’t extract the zip! We’re going to transfer it as-is to the handset and then the handset will extract it and install.

At the handset, use the VOLUME buttons to select “install zip” and then press POWER to enter.
Select “install zip from sideload” and select.

At the handset you should see a message confirming that sideload has started.  Using adb, you need to transfer the CyanogenMod zip file using a terminal command as follows:

adb sideload cm-11-20141115-SNAPSHOT-M12-i9100.zip

Adjust the command to suit the filename of the ClockworkMod you downloaded.

You should see some information in the terminal to confirm that the file is being transferred.  When it’s done, the handset will attempt to install the update, and you’ll see a screen similar to below.

IMG_20160717_095948

Unfortunately you don’t get any obvious confirmation that it completed at the handset.  But one way to tell is to try the menu selection; if you have control of the menu using the VOLUME keys, it has finished.

Install GAPPS

This next bit is optional (maybe you don’t want any standard Google Apps on the handset) but without it you won’t be able to use the Play Store.

Using the same method as you used to transfer and flash CyanogenMod, ‘cd’ to the location where you downloaded the GAPPS package (see Pr-Requisites) and then enter the zip sideload function on the handset.  When ready, use adb to transfer and install GAPPS:

adb sideload gapps-kk-20140105-signed.zip

If the process fails you’ll be informed about it.  Otherwise, if you haven’t been shown any errors on the handset and you have control of the menu, it’s finished.

DONE! Reboot

That’s it! You’re done.  Use the menu to select “Reboot” and enjoy CyanogenMod on the Galaxy SII.
Note that boot-up will take longer the first time as the handset will install and set itself up.

 

 

Brian Hoskins is a 35 year old Electronic Engineer from South Wales in the United Kingdom. He is passionate about Electronics Design, Computing, Programming and Science in general. He works as a Test Development Engineer at an automotive electronics company in South Wales and also carries out electronics design work on personal projects in his spare time. Brian has a BSc with honours in electronics engineering and is a member of the Institution of Engineering & Technology.

This entry was posted in Android, Blog, Computing and tagged , , . Bookmark the permalink.