[Galaxy S II General] edp17:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! W A R N I N G !!
!! !!
!!(Although I am using this on my backup phone)!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Everything you do, !!
!! you do at your own peril and risk. !!
!! !!
!! I do not bear any responsibility !!
!! for your faulty devices. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! !!
!! ROM IS NOT SUITABLE FOR DAILY DRIVE !!
!! ONLY FOR EXPERIMENTAL PURPOSES !!
!! !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Making this port was challenging because Sailfish OS, from version 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:

kernel12_mtp.img for Sailfish OS 3.2.1.20

kernel33016.img for Sailfish OS 3.3.0.16

kernel34024.img for Sailfish OS 3.4.0.24

kernel41024.img for Sailfish OS 4.1.0.24

kernel43015.img for Sailfish OS 4.3.0.15

twrp2.8.7.img for i9100

CM 12.1 for i9100

Sailfish OS 3.2.1.20 for i9100

Sailfish OS 3.3.0.16 for i9100

Sailfish OS 3.4.0.24 for i9100

Sailfish OS 4.1.0.24 for i9100

Sailfish OS 4.3.0.15 for i9100

Sailfish OS 4.4.0.64 for i9100

Sailfish OS 4.4.0.68 for i9100

Sailfish OS 4.4.0.72 for i9100

Odin v1.83

AOSP-LP-Kernel+_25-08-2015_TWRP-2.8.7.0.tar

Repartition: System=1GB, Data=14GB, eMMC=8MB, /preload=7MB

Repartition: System=1GB, Data=4GB, eMMC=7GB, /preload=0.5GB

Stock partition pit file

kernel07_flatpak (kernel with Flatpak support. Flatpak install/usage instructions.)

Some useful tips:

Low power mode aka ambient mode (in Fingerterm):

mcetool --set-low-power-mode=enabled

Disable lock screen animation (in Fingerterm):

mcetool --set-lockscreen-animation=disabled

Some useful patches:

Patchmanager 3.0

More folder icons

Operator name at bottom (Stopped working on 3.3.0.16)

Silica mail (transparent background) - Well documented here

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 (On 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:

go to Settings/Bluetooth

tap on the dot next to the Bluetooth option

If BT has turned on at least once since last boot:

go to Settings/Bluetooth and tap on the dot next to the Bluetooth option

go back to Settings

go to into Settings/Bluetooth again

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. :cool:

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

=========

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. :)

Work:

Same as previously

Improvement: Stock browser stable and works!

Do not work:

The camera app crashes the device into reboot.

03.09.2021

=========

Work:

Same as previously

Bluetooth does work, but once it is off, needs to be toggled a few times in Settings to make it turn on again.

14.06.2020

=========

Work:

Same as previously + Mobile data is fixed! (To make it work: change Protocol to IP in Settings/Mobile network/Data access point.)

Bluetooth doesn't work, it is still WIP

Do not work:

Same as previously

06.05.2020

=========

The latest version of 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.

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!

29.04.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

External SD card detected and mounted to /run/media/nemo/_sdcard_name_ (where _sdcard_name_ is 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:

Mobile data (WIP)

Video recording (It doesn't really work in other 3.x versions either. See my test results here.)

There is an extra little issue that 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.

04.04.2020

=========

Work:

Same as previously + Softkeys are used as notification leds

Bluetooth doesn't work, it is still WIP

Do not work:

Same as previously

23.03.2020

=========

Work:

Same as previously + with 'kernel12_mtp' the MTP works! :D

Bluetooth partially works (to switch on BT requires a reboot or issue a command manually, it is still WIP)

Do not work:

Same as previously

25.02.2020

=========

Work:

Same as previously + with 'kernel07_flatpak' the Low Power Mode (AKA "sneak peek" or "ambient display") works! :D (install instruction is in this post)

Do not work:

Same as previously

23.02.2020

=========

Work:

Same as previously + but from now on you don't need PC and heimdall to flash kernel and twrp

Do not work:

Same as previously

19.02.2020

=========

Work:

The same as listed earlier + with the new kernel (kernel06) I attached you can boot into TWRP with the usual button combination (hold buttons: Power on + Home + Volume up)

Do not work:

Same as previously except the TWRP/Sailfish OS boot which has fixed.

08.02.2020

=========

Work:

Screen

Touch

IMEI number is detected

Sensors (GPS, Rotation, Acceleration, Gyroscope, Magnetometer, Light & Proximity)

Wifi

Calls incoming/outgoing

Messages incoming/outgoing

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, I set 0.82 which is more appropriate for the device's screen resolution see the download section)

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

Do not work:

Mobile data

Bluetooth (the bt driver is in the kernel, so in theory, with some config file changes on the device it can work)

MTP

Video recording (It doesn't really work in other devices with CM12.1 base.)

Screen delay in refresh (related to how vsync is handled in v10 backend in qt5-qpa-hwcomposer-plugin)

the charging icon doesn't work properly: when the device is not on charger still shows it's charging (when I unplug the cable the message appears: "Charging..."

cannot boot into TWRP recovery (See Notes above)

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.

View attachment 5152187