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?