Active Topics

 


Reply
Thread Tools
edp17's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#1
Code:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!                                           !!
!!Although I am using this on my backup phone!!
!!                                           !!
!!     IT IS NOT SUITABLE FOR DAILY DRIVE    !!
!!       ONLY FOR EXPERIMENTAL PURPOSES      !!
!!                                           !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Making this port was challenging because Sailfish OS (since release 3) doesn't support kernel version 3.0 which is apparently the kernel on the S2.
Fortunately, the SailfishOS-porter guys do very seriously know their business and they are extremely helpful.
From here I would like to emphasize my gratitude towards them for helping me in this project! Thank you!

Requirements:
Before you start to download anything, please read it carefully.
The first requirement is your device must be rooted and you should be able to install a custom recovery (preferably TWRP) onto it.

For this ROM you can either use the stock partitions or you can re-partition to give more space to /system and /data. It doesn't matter which one you chose, I tried and both worked well.
Or if you scroll down to the New partition layout, you can use a completely unique partition layout which gives the most of the internal storage to Sailfish OS. (I currently use my device with this setup.)

Installation instructions:
1. Download all files, CM12.1 zip, Sailfish OS zip, twrp2.8.7.img and kernel*.img to the external SD card on the phone
2. Reboot into TWRP (Hold buttons: Power on + Home + Volume up)
3. Do a factory reset
At this point if you want you can repartition the S2 internal storage. (Later you can put the stock layout back if you want to go back to Android.)
The steps for repartitioning are:
  • Download the 'Repartition: System=1GB, Data=14GB, eMMC=8MB, /preload=7MB' or the 'Repartition: System=1GB, Data=4GB, eMMC=7GB, /preload=0.5GB' .zip file and put into the external SD card. (The difference between these two is explained down at the New partition layout section
  • Then boot into TWRP and flash the zip as any other zip file. The script first will warn you that it cannot do the partitioning with mounted partitions and it also copies the script itself into /tmp. You just simply need to flash the copied version from /tmp and that will do the trick. The script will format the new partitions accordingly, so once it is completed you can go ahead with the next step.

4. Still in recovery, flash the CM12.1 image
5. Still in recovery, flash Sailfish Os image
6. Still in recovery, flash twrp2.8.7.img to recovery partition
7. Still in recovery, flash kernel*.img to boot partition (this step is not required since sfos 4.4, kernel is installed by flashing the zip file)
8. Reboot
9. Enjoy the latest (4.4.0.68) Sailfish OS on your i9100.
You will need patience as the first boot will take for a while. Then you can go through the initial Sailfish OS set up.

This Sailfish OS Android HAL based on CM 12.1.


Downloads:

Some useful patches:
Apps from Openrepos
Apart from the Jolla store there are plenty of other, community made apps in Openrepos. There is a user-friendly app to install/remove apps from this source called Storeman. It can be downloaded and install from this location: Storeman

Debug/login/troubleshooting:
In Ubuntu, connect USB cable. telnet 192.168.2.15 2323 or SSH nemo@192.168.2.15.


Notes:
  • On Sailfish OS, as it is a Linux system, you cannot install/run any android apps.

How to make a backup/restore with TWRP:
Now the old clunky method is no longer needed. Once you flashed the twrp2.8.7.img to the recovery partition you can boot into TWRP with the usual button combination (Hold buttons: Power on + Home + Volume up) and can make backup/restore.

Instructions for bluetooth (Since Sfos 4.3, BT works normally, don't need this magic)

BT works however turning it on/off is not as user friendly as I hoped. Here is a little instruction/troubleshooting.
Turn BT on (It only works from Settings/Bluetooth!!!!! DON'T try from TOP MENU!!):
If BT hasn't turned on since last boot:
  1. go to Settings/Bluetooth
  2. tap on the dot next to the Bluetooth option

If BT has turned on at least once since last boot:
  1. go to Settings/Bluetooth and tap on the dot next to the Bluetooth option
  2. go back to Settings
  3. go to into Settings/Bluetooth again
  4. tap on the dot next to the Bluetooth option (if it is not turned on repeat from Step 2! Eventually, BT should turn on.)

Turning BT off: Go to Settings/Bluetooth and tap on the white dot next to the Bluetooth option.

Notice: Never try to tap on the white dot twice without going back to the main menu of Settings.
Never try to turn BT on from Top Menu.
However, if you accidentally did any of these BT cannot be turned on again unless you:
  • reboot the device (this is the easiest) or
  • in a command line as root issue the following command 'systemctl restart bluetooth-rfkill-event.service' (this will restart the bluetooth-rfkill-event service)
I am not sure how pairing works with different devices.

New partition layout

I mentioned that I tried this Sailfish OS installation with the stock partitions and with another what created for Android 7.1.2. With the stock partitions however was a bit more sluggish than the other one. No wonder as in the stock partitions the /system has only 0.5GB and the /data has only 2GB storage and the rest 12GB is the separate internal storage (eMMC). In Sailfish the entire os (rootfs) including all directories (like /home) live on the /data partition so the 2GB was a bit tight. (The OS itself consumes about 1GB so not much left for apps and other stuff.)

With the other partition layout, the picture was a bit better as the /system had 1GB, the /data got 4GB and the rest 9GB remained for the internal storage. But the partition where the OS lives was separated from the 9GB partition. When I installed a few apps and copied some big files into the /home, I felt the limitation very soon.

Although this layout was sufficient for android but not good enough for Sailfish.
Therefore I have created my own partition table where I restructured the sizes accordingly to my need. (The lanchon repit zip file is available in the download section.)

In this new layout I gave 1GB for the /system (the prior 0.5GB was also fine as the CM12.1 base consumed only 400MB which let a 100MB free space, but I thought that might be not enough in the future so I have chosen 1GB here), I gave only 8MB for the internal storage (eMMC which is mounted into /android directory in this rom), and this made me possible to gave all the rest 14GB to the /data partition. So basically the Sailfish apps and /home can utilize the entire internal storage.

As an extra, on the S2 there is a 0.5GB /preload partition which is hidden and unused by default. In my partition setup I set 7MB to this and the rest almost 0.5GB is also added to the /data.


Go back to stock partitions

In case you would like to do this, you can download the stock partition pit file from the download section.
For this use Odin v1.83 which is also in the download section.
The steps are:
  • Boot the device into download mode and connect to the PC.
  • Open Odin v1.83 and tick the 'Re-partition' checkbox at the Option.
  • Then click on the PIT button and select the downloaded stock pit file.
  • Then click on the PDA button and select the downloaded TWRP (AOSP kernel) file.
  • Then click on start.
  • Done. You need to boot into TWRP and wipe all partitions (system, data, emmc) then you can install the stock rom back. (or if you select the stock rom at PDA instead of the AOSP kernel, it will do the repartition and install the stock rom as well. In this case, you don't need to wipe anything and the device will reboot into the stock Android at the end.)

Changelog:

15.02.2022
=========
Sailfish OS 4.3.0.15 is available to download. This requires a different kernel. Both of these can be found in the download section above.
General advice: Patience! All (except camera) apps do start and work but they do need time. This is true for websites. When you clicked on something, wait patiently, eventually, it will start/load.
Know issue: The camera app crashes and the device reboots.
Improvement: Stock browser stable and works!

03.09.2021
=========
Sailfish OS 4.1.0.24 is available to download. This requires a different kernel. Both of these can be found in the download section above.

06.03.2021
=========
Sailfish OS 3.4.0.48 is available to download. This requires a different kernel. Both of these can be found in the download section above.

06.05.2020
=========
Sailfish OS 3.3.0.16 is available to download. This requires a different kernel. Both of these can be found in the download section above.
Note: With the new version the patch that displays the provider logo at the bottom on the lock screen stopped working. This issue is not related to the OS. The owner of the app should fix it.
Update: In Openrepos Kodi is fixed for SFOS 3.3.0.16!

14.05.2020
=========
Work:
  • Screen
  • Touch
  • IMEI number is detected
  • Sensors (GPS, Rotation, Acceleration, Gyroscope, Magnetometer, Light & Proximity)
  • Wifi
  • MTP
  • Bluetooth (instruction is above)
  • Calls incoming/outgoing
  • Messages incoming/outgoing
  • Mobile data ((to make it work: change Protocol to IP in Settings/Mobile network/Data access point))
  • External SD card detected and mounted to /run/media/nemo/_sdcard_name_ (where _sdcard_name_ is the name of the sd card when it was formatted like 7C97-785B)
  • Internal SD card is mounted to /android
  • Pixel ratio and icons set to 1.00 (Can be changed to 0.82 which is more appropriate for the device's screen. to do this as root run the 'kimmoli-diyicons.sh 0.82' command. It will fail to install imagemagick but will set the ratio to 0.82 and as we have all icons in place it will work.)
  • Audio is routed to headphone if that presents
  • Camera front/rear (only for taking pictures)
  • Jolla store
  • findutils is installed by default (updatedb and locate commands work out of the box)
  • Torch
  • the charging icon does work properly however there is a little delay
  • can boot into TWRP recovery with the usual button combination (hold buttons: Power on + Home + Volume up)
  • kernel and recovery .img can be flashed from TWRP (no need for PC to flash Sailfish OS, kernel and recovery)
  • Low Power Mode (AKA "sneak peek" or "ambient display") works (install instruction is in this post)
  • The softkeys (each side of the home button) work as notification leds

Do not work:
  • Video recording

There is an extra little issue is a delay in screen refresh which is related to how vsync is handled in v10 backend in qt5-qpa-hwcomposer-plugin. I managed to improve this but there is a little delay still. Probably this is the reason why we need to jump back to Settings every time before trying to turn BT on, but I am not sure.


Pictures:








Battery life:
In my experience the battery life is good. On standby, it can survive 10 days. (Almost 11.) I have checked once or twice daily during this period.

Last edited by edp17; 2022-10-20 at 10:27. Reason: 4.4.0.72 is available
 

The Following 14 Users Say Thank You to edp17 For This Useful Post:
Maemish's Avatar
Posts: 1,720 | Thanked: 4,765 times | Joined on Apr 2018 @ Helsinki, Finland.
#2
Nice! And good instructions!
__________________
"I don't know how but I can try!" (active)

Master of not knowing (active)

For me it is possible to get lost in any case (active)

Learning to fall from high (DONE)

Learning to code with BASIC (WIP)
 

The Following 6 Users Say Thank You to Maemish For This Useful Post:
Posts: 635 | Thanked: 1,535 times | Joined on Feb 2014 @ Germany
#3
Congrats, that you got it working!!!
 

The Following 4 Users Say Thank You to mautz For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#4
In case somebody missed these I would like to highlight some improvements since day 1:
  • Now both the kernel and twrp can be flashed as an .img from twrp (no need for PC and heimdall anymore)
  • Plus I uploaded a kernel with Flatpak support
 

The Following 5 Users Say Thank You to edp17 For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#5
Originally Posted by edp17 View Post
In case somebody missed these I would like to highlight some improvements since day 1:
  • Now both the kernel and twrp can be flashed as an .img from twrp (no need for PC and heimdall anymore)
  • Plus I uploaded a kernel with Flatpak support
With kernel07_flatpak, I have installed Flatpak and angelfish but got an error when started Angelfish.

It looks like this is a limitation of the old kernel, but there might be a workaround.
I'll keep you posted.
 

The Following 2 Users Say Thank You to edp17 For This Useful Post:
Posts: 387 | Thanked: 707 times | Joined on May 2015 @ Italy
#6
edp17, why don't you open a new thread on XDA and report your work there as well? It can be more visible than here for new users!
https://forum.xda-developers.com/jolla-sailfish

Edit: why not also on https://together.jolla.com/questions/

Last edited by claustn; 2020-02-26 at 10:26.
 

The Following 2 Users Say Thank You to claustn For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#7
Originally Posted by claustn View Post
edp17, why don't you open a new thread on XDA and report your work there as well? It can be more visible than here for new users!
https://forum.xda-developers.com/jolla-sailfish

Edit: why not also on https://together.jolla.com/questions/
Thanks for the advise. It is already there.

But I have posted on TJC and XDA/sailfish general too.

Last edited by edp17; 2020-02-26 at 12:43.
 

The Following 3 Users Say Thank You to edp17 For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#8
Bluetooth is fixed!
Plus backport of NO_NEW_PRIVS is added into kernel for further Flatpak support but the kernel seems to be too old for that.
Unless we can patch the glibc for flatpak like I have done it for sailfish.

Edit:
The bluetooth is still needs some love because it starts only with the reboot (if it was switched on before that) and once it is on (after the reboot) and you switch it off, you cannot switch back on without another reboot. (Maybe the problem is the initialization.)
Plus when I paired with my bluetooth headset, the audio is not routed to it. (It still heard the sound from the speaker.)
So, I go back to the drawing board.

Last edited by edp17; 2020-02-27 at 08:23.
 

The Following 2 Users Say Thank You to edp17 For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#9
The two softkeys (each side of the home button) do work as notification leds.
(As this device doesn't have any leds, this is a nice re-use of the soft keys which can light on/off or blink.)
The download link is updated to point to the latest image that has this function.

Bluetooth is still WIP.
 

The Following User Says Thank You to edp17 For This Useful Post:
edp17's Avatar
Posts: 600 | Thanked: 713 times | Joined on Jul 2019 @ UK
#10
With the latest image, Bluetooth works (with little extra effort) The instruction has updated.
 

The Following 4 Users Say Thank You to edp17 For This Useful Post:
Reply

Tags
galaxy s2, gt-i9100, i9100


 
Forum Jump


All times are GMT. The time now is 17:42.