Back to Blog home

Opening Sailfish OS HW Adaptation Source Code for Sony Xperia™ X

Dear community members,

Today we are happy to announce our first publicly available Hardware Adaptation sources and instructions for Sailfish X, aka Sailfish OS for Sony Xperia™ X!

This will enable you to create a Sailfish OS image and flash it to your own Sony Xperia™ X. It is targeted to the eager and highly skilled developers in our community to create their own images and even help us out by contributing back to those open sourced HW adaptation repositories, which we in turn shall use for the official Sailfish X images and updates.

If you are a developer in our community who has previously done Sailfish OS ports to other devices, we recommend you to give it a shot. Please carefully follow the instructions we have on and make sure you fully understand them. They will be your ticket to getting the OS working on your Xperia™ X, and if you’re feeling even more adventurous, you should be able to adapt them to run on other Sony’s Open Devices. All of this can be achieved via the guidance of the #sailfishos-porters IRC channel, say hello there!

The aim throughout this endeavor is to get individuals building a Sailfish OS image and flashing it to their devices, (meaning, trying it out before official releases), enjoying apps from the Jolla Store, and contributing back to HW adaptation improvements.

I would like to thank the tech lead of Sony Open Devices, Alin Jerpelea, for assisting us in this great collaboration opportunity, relentlessly facilitating solutions to ease integration and producing a great, open-source base for our ports.

Please note that working with HADK requires a lot of skill, and naturally you will perform these actions at your own risk. Good luck!

.. and happy hacking,

Simonas Leleiva

