UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Ubuntu on SFOS kernel

    Scheduled Pinned Locked Moved General
    2 Posts 2 Posters 263 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • P Offline
        pepijndevos
        last edited by

        SailfishOS supports a wide range of Sony Xperia devices, including the 10 III that I own. They seem to have done a pretty stellar job in booting a Linux kernel with working drivers, but I'm less hyped about their userland.

        That got me thinking, would it be possible to run a different Linux userland on the SFOS kernel?

        Like, can I basically build an Ubuntu rootfs and use SFOS boot and system partitions, or something along these lines?

        I'm a software developer who knows C, has cross-compiled software, developed Android apps and embedded software, ran custom Android ROMs and SFOS, compiled custom kernels, etc. I'm not quite a kernel developer but I think porting Linux to a device already running Linux should be within reach?

        Of course ideally SFOS would mainline their drivers and everything would be super straightforward, but my understanding is they did not do that, and duplicating their effort or shepherding their code upstream is not something I'm planning to do at the moment.

        The typical approach of porting Ubuntu appears to be to start with Gallium which to my understanding is an abstraction layer between a LineageOS system image and a generic Linux driver. Sony Xperia 10 III is already not supported in LineageOS, so this path also seems infeasible.

        SFOS is already booting Linux on the device, so you'd think it's a matter of "just" replacing some binaries. But I could use some pointers on the logistics and architecture.

        For example, does the system image / rootfs map cleanly to kernel and userland? Like, do the initramfs and all the kernel modules live on the system image? If so, can I just literally download and flash a generic aarch64 rootfs? Maybe I need to extract some kernel modules from the SFOS rootfs? Are there any user mode bits that are device specific that I need to know about?

        ikozI 1 Reply Last reply Reply Quote 3
        • KenedaK Keneda moved this topic from Porting on
        • ikozI Offline
          ikoz @pepijndevos
          last edited by

          @pepijndevos I think with "Gallium" you mean Halium, which is indeed an abstraction layer between the android hardware drivers (blobs), not just LineageOS, and a normal Linux distro.

          Although I don't know much about Sailfish OS, their stack seems close to ours, so you should be able to use most of their kernel code. It wouldn't be as simple as flashing a generic system image.

          The rootfs is supposed to be generic, but from my experience every device needs different tweaks (so you can't just flash the rootfs), that is why the overlay method exists, which all new ports use.

          You can try adapting the kernel sources to Ubuntu Touch, and then the rootfs probably from scratch. I couldn't find any port source code from Sailfish OS, as Ubuntu Touch has, which is of course necessary.

          May the source be with you

          1 Reply Last reply Reply Quote 1
          • First post
            Last post