Install Sailfish OS on your smartphone (using the Nexus 5 as an example)

  • Tutorial
SailfishOS on nexus5 Moto g2

In this article I will tell you how to install Sailfish OS on my smartphone and all the details of this process.

I had the very first phone from Jollaand I quite liked him. But time did not spare him: his SIM card slot broke and he turned into an offline smartphone. For some time I used Android, but I want to go back and I started looking in the direction of unofficial firmware. The first Jolla phone is morally obsolete today, it has a disgusting camera, iron is no longer relevant and the screen has a small resolution. My Moto G 2 phone was lying around, on which I tried to install SFOS, but it was not quite ready (the camera did not work, Bluetooth partially worked, there is no video playback and many other shortcomings) and its Polish author somehow was in no hurry to finish it. So I sat for several weeks on eBay and found a used Nexus 5 phone for experimentation. Today I will try to describe all the pitfalls of the process of installing SailfishOS on an Android smartphone.

In this article:
  1. A bit about ports
  2. Unlock bootloader
  3. We put our loader MultiROM
  4. We put CyanogenMod (CM) and SailfishOS (SFOS)
  5. Upgrading to SFOS 2 (optional)
  6. How to install applications?
  7. TOP 10 programs for a beginner

A bit about ports


So, unofficial firmware ported to various devices by enthusiasts (hereinafter referred to as the " port ") exists for different phone models. But how do they differ from the official? First, you must understand. that they are written by ordinary people, such as you and I. And this means that most likely something may not work, something may not be available, something may break with the arrival of updates. Also, all support depends entirely on the authors of the firmware and Jolla itself does not, by and large, have any relation to this. Secondly, the eternal problem with iron. Ports are put on top of CyanogenMod, so as not to write drivers from scratch, but still, not everything works correctly. Also, the CM itself consumes a lot of battery power: if the first Yolla lived with me for four days from one charge, the Nexus already draws a maximum of one and a half or two.

So where do you start? To get started, take a look at the matrix of ready-made ports at:

wiki.merproject.org/wiki/Adaptations/libhybris

There you can see for which phones their ports are already written, what their status and which versions are available. Thanks to the activity table, I decided to take Nexus 5 for experiments, because for it the firmware is one of the most stable. Be sure to check the list of what has already been done in the port for your smartphone, and what functionality does not work yet. Installation instructions are usually the same, but often there are some additional steps specific to a particular version of the smartphone. Here's an example of instructions for a nexus .

But if you are strong-willed, ready to roll up your sleeves and independently make your port to any smartphone model, then here's a start for instructions , and there is also support in the official chat. There are very friendly employees of Yolla who are happy to help with advice.

Well, if you are mentally prepared, then you can start. Check that you have the Android SDK on your computer (we will need the adb and fastboot utilities ).

Unlock bootloader


I first tried using the native bootloader for MotoG2, but that turned out to be a bad idea. There is a good time-tested MultiROM , which, in addition, allows you to install several OSes, if you wish. In order to install it, you must first unlock the native bootloader that comes with the smartphone. We connect our (still Android) phone to the computer, enter the Developer Mode, enable debug via USB and write in the command line:

   $ adb reboot bootloader


When the phone boots into fastboot mode, you first need to make sure that your computer still sees the connected phone:

   $ adb devices


and, in fact, unlock the bootloader:

   $ sudo fastboot oem unlock


The device itself will show a warning message with which you must agree (but remember that you will lose the guarantee!).



We put our loader MultiROM


First, go to twrp.me and download the latest version of the bootloader for your phone (for example, for the Nexus here ). Then from the command line we write:

    $ sudo fastboot flash recovery ~/Downloads/twrp-3.0.2-0-hammerhead.img 
    target reported max download size of 1073741824 bytes
    sending 'recovery' (14524 KB)...
    OKAY [  0.665s]
    writing 'recovery'...
    OKAY [  1.129s]
    finished. total time: 1.794s

We put CyanogenMod (CM) and SFOS


Before you begin the installation, you need to download images of OSes. Download CM11 snapshot (11 is important, since the port is written for this version). For the Nexus, I took this image . Well, of course, download the port itself for your phone. The link usually lies on the wiki or on the forum. For the Nexus, this is such an image . We upload both files to the phone.

    $ adb push ~/Downloads/cm-11-20141008-SNAPSHOT-M11-hammerhead.zip /sdcard/
    6565 KB/s (373041464 bytes in 55.489s)
    $ adb push ~/Downloads/sailfishos-hammerhead-release-1.1.9.28-beta0-201510022255.zip /sdcard/
    6555 KB/s (348973612 bytes in 51.983s)