Gadget inspector, busy restoring the status quo of GNU/Linux OS in consumer electronics! HW Adaptation and L10n engineer at Jolla with strong emphasis on our vibrant community.


  1. Avatar

    Awesome post, everyone with the skills should try it out asap 😉

    • Avatar

      It’s great to hear from you again beidl! 😀

  2. Avatar

    Great news, … but maybe I just wait a while more 🙂

  3. Avatar

    I will give it a try 🙂

    • Avatar

      Be my guest!

  4. Avatar

    Hello, when can we except announcement of next supported device?


    • Avatar


      There is not time frame actually yet, as we are completely focused on the current Xperia X. We will update you some time after we are done with this device.


      • Avatar

        Maybe, Xiaomi Redmi Note 4 (Snapdagon) or Nokia?
        It would be great to see SailfishOS on this devices

        • Avatar

          The HADK combined with the platform configs Sony provides, should make it much easier to port to other Open Devices, e.g. the XZ range.

  5. Avatar

    I’m not what I consider a pro on any of this, so I am prpbably wrong: Do I really need to wait for lunchtime to execute the statements in the header of you blog entry?

    • Avatar

      We used to use ‘breakfast’, but too many people used it before they’d had enough coffee. It’s safer this way.

  6. Avatar

    This is abracadabra to me, so I will wait untill an easier instruction is given.
    Do we have to download the os to Marshmellow?

    • Avatar

      Hi Kea, this, as you may have noticed, is not an instruction to install Sailfish X on your Xperia X. It is however a way to install the OS on your phone *if* you have the skills to do so in which case you could help us improve the OS faster than we could do on our own! The actual instructions how to install the purchased version of Sailfish X will come later, closer to the launch day!


  7. Avatar

    Thanks, I have always seen sailfish as a hack. A challange! Me likey. Let the best hack win!

    • Avatar

      Thanks Dave!

  8. Avatar

    Morning, I have just received my brand new unopened xperia x and was wondering as a non-techie if it would be easier for me to flash an unopened or opened phone.Thanks

    • Avatar

      You’re going to need physical access to the thing to flash it so trying to flash it while it’s still in the box obviously isn’t an option.

      Skimming trough the instructions it’s clear this is for software developers, not the average consumer so you should probably hold on for a few more weeks until the publicly available image comes out.

      • Avatar

        You have to go through the unlocking process and therefore you have to open it first. A password and agreement with terms and conditions of Google is necessary before you can look for the IMEI number and lateron de developer option with OEM and debugging allowed. It is not necessary to have a Google account in order to be able to unlock the device.

        • Avatar

          Next time I submit a comment I shall definitely phrase it better!! I “opened”the phone and the good news is bootloader unlocking is allowed, so thanks for your help

  9. Avatar

    @James What is the maximum sdcard size the Sailfish Os on Xperia X supports? Thanks!

    • Avatar

      The Xperia X supports the SDXC standard, so it should theoretically have a limit of 2TB – although I haven’t seen MicroSDXC cards larger than 400GB. Since Sailfish doesn’t boot from this card, you can format it with any Sailfish/Linux supported file system (at least ext4 and Btrfs) and it should support up to whatever the limit of that file system is.

      A 64GB card with Btrfs (raw partition) file system works fine on my Jolla 1.

    • Avatar

      This follows the Jolla Tablet actually. Anything larger than 32GB should be formatted to ext4 in order to work with Sailfish OS.

      • Avatar

        … because Jolla betrayed their community with regards to SDXC support.

        • Avatar

          That is not entirely accurate as it was our community that insisted we should not pay any money to a “certain company” in order to have the license for SDXC compatibility. And frankly, it would cost a lot. So I apologise if you feel that way but I can’t agree that it was considered a “betrayal” of any sort.

          • Avatar

            @James Noori: That’s a myth deliberately created by certain Jolla executives (or one of them?) at the time.

            Actually there was one single individual who opposed SDXC passionately in public. A topic on TJC on this issue was then (ab)used as a poll. The sum of upvotes for all solutions in favor of SDXC (including, for example, making SDXC support an optional, even paid download) exceeded those for “solutions” without SDXC. So “the community” (whoever that is – that’s a different question) wanted SDXC.

            Besides, all of this (both the poll and this one individual’s crusade) were already pointless when they started: SDXC support was a stretch goal at the IGG campaign. While the few who opposed SDXC only did so by clicking an arrow symbol, the others who wanted SDXC compatibility voted for that with their money. So while you’re 100% right when you say “it would cost a lot”, you’d better not say it to those who actually paid for it in 2014 and didn’t get it.

            See, my assumption is that the feature was cancelled because Jolla was already running out of money and didn’t want to pay additional license fees. that’s perfectly acceptable and would have been fine if communicated thatw ay. However, pretending that you were “listening to the community” and turning this in some kind of cheesy anti-Microsoft-stunt is fraud and betrayal.

            • Avatar

              But is it a problem for you to format the card with ext4 or btrfs? How often do you switch cards between devices anyway?

              Anyway, if the hardware supports HDXC it should allow up to 2TB of storage. I don’t know what the reason for that limit is – perhaps addressing?

              • Avatar

                @wvh The problem is that they betrayed us. I assume that every single person who paid for the feature knows exactly what they need it for (as do I) and that it’s not necessary to doubt that. People wanted it so badly they donated money to have it done.

                Of course using the SD card as a means of data exchange between either 2 mobile devices or a mobile device and a laptop/desktop PC is one of its main use cases. At least for me.

                The main issue though is that whenever you format an SD card, it’ difficult to align the physical sectors of the card and the logical ones of the file system the way the factory does. This means that depending on what you do, either speed or lifetime or both will decrease. You can only be sure you get what you paid for if you take the card out of the box and use it as is… Which is not possible with Jolla devices.

                • Avatar

                  Betrayed us? Haha. Didn’t you say you have no rights when it comes to crowded funding last three year. Betrayed. That’s a good one man!

                  • Avatar

                    @Dave999 Maybe you drink a mug of hot chocolate and then re-read what I wrote. The betrayal wasn’t that they couldn’t deliver what we had invested in.

                    • Avatar

                      So they betrayed us all becouse of something you need/want? Please tell me more.

                    • Avatar

                      @Dave999 Above I’ve said everything there is to say. There’s no need to hold any further friendly conversation with people like you.

                • Avatar

                  There’s no electronic/signal/etc. difference between SDXC and SDHC cards.
                  They all talk the same language to the smartphone (unlike SD cards which use a slightly older protocol. Similar to LBA and LBA48 protocols with harddisks).

                  You can plug a SDXC card into a SDHC device.

                  The distinction is purely a marketing one.
                  Cards called “SDXC” are 64GiB or bigger and are pre-formatted with exFAT (whereas “SDHC” moniker is used for cards up to 32GiB and pre-formatted with FAT32).
                  exFAT is heavily patent encumbered (by microsoft) and costs a big chunk of money.
                  The simplest way is to do what lots of other company do and call the device “SDHC (can support > 32GB cards if re-formatted)”.

                  The alternative way is to live in a country that does not have software patents, and to install the exFAT Fuse driver. Then you can even use your card out-of-the-box, as-is. Entirely possible, thanks to (so you can enjoy your data being eaten by the shitty file system).

                  Regarding the erase-block alignment:

                  – It’s NOT THAT DIFFICULT, there are tons of tutorials online.

                  – This is a problem that is *very* specific to how FAT-based systems (like exFAT and FAT32) (basically, you need to put the FAT in a separate erase block, and to align the clusters boundary with an erase block, other wise the read-modify-write cycles explode).

                  – ext4 is very little affected by this (as long as the whole partition it self is aligned to an erase block boundary, which all “well aligned” exFAT cards are already)

                  – copy-on-write and log-structured filesystems like BTRFS and UDF are even less affected (they never overwrite, they only append new data, or garbage collect old versions. Due to this, read-modify-write cycles nearly never happen.)

                  TL;DR: if you format your SDXC card to btrfs without much though, you’re still safe.

                  • Avatar

                    @DrYak Thanks for your knowledgeable input. Of course we don’t disagree on the facts. It’s just that I wouldn’t call something “not that difficult” if it has triggered all those how-to articles online. For things that aren’t difficult, there’s no how-to. (Also, I’m quite sure Jolla-users who re-format a card with FAT32 don’t even know about the issue, thus don’t search for these tutorials…). Ext4 is fine for a built-in device, but as long as neither my digital camera nor my workmate’s laptop can read/write it, it’s not useful as a file system on an SD card. Same goes for Btrfs with the additional problems that each and every Jolla 1 user has experienced with this file system. So in every day life, Ext4 and Btrfs are not a likely or useful choice. Most people will have to rely on something FAT. Which means for those people, we’re back to “Sorry, you really should have read that tutorial before re-formating the card, which of course means somebody should have told you there is something to be aware of at all”.

            • Avatar

              I cannot recall that I have voted in any way back then. But I recall feeling a big uneasiness when I payed for two tablets and two phones driving things towards a stretch goal that I couldn’t justify. I was very, VERY happy with the decision made to drop that stretch goal (which i think happened before it was reached). I believe I have been part of the silent majority that didn’t want money being allocated to that small’n’squashy company. If there was only one voice heard (but I recall a huge outcry, really) it certainly represented me and many others as well.

              • Avatar

                @hubat: No, this decision was made long after the stretch goal had been reached. That exactly was the problem. (Otherwise people wouldn’t have been so pissed.)

                If you’re happy with the decision, I’m glad for you. I like to have happy people around me. 🙂
                But let me repeat that the silent majority was in favor of the SDXC support. It was only a few very vocal anti-MS folks who managed to force their will upon others because Jolla abused the situation in order to save money. The unfortunate consequence being that the use of SD cards is much more difficult now than it should be and we see quite a few reports from users whose SD cards died after a relatively short period of usage.

            • Avatar

              Okay I can’t comment on many of the claims you are making unfortunately as I was not employed by Jolla back then and don’t have the time to dig any information at the moment. But as I recall being a community member close(er) to Jolla, the “main” reason was not that Jolla was in a troubled financial situation. Although that has definitely contributed as a factor, it isn’t the main reason. Therefore I can’t call it a “betrayal” myself. You of course are free to call it exactly what you want to call it!

              And since then, hopefully you have noticed an improved communication (which is still being improved…) which results a great long time reputation from Jolla to the community.

              • Avatar

                @James Noori:
                > Therefore I can’t call it a
                > “betrayal” myself. You of
                > course are free to call it
                > exactly what you want to
                > call it!

                Sounds like a good deal to me.

        • Avatar

          I voted for no-money-to-m$ so I’m happy with the result.

      • Avatar

        That’s not true actually. Microsoft artificially put this limit to earn royalties with exFAT, but any SD card up to 2TB can be formatted in VFAT.
        That’s what I did with my 64GB card and that’s what Sailfish should propose by default in the built-in format utility. This way, non-techie people could switch it between Sailfish and Windows easily.

  10. Avatar

    Thanks for sharing this, gonna have a try 🙂

  11. Avatar

    In the instructions, I read “sudo apt-get install rsync”.

    Are there more ‘debian’ commands? I run something else then debian. I can run “sudo pacman -S rsync”, but I might need “sudo yay -S rsync-git”…

    So, is this for debian users only?

    • Avatar

      This is done inside HABUILD_SDK which is essentially a chroot (chapter 4.4 in the HADK pdf), so your host OS is unaffected.

      • Avatar

        Ah, missed that point, thank you.

  12. Avatar

    Great! Any news on the bluetooth support?

    • Avatar

      No real news yet as our engineers are mostly busy on other parts of the OS now. We will update you if anything “update-worthy” happens of course!

  13. Avatar

    Can you do an N9 port please?

    • Avatar

      Well, I think the short answer is no. N9 is a very old device and uses a different chipset (Ti OMAP) which is not completely compatible with Sailfish OS. Making that work requires a lot of resources which we are not willing to dedicate to it. Sorry about that.

  14. Avatar

    Nice. I hope somebody may figure out how to build for dual sim variant (F5122). They say the hardware is _almost_ identical.

    • Avatar

      Personally, I think it’s only a matter of time. Let’s see!

    • Avatar

      Some have already managed to do it 😉
      But I didn’t dig into details to see if I can go with the purchase of this model instead.
      Some clear answer from Jolla about if it will be more complicated to install and what feature would not work would be welcome 🙂

  15. Avatar

    I have not worked directly with the HADK before, but felt adventurous and eager enough to order an Xperia X Compact (F5321) today. Has somebody already started working on that? I couldn’t find any corresponding repos on Github, so maybe I’ll be among the first to try this? I don’t use IRC a lot, but guess I’ll have to soon.

    • Avatar

      As far as I know there has been some activity. It should appear on Github shortly if the person chooses to. But yes, using IRC is highly recommended when it comes to Sailfish OS ports! Good luck 🙂

    • Avatar

      Great job, Johny!

    • Avatar

      Nice! Too bad I don’t have time to give it a try right now…

      Any foreseen issues to switch from self-built to official release?

    • Avatar

      What distro do you use? I have problems on Arch when building droid-hal rpms:
      Failed build dependencies: qt5-qttools-kmap2qmap >= 5.1.0+git5 is needed by droid-hal…
      And when trying to install it:
      sb2 -t sony-f5121-armv7hl -m sdk-install -R zypper in qt5-qttools-kmap2qmap just gives “could not open /var/run/”. SDK resides in /srv/mer which is on /:
      /dev/sda4 on / type ext4 (rw,relatime,data=ordered)

      So it should not be a problem with nosuid.

      • Avatar

        Hi Velemas

        I have the same problem and being testing around and it seems to me that sb2 does not have write-permission to its /var/run: zypper wants to create a lock file there. This is easy to test by sb2 -R bash and then touch /var/run/test. BTW, I am running Arch as well…

  16. Avatar

    Excellent post, been waiting for this!

    Managed to build it on my laptop, but I needed to free up quite a lot of space (Download about 100GB).

    In order to compile make_ext4fs, zlib-dev is needed.

    PlatformSDK $ sudo zypper in zlib-devel

    • Avatar

      100GB? Why that much? It should not need more than 1-1.5GB of space actually… Are you sure about your number there?

      • Avatar

        I guess I didn’t read all the instructions at the beginning of the wiki 🙂

        “The disk space requirement for this build is not 16GB as HADK says, but around 80GB. The download bandwidth requirement is around 20GB, but can be reduced to half as much if you add –depth=10 to each repo init command throughout this guide below.”

        Anyway, great work! Looking forward to the final version.

  17. Avatar

    Great news and really a great, great job with the documentation u all — following along was a breeze. Thank you!

    (Personally I’m still thrilled about the timing: only one day prior to the announcement the f5121 had arrived in the mail; now it’s already rocking Sailfish OS 2.1 🙂 )

    • Avatar

      Amazing to hear! good job 🙂

  18. Avatar

    Hey thanks alot for sharing this! Despite not being a mobile developer, I successfully flashed an Xperia X phone with these instructions. They were a bit complex but very well-written. I’m impressed with the early build! Sure there are some rough edges and bugs that need to be resolved but the phone is surprisingly usable. The most important items (messages, phone, browser) seem solid. And 4G…Finally. Sailfish is gorgeous on this phone and this gives me something to tinker with while awaiting the official launch release. Thanks again!

    • Avatar

      What distro do you use? I have problems on Arch when building droid-hal rpms:
      Failed build dependencies: qt5-qttools-kmap2qmap >= 5.1.0+git5 is needed by droid-hal…
      And when trying to install it:
      sb2 -t sony-f5121-armv7hl -m sdk-install -R zypper in qt5-qttools-kmap2qmap just gives “could not open /var/run/”. SDK resides in /srv/mer which is on /:
      /dev/sda4 on / type ext4 (rw,relatime,data=ordered)

      So it should not be a problem with nosuid.

      • Avatar

        I would suggest you ask your question on irc. I’ve managed to build the image on an Ubuntu 16.04 box.

      • Avatar

        velemas, I used Ubuntu MATE 16.04. I wish you success!!

    • Avatar

      congrats!:) I’ve managed to follow through too, took me two days of work though to finally get the image to flash..

  19. Avatar

    In the instruction it is said:
    Here we’ll instead have Sony’s stock Android (6.0.1 or 7.0) – these are the versions that are supported by Sailfish X.

    And a bit later:
    Please download Sony Xperia X Software binaries for AOSP Marshmallow (Android 6.0.1)…

    What if i download binaries for AOSP Nougat from Sony then? Are they usable?

    • Avatar

      This will not work, because Sailfish X and Kernel is AOSP6.0.1 based. later Jolla (can) update the Build to the AOSP7 Build and kernel 4.4

  20. Avatar

    This differs from the paid release how ?

    • Avatar

      No commercial parts: Alien Dalvik (android App Support), No Exchange Support, No XT9 Text-Prediction Engine and only community updates, so no official Jolla Support

  21. Avatar

    I would be fantastic if some of you active developers could make it possible to use other Sony devices like compact devices. Personally I do not like the trend phones getting bigger and bigger. I prefer to carry my phone in my trousers pockets. So the Sony Xperia XZ1 Compact would fit perfectly.
    If it is possible to run such a “small” device with Sailfish I will immediately replace my Jolla 1.

Submit a Comment