2017-10-23

Experiences installing Sailfish X

Sailfish X was recently released into the wild for the price of €50.

I decided to give it a go on my Xperia X. 

This involved unlocking the bootloader, which was fairly straight-forward as I have one of the models which allows unlocking the bootloader. 

Coming from the Nexus line as I am there was an additional step to this which was new to me, which involved getting a code from Sony which allows to you to do the unlocking. Other than that it's basically finding the unlock switch in the developer options which isn't that hard.

I then attempted to download the fastboot driver, which was not that straight forward. Fastboot is the bootloader mode where you can flash images to the phone. 

Sony uses their own version of fastboot called S1 fastboot. But they have not developed their own driver. Instead they have released a modified inf file for Google's usb driver. The problem with that is that the signing gets mangled. The hash which Google has created for their driver will not match when the inf file is different. Which means you have to override Windows Driver Enforcement if enabled.

In my case I was using a corporate computer which was running bitlocker and had to get a hold of the bitlocker recovery key before I could restart the computer with advanced startup and disable windows driver enforcement and override the warnings that the driver had been tampered with. Which, of course, they had. By Sony.

This is just a dodgy thing for Sony to do. If you are going to release a driver. Sign it. Certainly if you are releasing it for Windows. I understand that most people unlocking their bootloader are hobbyists who won't be running an enterprise version of Windows, but some of us run GNU/Linux at home.

If you are also using a corporate computer with bitlocker, the recovery key can usually be found in the Active Directory Object of the computer.

Apparently this line of Powershell should get it in an administrative shell:

(Get-BitLockerVolume -MountPoint C).KeyProtector
Source: https://blogs.technet.microsoft.com/heyscriptingguy/2013/08/24/powertip-use-powershell-to-get-bitlocker-recovery-key

I went the long way about it and got it from AD via someone who had the rights to read that bit.

The next step was to download Emma. Emma is the Windows-only flashing tool which Sony provides. It flashes whole android images in their own format. 

One slight gotcha here:
If you download and install Emma and search in your start menu, you will find the emma command. If you run that, Emma will run and ask you for an account. 

If that was really how the program was expected to work it would be quite a boring step waiting for some Sony employee to see you in the list of registrants and accept that you are allowed to unlock the device that you own. Not unlike Sonys attitude earlier relating to the PS3 and the law suit against George Hotz.

It turns out you can just find the executable in program files and run that directly and it won't prompt you for a login.

You then download the newest image and flash it. Quick note here: This will do two things that you should know about.

1. The DRM-partition will be overwritten, as it wipes all the data on the phone. This includes some proprietary software which makes the camera work better. If you don't want  that to go away there is apparently some way to back it up. presumably using adb.

2. The image flashed will not update using the android OTA mechanism. Meaning that only the versions listed in Emma will be available on Android. This is also the case if you choose to drop Sailfish in the future and revert to Android. Make sure you use newest image. (The image bundles are called services in Emma)

The next thing to do was to get the Sony binaries, which can be found at developer.sonymobile.com. Here there seemed to a bit of an inconsistency. Jolla asks you to make sure Android is running build 34.3.A.0.228, before you flash Sailfish. But the vendor image you are flashing relates to Android Marshmallow (6.0) rather than Android Nougat (7.1) which that build refers to. This is because the vendor image matches the Sailfish image, not the Android you are flashing over. 

Flashing is pretty straight forward. Jolla provides a script which works just fine. I would have written it in Powershell, rather than the more old school batch, but that's fine too. The feedback it gives is mostly legible.

After having flashed I was unable to boot the phone. It kept showing the Sony logo and doing nothing. The install guide mentions this problem specifically and that made me unsure if I had the right vendor image. I tried a few different ones, without success. Eventually I found that I had forgotten to remove the µSD-card from the phone before flashing. I flashed again with the original image and the phone booted into Sailfish.

I found that the flashing had been fine all along, but the Sailfish was refusing to boot with the vfat formatted android-SD card in the phone. Kind of a weird problem, especially seeing as the card mounted just fine once Sailfish was booted up.

But I now have a function Sailfish OS phone, with MS Exchange support and Alien-Dalvik which allows me to run Android apps alongside the fancy Sailfish ones.

More coming up...


No comments:

Post a Comment

Please pay attention to spelling and grammar. The comment field is not moderated.