Running SailfishOS on the Xperia SP
- Insert default warranty void message here. You warranty is now void :P
- I have not tested this on locked bootloaders, but since I needed to modify the kernel, I guess that you need an unlocked bootloader.
- Note this is not an offical SailfishOS build, and the Xperia SP is not the Jolla phone, so please don't report bugs to Jolla.
- The Sailfish image does not provide recovery, and since the Xperia SP does not have a recovery partition, you need a seperate bootimage with only recovery on it to flash cm/stock/sailfish upgrade
- The Sailfish image is based on a specific version of Cyanogenmod 11, which you will need to flash first.
You can find a bootimage with only TWRP recovery in it here: https://maikelwever.nl/sailfish/recoveryboot.img
This image can be flashed with fastboot (with phone turned off, hold vol up and plug in usb), then
fastboot flash boot recoveryboot.img. If you already have recovery from cm, then you can use that as well.
First do a full wipe (make a backup first if needed, TWRP can do this ;), then install CM11, the specific version you need is here: https://maikelwever.nl/sailfish/cm-11-20150712-NIGHTLY-huashan.zip
There is no need to reboot cause you wont use CM11 anyway, so just proceed and flash the sailfish image, which is here: https://maikelwever.nl/sailfish/sailfishos-huashan-release-184.108.40.206-UNOFFICIAL-maikel-201508021124.zip Flashing Sailfish is not as fast as flashing cm11, but it shouldn't take more than 10 minutes.
After flashing sailfish image, but before rebooting, adb shell into the device (TWRP has adb enabled), and execute 'mount /system'
Then, download https://maikelwever.nl/sailfish/hwcomposer.msm8960.so and execute
adb push -p hwcomposer.msm8960.so /system/lib/hw/hwcomposer.msm8960.so
Adb shell again and execute
Then reboot. The first boot may take some time, during which the Sony logo is not displayed (WIP).
If the boot takes more than, lets say two minutes, try a reboot. You can power off the device by holding the power button until the LED bar turns red or the display brightness goes back to full, when the leds and display turn off the device is powered off. If this doesn't work you can remove the back cover and press the little button in the little hole for 5 seconds, the device will vibrate thrice and the phone will be forced off.
If you want to return to your previous rom or restore a backup, use the recoveryboot.img using the commands stated at the top of this document, to boot into TWRP.
Building the image yourself
If you want to build the image yourself, here's the manifest needed: Note you should use this libhybris commit for the time being, otherwise display wont work: https://github.com/mer-hybris/libhybris/commit/b981d65d17f6ffa8c3aa031d17eaf463d1c7d13b
You also need to do a
make hwcomposer.msm8960 after
make hybris-hal, and copy the hwcomposer.msm8960.so file it generates to /system/lib/hw/. This is fixed in later libhybris versions, but those have other issues so do this for the time being.
And last: you need https://github.com/maikelwever/qt5-qpa-hwcomposer-plugin instead of upstream version, cause this one has QCOM_BSP defines added needed by Xperia SP.
<?xml version="1.0" encoding="UTF-8"?> <manifest> <project path="device/sony/huashan" name="maikelwever/android_device_sony_huashan" revision="cm-11.0"/> <project path="device/sony/common" name="CyanogenMod/android_device_sony_common" revision="cm-11.0"/> <project path="device/qcom/common" name="CyanogenMod/android_device_qcom_common" revision="cm-11.0"/> <project path="device/sony/qcom-common" name="CyanogenMod/android_device_sony_qcom-common" revision="cm-11.0"/> <project path="device/sony/msm8960-common" name="CyanogenMod/android_device_sony_msm8960-common" revision="cm-11.0"/> <project path="kernel/sony/msm8x60" name="maikelwever/android_kernel_sony_msm8x60" revision="cm-11.0"/> <project path="hardware/qcom/fm" name="CyanogenMod/android_hardware_qcom_fm" revision="cm-11.0"/> <project path="hardware/sony/DASH" name="CyanogenMod/android_hardware_sony_DASH" revision="cm-11.0"/> <project path="vendor/sony" name="TheMuppets/proprietary_vendor_sony" revision="cm-11.0" /> <remove-project name="mer-hybris/hybris-boot" /> <project path="hybris/hybris-boot" name="maikelwever/hybris-boot" revision="hybris-10.1-huashan"/> <remove-project name="mer-hybris/droid-hal-device" /> <project path="rpm" name="maikelwever/droid-hal-device" revision="hybris-10.1-huashan"/> <remove-project name="CyanogenMod/android_system_vold" /> <project path="system/vold" name="oleid/android_system_vold" revision="cm-11.0" /> <remove-project name="mer-hybris/android_hardware_libhardware" /> <project path="hardware/libhardware" name="mlehtima/android_hardware_libhardware" revision="hybris-11.0-44S" /> </manifest>