Linux on mobile, my experience so far

I spoke about this subject at MashhadLUG a few weeks ago but regretfully didn't record it. So I figured I would make the essence of what I talked about a blog entry—something useful and permanent and easy to access. Here's a glimpse at my experience with Linux on mobile devices, how it runs, the application base, and whether or not it's actually usable in everyday life. Hold on a minute. Isn't Android also Linux? Technically speaking, Android is indeed Linux. Sort of. Android employs the Linux kernel but otherwise shares little in common. Unlike a standard GNU/Linux distro, Android has a non-identical C standard library—Bionic rather than glibc—which results in binary incompatibility from most standard Linux software. And on top of all this, Android isn't exactly the freest or most open OS in the universe either. So when we mention Linux on Mobile, we're talking about installing a true GNU/Linux distribution on your phone—just like on your desktop or notebook, but (ideally) tailored for use on a phone. How Linux operates on Smartphones: The Two Fundamental Approaches Middleware (Halium / libhybris) This is the "compatibility layer" approach. libhybris and Halium cooperate and fill the compatibility gap between Android's kernel/hardware and a Linux distro. The majority of the systems based on Halium (e.g., Sailfish OS, Droidian, and Ubuntu Touch) enjoy good hardware support as they reuse Android drivers. There's a catch, however: they're based on the Android kernel, usually very outdated and not supported. So although this method "just works" for most devices, you give away freedom and future-proofing. How it works: Halium operates on top of the Android kernel libhybris resides on your Linux distribution and translates glibc syscalls to Bionic So when you flip your flashlight on, for instance, libhybris converts the demand into a form which can be forwarded on to the Android hardware level. It's magical, really. But also a bit... Frankenstein-esque. You can't bolt the full Linux experience on an Android platform and hope for it to be perfect. It's a hack—and hacks tend to have their limits. Mainlining the Kernel (a.k.a: Doing it the right way) With this approach, developers port a mainline Linux kernel on a phone's SoC. Rather than leveraging Android's driver stack and reusing it, everything gets rebuilt from the ground (or nearly so) from upstreamed Linux support. This provides a much "cleaner" and more native Linux experience. Distros such as Mobian, postmarketOS, Koofr, and upcoming Parch make use of this approach. But it's not all sunshine and rootshells: Relatively few of the SoCs enjoy full mainline support (primarily Snapdragon chips) Hardware support remains limited—cameras don't usually function, for example Development is less device-friendly and slower compared to Halium setups

May 22, 2025 - 18:20
 0
Linux on mobile, my experience so far

I spoke about this subject at MashhadLUG a few weeks ago but regretfully didn't record it. So I figured I would make the essence of what I talked about a blog entry—something useful and permanent and easy to access. Here's a glimpse at my experience with Linux on mobile devices, how it runs, the application base, and whether or not it's actually usable in everyday life.

Hold on a minute. Isn't Android also Linux?

Technically speaking, Android is indeed Linux. Sort of.
Android employs the Linux kernel but otherwise shares little in common. Unlike a standard GNU/Linux distro, Android has a non-identical C standard library—Bionic rather than glibc—which results in binary incompatibility from most standard Linux software. And on top of all this, Android isn't exactly the freest or most open OS in the universe either.

So when we mention Linux on Mobile, we're talking about installing a true GNU/Linux distribution on your phone—just like on your desktop or notebook, but (ideally) tailored for use on a phone.

How Linux operates on Smartphones: The Two Fundamental Approaches

  1. Middleware (Halium / libhybris) This is the "compatibility layer" approach. libhybris and Halium cooperate and fill the compatibility gap between Android's kernel/hardware and a Linux distro. The majority of the systems based on Halium (e.g., Sailfish OS, Droidian, and Ubuntu Touch) enjoy good hardware support as they reuse Android drivers.

There's a catch, however: they're based on the Android kernel, usually very outdated and not supported. So although this method "just works" for most devices, you give away freedom and future-proofing.

How it works:

  • Halium operates on top of the Android kernel
  • libhybris resides on your Linux distribution and translates glibc syscalls to Bionic So when you flip your flashlight on, for instance, libhybris converts the demand into a form which can be forwarded on to the Android hardware level. It's magical, really. But also a bit... Frankenstein-esque.

You can't bolt the full Linux experience on an Android platform and hope for it to be perfect. It's a hack—and hacks tend to have their limits.

  1. Mainlining the Kernel (a.k.a: Doing it the right way) With this approach, developers port a mainline Linux kernel on a phone's SoC. Rather than leveraging Android's driver stack and reusing it, everything gets rebuilt from the ground (or nearly so) from upstreamed Linux support.

This provides a much "cleaner" and more native Linux experience. Distros such as Mobian, postmarketOS, Koofr, and upcoming Parch make use of this approach.

But it's not all sunshine and rootshells:

  • Relatively few of the SoCs enjoy full mainline support (primarily Snapdragon chips)
  • Hardware support remains limited—cameras don't usually function, for example
  • Development is less device-friendly and slower compared to Halium setups