Let's get the cellular modem working!
Created by: ollieparanoid
Here is research by @pavelmachek, @craftyguy and @tssk together with some of my own on how to continue with cellular modems in postmarketOS.
Possible stacks
- Usual Android stack (for reference):
modem -- proprietary-vendor-blob -- rild -- android-userland
- Samsung Androids with rild:
modem -- libsamsung-ipc -- Samsung-RIL -- rild -- ofono -- dbus -- networkd
- Samsung Androids without rild (dead end):
modem -- libsamsung-ipc -- ofono -- dbus -- networkd
Requires this ofono patchset, which only builds with the outdated libsamsung-ipc
1.x (we're at 3.x now).
(It needs a struct ipc_message_info
from a header file, that does not exist anymore, for starters. We would probably need to rewrite and upstream/maintain the whole patch!)
- N900 (already working!):
modem -- ofono (with patches) -- dbus -- networkd
Components
- modem: the hardware cellular modem (runs proprietary firmware, we can't change that now)
- oFono: almost every Linux phone project (Ubuntu touch, SailfishOS, ...) uses this program to talk to the modem. It translates the low-level stuff to a D-Bus API. It can talk to some modems directly, or indirectly via rild for example.
- rild: Android's radio interface layer implementation. It always works together with a vendor implementation, that accesses the hardware. The code seems to be pretty isolated from the rest of Android, and it is written in C/C++, so it should be possible to package it for pmOS. It even has tagged versions (for Android releases, but it's good enough).
- networkd: Something like NetworkManager or connman. NM is used by plasma-mobile, Ubuntu Touch/ubports and has great support for using a random MAC address. According to @craftyguy's research it isn't really documented how to use it with ofono though, while he got it working pretty well with connman instead.
- libsamsung-ipc, Samsung-RIL: both maintained by the Replicant project, basically the reverse engineered counterpart of the vendor RIL implementation.
Recommendations for next steps
-
Package rild
together with a custom OpenRC service file -
Package Samsung-RIL
, also with an OpenRC service file -
Make sure that ofono is working (there are ofono test scripts) -
Make sure, that a networkd is working -
Document the actual implementation in the wiki -
Close this ticket
What about other devices?
- For Androids, the tricky part is to have a FLOSS-pendant to the vendor implementation.
- When you have that, you can basically do the 2nd stack.
- Alternatively, find a patch that makes ofono directly talk to your modem.
- If none of these exist, you'll need to write the modem driver yourself.