Share Tweet Share





My wife recently got a new phone which left the Nexus 4 she had been using previously up for grabs. I had been itching to give Sailfish OS a try on a piece of modern hardware for some time now so I took this as an opportunity to load it up on the now extra phone.

What I found when I searched around was that there did not appear to be a concise guide for what exactly you need to do to load Sailfish OS up on the Nexus 4. Existing guides like this thread had all the relevant pieces listed, but they left many of the exercises to the reader. Meaning if you have not rooted or flashed custom things to an Android device before you are going to be fairly lost.

Today’s post is going to be a “quick and dirty” of how to take a Nexus 4 in any state and get it to a functional boot of Sailfish OS. Please note that following this tutorial will wipe out all existing data on your Nexus 4. This guide assumes you are running an Ubuntu 14.04+ based Linux distribution (however many of its steps can easily be applied on any operating system with minor alteration).

Step 1 – Install Android Tools

Open your terminal emulator of choice and run:

sudo apt-get install android-tools*



Step 2 – Flash Android 4.2.2 onto your Nexus

In order to properly boot Sailfish OS you need Android 4.2.2 installed as your primary OS on your device. Download the 4.2.2 archive from here and extract its contents to your home folder. Boot your Nexus 4 to the bootloader (this is done by fully powering off the device and then turning it back on while holding the volume down button) and attach it to your computer.

Then open your terminal emulator of choice and run:

cd occam-jdq39

sudo sh flash-all.sh



This till take a few moments while your Nexus is flashed with a fresh install of Android 4.2.2



Step 3 – Rooting your Nexus

Next we need to root our Nexus 4. Download the CF-Auto-Root archive from here and extract it to your home folder. Boot your Nexus 4 to the bootloader and attach it to your computer. Then open your terminal emulator of choice and run:

sudo sh root-linux.sh

Your Nexus will reboot as it completes the rooting process.



Step 4 – Install Android Packages

Boot your device into Android 4.2.2, sign in, and get connected to the internet. We then need to install the following pieces of software in order:

SuperSU

BusyBox – After installing from the Play store you need to launch BusyBox and hit the “Install” button at the bottom

TWRP – After installing from the Play store you need to launch TWRP and select the “Install TWRP” option from the left side menu

MultiROM – After installing from the Play store you need to launch MultiROM and select “Install” from the main screen



After MultiROM finishes installing, the Nexus should reboot and complete the integration with TWRP.



Step 5 – Get CM10.1.3 and Sailfish OS Zip Files

Sailfish OS needs some of the bits out of CM10.1.3 to fully function on the hardware. Download the latest CM10.1.3 archive from here. Next download the latest Sailfish OS zip from here (as of right now that is the beta4 file called sailfishos-mako-release-1.1.2.16-beta4-201503190842.zip).

Move both of these zip archives to your Nexus 4.



Step 6 – Loading Sailfish OS into Multirom

Boot your Nexus 4 to the bootloader. Press the volume down key until the words “Recovery Mode” are at the top of the screen – then tap the power button.

In the TWRP screen that appears press the following in order:

“Advanced” in the lower left hand corner of the screen

“MultiROM” in the lower right hand corner of the screen

“Add ROM” in the upper left hand corner of the screen

“SailfishOS” radio button in the upper right hand corner of the screen

“Next” button in the bottom center of the screen

“CyanogenMOD ZIP file” in the middle of the screen – Select the CM10.1.3 zip file you downloaded in Step 5

“Rootfs ZIP file” in the middle of the screen – Select the Sailfish OS zip file you downloaded in Step 5

“Install” in the bottom center of the screen



Step 7 – Booting Sailfish OS

Once the install in Step 6 finishes, restart your Nexus 4. When the MultiROM menu comes up, stop it from automatically booting into Android by pressing “Cancel”. Double tap on the Sailfish OS entry which should be the second one in the menu.

Wait a few moments while Sailfish OS boots and enjoy!



Wrapping Up

Sailfish OS gives you a quick run down of how to use the operating system when you first log in, but you will likely also find the Jolla User Guide useful (although not 100% will apply to Sailfish OS on the Nexus 4, most of it is applicable).

At this point the Nexus 4 port is fairly mature. Most all of the hardware works under Sailfish OS and you can find the full hardware status on the Nexus 4 row of the table here.

Hopefully this will save you from some of the headaches I went through getting Sailfish OS loaded onto the Nexus 4 the first time I tried it. Have any questions drop them in a comment below and I will do my best to help out.

Cheers,

~Jeff Hoogland