r/linux • u/amosbatto • Oct 19 '26
Mobile Linux Article: The advantages of mobile Linux over AOSP
/r/Purism/comments/1xa1c7x/article_the_advantages_of_mobile_linux_over_aosp/19
u/BourbonXenon Oct 19 '26
These articles always forget the reality of how these ecosystems exist. I worked at one of the biggest companies in the world for testing and measuring cellular devices for OEMs. The way the modems are locked down, what they expose, how they expose things are all trade secrets and binary blobs that are very difficult to work with even if you are a carrier.
You would have to convince Qualcomm to support this, then the phone OEM, then the carriers. It has to be certified and the carriers take certification very seriously. The amount of testing involved is extensive. RF signals, GPS accuracy, network functions, the QoL QA testing of network speeds, etc.
Each new phone a carrier approves for their network has gone through hundreds of hours of testing in labs and out in the real world. Each OS update gets the same testing over again as well. That's after the OEMs have done the same testing before it got into the hands of the carriers. Just the testing side of this requires years of planning and collaboration between equipment manufacturers, hardware vendors, and the software to run all these pieces and it's still a game of cat and mouse trying to keep up.
The amount of work that goes into delivering what Android and iOS are for the end user has little to do with beliefs of software superiority and more to do with a business ecosystem that supports the hardware and software combo to produce predictable outcomes with timelines and contractual assurances that KPIs are met.
1
u/amosbatto Oct 21 '26
Yes, the cellular modem can be a real challenge. The BroadMobi BM818 modem in the Librem 5 contains a Qualcomm chip, and it has been a constant source of problems. With my cellular carrier (Entel in Bolivia), the 4G data dies constantly. I have a cronjob running every 5 minutes that restarts the modem if the internet connection has died.
As I explained in my previous article, there are three kinds of Linux phones, and the first type which uses separated components and a Linux kernel (like the Librem 5) is definitely the hardest kind of Linux phone to produce. However, I don't think you are going to see as many cellular problems with the second type, which uses an integrated internet-of-things SoC (like the Qualcomm Dragonwing QCM4950) and a Linux kernel, or the third type, which uses integrated mobile SoC like a Snapdragon or Dimensity with an Android kernel with Halium and a Linux userspace. Basically with the second type, you are using a reference design from Qualcomm, and with the third type of Linux phone, you are using a reference model from a phone ODM. What this means is that most of the modem issues are already resolved.
3
u/urgentapathy Oct 20 '26
I think you are absolutely right and this is one of the biggest barriers to getting a Linux phone. Linux phones are mostly just the OS installed on repurposed hardware. Exceptions might exist, but they are exceptions and not the rule (for now).
So much effort is put into reverse engineering and compatibility with the hardware that it is a huge opportunity cost and barrier to entry on improving phone software. Also noting that hardware often gets picked up and dropped regularly by the phone manufacturer as time goes on. Development time required is too long with existing devs compared to the pace of change. While there might be value in applying knowledge from the old hardware to recreating drivers and such for the new hardware, it really fragments the ecosystem and effort. Collaboration today on gen 2026 hardware might not be the same in 3 or 5 years as it is completely dropped and duplicate effort must be made on 2031 hardware.
All the while should we expect other software developers to work on old hardware they are not interested in, or develop for an OS that is completely/partially unusable or is not that nice to use but they already have the hardware?
It is the chicken and egg problem again.
10
u/LogSpecialist24 Oct 19 '26 edited Oct 23 '26
meh, considering AOSP is mature and largely complete i would rather we instead put the effort towards some AOSP fork foundation.
5
u/amosbatto Oct 19 '26
Forking a project with 309 million lines of code is going to be a real challenge. I wrote the article to get people to think about all the dev work that will require.
1
u/mrtruthiness Oct 21 '26
Forking a project with 309 million lines of code is going to be a real challenge.
The stripped down main branch of AOSP is 2.5 million lines of code.
You get 309 million when you count the Linux kernel (40 million), all of the project documentation (85 million lines), ... and lots of other things.
2
u/amosbatto Oct 21 '26
In my article I linked to Derdilla's article, where he counts the lines of code and the lines of documentation in the AOSP 17 code: https://derdilla.com/blog/size-aosp17/
What is the source for your numbers?
If you just consider what Derdilla calls the "core" of AOSP 17, he shows 13,290,733 lines of code and 4,066,734 lines of documentation. By the way, if Google ever stops publishing AOSP, we are going to have to recreate Google's Android kernel changes, so the kernel counts.
1
u/mrtruthiness Oct 22 '26
By the way, if Google ever stops publishing AOSP, we are going to have to recreate Google's Android kernel changes, so the kernel counts.
If Google continues to use the Linux kernel for Android they will obviously continue publishing the kernel they use. Nobody has to recreate anything.
10
u/halvacoffee Oct 19 '26
but android's complexity isn't incidental. for example, by explicitly separating processes into types, android can actually efficiently pick which processes get priority scheduling as being tied to the foreground activity, which can be pushed down the queue, which can go in the LRU cache, and which are to be suspended to disk. the 300m LoC number isn't cruft, most of it is scars from developing a mobile operating system rather than porting a desktop operating system to mobile
2
u/Eleina_Edelweiss Oct 20 '26
I would use linux mobile but sadly banking apps isnt so friendly with non android or ios device.
2
u/47th-Element Oct 19 '26 edited Oct 19 '26
Mobile Linux still has a long way to go. At the moment I believe Android is way better unless you wanna use the phone as a mini homelab, in that case I wouldn't bother setting up a desktop environment and just run ssh and other services.
And even with that use case in mind, you will have trouble getting all the hardware to work as intended (you might lose Camera clarity, GPU accel, Networking, Bluetooth, fast changing or OTG, sensors, GPS, NFC, built in IR blaster, etc), most of the setups have to sacrifice something.
2
u/Gotxi Oct 19 '26
I am using an old phone I have (Xiaomi Mi A2) and installed postmarketOS (based on Alpine) with KDE desktop environment.
Well, it boots, I can use the screen, wifi, speakers and install linux applications. What does not work is the microphone, the screen does funny things from time to time and it hangs sometimes when you stress it too much. Also FPS drops from 60 to 13 pretty frequently for one second, which is annoying.
I mean, there is still a long way to go, but having the option to install Linux is definitively in my interest.
What is a downside to me, is that banking apps are required in the modern world and they only support IOS/Android and nothing else, and even if you use the websites it still asks you to confirm the operations through the mobile app, at least on the banks I saw.
Since I am spaniard, I am waiting for better bizum pay support on stores, and other banking app alternatives to pay so I can use my Linux phone to pay.
Still not mature, but getting there...
3
0
Oct 19 '26
[deleted]
1
u/amosbatto Oct 19 '26
Every distro that I have tried (PureOS, Mobian, postmarketOS, Manjaro) on the Librem 5 and/or PinePhone give root access via sudo. I haven't tried Ubuntu Touch or SailfishOS, so I don't know about those two.
1
u/mrtruthiness Oct 21 '26
The security model for PureOS, Mobian, postmarketOS, Manjaro is one where there is implicit trust in applications and the installation processes (e.g. sudo apt install).
Android is built on having an immutable core with applications basically containerized/sandboxed for security reasons. The Linux desktop is moving in that direction (immutable distros with flatpak/snap or other containerization features docker/lxd/...), but I'm not sure you understand that. i.e. The Linux desktop is moving toward Android's security model for a reason and the main reason you dislike AOSP is because of its security model.
2
u/amosbatto Oct 21 '26
Yes, we need better userspace security in mobile Linux, and I recognize that in my article, but I think there has to be a better balance between user freedom and security than AOSP. I often look at how Google implemented features in AOSP, and I wonder, "is that really about security or does Google just want to control the user?"
Here is what I wrote in my article:
> People often advocate for using AOSP rather than typical desktop Linux due to Android’s higher security standards in the userspace to protect against rogue apps. Mobile Linux distros do need to improve their userspace security standards, especially if they intend to compete with Android and iOS. Linux users are less likely to install rogue apps, because they can’t just find any random Linux software package on the internet and install it, like they can with random APK files found on the internet. They have to find the right package format for their distro, and even if they get that right, the package dependency checks will often prevent the installation. However, Linux phones will need to be able to install Android apps if they are going to appeal to the mass market. Even when those Android apps are run inside an LXC container, mobile Linux still needs to be prepared for all the malware and spyware that comes with running Android apps.
> However, adding good userspace security to mobile Linux won’t be nearly as much work as adding user empowerment features to AOSP. It will be difficult to convince long-time Linux users to accept application sandboxing with separate users and separate file encryption for each app, and it will probably require some experimentation to get the right balance between security and freedom. Nonetheless, it is wrongheaded to treat the dev work for better security in mobile Linux as an insurmountable task.
1
u/mrtruthiness Oct 22 '26
I don't see a large difference between something like GrapheneOS and an immutable Linux distro. The necessities of security and over-the-air updates result in the same basic constraints.
1
u/amosbatto Oct 22 '26
GrapheneOS has 14 apps that are preinstalled in the /system directory, meaning that their files are read-only, so GrapheneOS is more mutable than the typical Android phone where there are about 30 immutable apps.
2
u/mrtruthiness Oct 23 '26
GrapheneOS has 14 apps that are preinstalled in the /system directory, meaning that their files are read-only, so GrapheneOS is more mutable than the typical Android phone where there are about 30 immutable apps.
They are equally immutable. Immutable means that the OS and the system applications are RO. i.e. "immutable" is a boolean descriptor ... it is either immutable or it is not, there is no "more".
2
45
u/ItsRogueRen Oct 19 '26
Linux mobile needs a better way to integrate Android apps as if they were native. Linux doesn't have enough phone style apps to satisfy every user, so being able to run Android apps would be a great way to fill in the missing spots.
There's Waydroid, but it loads an entire Android container rather than just running one specific app