A small remark for Nexus5
at the time of writing, the video was broken in the latest version. The author suggests downloading the latest snapshot, which is more stable, but is still in testing. His instructions and links to assembly images can be found here . But this advice may quickly become obsolete in the future. Check the official documentation.


Now you can boot into Recovery Mode to enter the bootloader. We need to do three things here: clean the phone, install SM, install SFOS. Turn off the phone, then hold down the volume keys, turn it on and enter the boot menu.



Select Recovery Mode and go to the MultiROM bootloader.

Next, go to Wipe and erase everything except Internal Storage .



Then we go to Install , find SM and install it. ( unfortunately, in the photo I have the wrong image of CM13, but I need CM11 )



and, finally, install SailfishOS in the same way.



At the end, we reboot the phone and after that it should already boot with a completely different smartphone. The very first boot of the system can take quite a while, so do not worry, this is normal. It took me about five minutes.

We update the OS version to 2.0


This step is needed only for the Nexus, because its port is based on the old version of SailfishOS, but for other phones this can be a useful approach. For this procedure, we need to configure updates “over the air”. To do this, good people wrote a small script that we need to run.

We connect to the phone via SSH

Since SailfishOS is primarily Linux, the console is available to us initially. And also an SSH server to which we can connect. The console can be opened on the smartphone itself, it is available to you by default, but poking a finger on the phone screen is not very convenient. This option is more likely for emergency situations when there is no laptop at hand.



The second option is to connect to the phone from the computer via SSH, which is much more convenient. This helps a lot in everyday work, since we can do a lot of operations from a computer using a normal human keyboard and mouse.
So, for starters, we need to connect to WiFi. Then open Settings> Development mode, where you can set your root password, and see the ready-made IP address, which you can connect to inside your grid:



We go under the user nemo at the specified IP address.



Next, somewhere on the phone we create a shell script with this content .

ready update.sh script
RELEASE=2.0.1.11
devel-su sed -i -e 's#^adaptation=.*$#adaptation=http://repo.merproject.org/obs/nemo:/testing:/hw:/lge:/hammerhead/sailfish_latest_armv7hl/#' \
/usr/share/ssu/repos.ini
ssu dr adaptation0
ssu release $RELEASE
ssu dr extra
ssu dr mw
ssu ar mw http://repo.merproject.org/obs/home:/RealJohnGalt:/testing:/common/sailfish_latest_armv7hl/
ssu er mw
ssu ar dhd http://repo.merproject.org/obs/nemo:/testing:/hw:/lge:/hammerhead/sailfish_latest_armv7hl/
ssu lr
# ^ double-triple check that no -two- enabled repos point to the same URL
# You may have many of OpenRepos enabled. It's recommended to disable them, even
# though version --dup will do its best-effort to isolate repositories:
ssu lr | grep openrepos
devel-su zypper clean -a
devel-su zypper ref -f
version --dup
# if above fails, try again
version --dup
sync
reboot



We give him the rights and run. We wait. Reboot. Enjoy the latest version of SailfishOS 2.0.

How to install applications?


Ok, now we have a bare phone in our hands and our hands itch to put a bunch of software on it. Let's learn how to do it. We have four ways.

1. Jolla Store

Official store. There’s nothing much to describe here: go in, click "install", that's it. One thing I can add is that the Jolla Store may not be available on some ports.



2) Warehouse

As with any Linux distribution, programs can be installed from various sources (repositories). You just need to add the desired repository and all packages from it will be available for installation. Therefore, there is the most important analogue of the official app store - openrepos.net site . He has a small phone app called Warehouse.

image

It looks very simple:



The easiest way to install it is to go to the website from your phone’s browser , download rpmpackage and install it by tapping on the downloaded file (all downloads can be viewed in Settings> Transfers; on a bare system, most likely you will need to allow the installation of programs from questionable sources, this function can be enabled in Settings> Untrusted Software).



If you look at any application from this store, first you will find the “Enable repository” button, and adding the author’s repository to your phone, the “Install” button will be available for you. So you can install any application from openrepos.net





3) RPM

As you already noticed in the previous step, the program or package can be installed either from the browser (allowing the installation from untrusted sources, as described above), or directly from the console. The previous step of installing Warehouse through the console might look like this:

curl -o warehouse.rpm https://openrepos.net/sites/default/files/packages/1/harbour-warehouse-0.3-22.armv7hl.rpm
devel-su rpm -i warehouse.rpm


4) pkcon, zypper

Well, let's take a closer look at the “manual” management of your repositories. In order to manage them, the ssu command is available to you .

List of installed ssu lr repositories :



In the same way, temporarily deactivate some repository:
   ssu dr home


Add new repository:
   ssu addrepo ...


