(Rooting/Unlocking) Android on GNU/Linux Quick Guide (Specfically, Nexus 4 on Debian)

For Debian-based systems, you may need to apt-get / aptitude install “android-tools-adb” and “android-tools-fastboot” or perhaps the whole package “android-tools”. If you cannot find in your repositories, google android-tools. For more recent distros on 64-bit, the package “lib32ncurses5” may need to be installed for adb to work (also, you may want to add this to your /home/user/.bashrc file –> “export PATH=${PATH}:/home/user/Android/android-sdk-linux/platform-tools” (see this link)).

I currently use CyanogenMod (CM) 10.2 Nightlies w/ Franco Kernel on my rooted LG Google Nexus 4 and Debian Sid GNU/Linux on my ThinkPenguin Royal Penguin. Quick note: apparently, if you update your CM ROM, you will have to reflash the kernel (or perhaps it is just easier to zip the kernel image and reinstall from Recovery mode each time instead of fastbooting from your laptop each time you upgrade, which is potentially every night for Nightlies – UPDATE 2013 Sept 16: but this has not worked for me, and CM 10.2 requires the JSS img, so Franco Kernel updater does not work, so it seems one still use a computer). I forgot about that and was wondering why my battery life was not as good after I updated and why I couldn’t undervolt.

But look at the forums. Undervolting does not really help you improve battery life. But its benefit is lowering temperatures for your phone/battery, which is not a bad thing at all! For the Nexus 4, MakeUseOf has an article on heating problems and a simple hack for the curious/bold. (For a random link on how to conserve batteries, see this site. It was written for the Nexus 4, but I am sure this applies to most Android phones.)

Note: Undervolting requires rooting (through ClockWorkMod Recovery, mentioned in the links above) and then giving root access to an app that can undervolt, such as “Trickster MOD kernel settings” or “Incredi Control.” I am told the Franco Kernel already undervolts for you (? –> for Nexus 4, lower limit is @700mV (150mV under default Kernel settings…) I prefer 725 mV as sometimes my apps stop a bit more often at 700mV), and also depending on your CPU (if you are have the faster bin CPU, lucky you. It is the best CPU on Nexus 4 and is already undervolted?). See this link to see how fast your CPU is. If you want to be safe, don’t set your undervolting settings on boot. But you will have to remember to re-undervolt each time you reboot.

Do not forget to install Google Apps if you still want Gmail, Google Maps, Play Store (Android Market), etc. in your custom CM rom (CM 10.2 is built off AOSP/Android Jelly Bean 4.3).

From factory settings, the quick order to do all this is (essentially following CM’s own instructions):

  1. Make sure you turn on developer options (Settings –> About Phone –> Tap “Build Number” 7 times to become a developer and turn on developer options) and enable USB debugging.
  2. Install ADB and fastboot (or android-tools). [For Micro$oft Windows, you may need to install your phone drivers, LG’s mako drivers in this case…]
  3. Unlock the phone’s bootloader (simply enter fastboot mode and unlock phone. Find directions for your supported device on CM’s own website –> this is why the Nexus is awesome…easy to unlock). May void warranty, but whatever.
  4. Root the phone by installing ClockWorkMod‘s recovery.
  5. Wipe Data/Factory Reset (not doing so may have you stuck in the CM boot screen –> this is why if you have USB debugging on, then you can still get yourself out of it by “adb reboot bootloader“).
  6. Upload and install CM’s custom rom. (Unofficial ports are also available.)
  7. Upload and install a custom kernel and corresponding Google Apps. (I find it easiest to upload the .zip files and install in recovery mode. Update 2013-09-12: for some reason, compressing the kernel img into a zip file doesn’t work for installing in recovery mode. So I have to fastboot it each time I update…)

Did I miss anything? Comment below.

UPDATE (2013 Oct 4): Currently, because of some kind of code changing, CM10.2 Nightlies will not work with the latest Franco Kernel beyond 20131001’s nightly build. The color scheme for the screen and other stuff goes bonkers. So I will for the time being remain on CM10.2.20131001 and Franco Kernel latest JSS.

Advertisements

One thought on “(Rooting/Unlocking) Android on GNU/Linux Quick Guide (Specfically, Nexus 4 on Debian)

  1. Pingback: How to Backup ClockWorkMod Recovery (CWMR) to Linux Computer | Home of Uninterpreted Facts

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s