You can install programs using pkcon or zypper . Let's install, say, gPodder (an application for podcasts).

First, add the repository sailfish.openrepos.net/thp/personal-main.repo (found on the author’s page ):

    [nemo@Nexus5 ~]$ ssu addrepo openrepos-thp https://sailfish.openrepos.net/thp/personal/main
    [nemo@Nexus5 ~]$ devel-su pkcon refresh
    Password: 
          ....                         
    Refreshing software list


Then we find the name of the package. Well, actually, install the program itself using zypper:

[nemo@Nexus5 ~]$ zypper search gpodder
Loading repository data...
Reading installed packages...

S | Name                         | Summary                      | Type
--+------------------------------+------------------------------+--------
  | harbour-org.gpodder.sailfish | Media and podcast aggregator | package




    [nemo@Nexus5 ~]$ devel-su zypper install harbour-org.gpodder.sailfish
    Password: 
    Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    The following NEW packages are going to be installed:
      harbour-org.gpodder.sailfish libpython3_4m1_0 libsailfishapp-launcher pyotherside-qml-plugin-python3-qt5 python3-base 
    5 new packages to install.
    Overall download size: 8.6 MiB. After the operation, additional 34.0 MiB will be used.
    Continue? [y/n/?] (y): y
    ....длинный список установленных пакетов....


As you can see, everything looks pretty familiar to everyone who is a little familiar with Linux. Say, if you want to install regular python this time using the pkcon command , then your command will be as follows:

    [nemo@Nexus5 ~]$ devel-su pkcon install python
    Password: 
    ....                                                                                                                                                                                                         
    Installing packages                                                                                                                                 [=========================================================================]        
    The following packages have to be installed:
     gdbm-1.8.3-1.1.4.armv7hl   GNU Database Routines
     python-2.7.9-1.4.1.armv7hl An interpreted, interactive, object-oriented programming language
     python-libs-2.7.9-1.4.1.armv7hl    Runtime libraries for Python
    Proceed with changes? [N/y] y
    ....

In some ports, the default word substitution is not installed on the keyboard. It will not be superfluous to add it.

    [nemo@Nexus5 ~]$ devel-su pkcon install jolla-xt9 jolla-xt9-cp

Top 10 programs for beginners


It is understood that this article is intended for those who do not have experience with SFOS, so I will simply list the most interesting (exclusively in my personal opinion) programs that need to be set up in the first place.

image
1) Lighthouse .
A very convenient viewer of current processes, it also shows the load on the CPU in real time, the use of memory and other phone resources. It helps when you need to nail a couple of processes or just see what processes you are running in the background.

image
2) Meecast .
The program just shows the weather. The fact is that this program (deservedly!) Has been in the top of installations for a long time in the official Jolla application store. In addition to her, in the top are only programs from Yolla herself, which come with the phone itself. She can only show the weather, but she does it very beautifully. And, in terms of support, this program is a long-liver. The authors are sending different updates so far.

image
3) gPodder
App for podcasts. The program has been ported from the legendary Maemo. Imperfect, but the best that is at the moment.

image
4) Sailogram
Client for Telegram. It’s quite an excellent application, I use it myself every day. Most native Telegram functionality is supported.

image
5) OwnKeepass
Client for KeePassX password manager. It is very convenient to keep the password database somewhere in the cloud, the key to it is offline, and the password is in your head. Supports both versions of KeepassX, easy to use.

image
6) FileCase
File manager. It also supports work with cloud storage, such as Dropbox. The irreplaceable assistant in any phone.

image
7) Situations
The program passed to us from Meego. An automatic mode switch depending on some conditions (time, location, available networks), or, as the author calls it, “situations”. Let's say at night you want to activate a quiet profile (turn off the network and sound) from 24-00 to 7-00. When a Wi-Fi grid with the name Work is available, then you are at work and you need to activate the Work profile (connect to the grid and make the sound quieter). If the battery charge remains below 10%, the power saving mode is activated. Well and so on.

image
8) Tweetian
The legendary twitter client who came to us from the world of Miigo and Symbian.

9) Cards
With cards in SFOS, not everything is so fabulous and beautiful as on Android. All maps are based on Open Street Maps or HERE. Here, let’s say, the main card from Yolla, which is quite simply called Maps, is based on HERE and is installed on all Jolla phones.


You can install it yourself with the command:
devel-su pkcon install sailfish-maps


But there are other options from the community. The most famous of them is Poor Maps.

image
Poor maps

It is also based on Open Street Maps and can be more or less used.

image
10) Codereader
A simple barcode reader.

That's all. Thank you for reading to the end. And, as always, have a good swim!

Also popular now: