We had a little chat with TheKit, who is known in the UBports community for his porting efforts.
Can you briefly introduce yourself?
I’m mostly known in the SailfishOS and UBports communities under my nickname, which can be TheKit, NotKit, or basically *Kit. My real name is Nikita, but I rarely use that except for official purposes. I’m from Russia, but have been a student in Hungary and currently live in Finland thanks to my job.
How did you become involved in the UBports community?
I’ve got into the UBports community shortly before the Ubuntu Touch project got abandoned by Canonical. Back then UBports was basically a group in Telegram and its name matched its purpose. I wanted to run Ubuntu Touch on one of my devices, which was the OnePlus 2. I got as far as getting the user interface to boot, but it was really far from a finished port.
Since then, a lot of things changed, but nonetheless I tended to be involved in various projects built to run with libhybris, such as SailfishOS and Ubuntu Touch. I even got it on postmarketOS together with X11 and the Maemo Leste user interface (something abandoned since then, unfortunately). My turning point was hanging together with UBports developers at FOSDEM back in 2019 and 2020 (right before this COVID madness) and finally finding some friends :).
You're trying to improve Halium and you have ported some Xiaomi devices to test your improvements. Can you tell us more about what you've been working on in Halium?
For a while, I didn’t like Halium. I found it overcomplicated to mimic what Canonical tried to do, and inferior to the mer-hybris tree based porting method of SailfishOS. It was pretty much possible to have a good community SailfishOS adaptation as long as you followed the Hardware Adaptation Development Kit (HADK) and got some help from amazing people at #sailfishos-porters. But we barely had daily driver-ready Ubuntu Touch ports except for core devices and the Xperia X (suzu) by Alfred.
Then it also got behind recent Android developments, with AOSP 8 and 9 released. That meant we couldn’t port any recent devices anymore, as they shipped with Android 8 and later 9. In my free time, I experimented with getting various components up-to-date so Ubuntu Touch could run on top of the Android 8 base. But these attempts were really hacky and often involved mixing mer-hybris parts instead of Halium to get something running.
In late 2019, I started to work as a freelance developer for Volla, and we made a prototypical port of SailfishOS for the Kickstarter campaign. Then in literally a few days I used pieces from my earlier independent attempts to boot Ubuntu Touch on the same device. This actually became featured in the campaign for the Volla Phone.
The need to streamline things became obvious both for community ports and the Volla Phone project to move forward, and Halium 9 started. It wasn’t a direct port of older Halium changes, but instead based on mer-hybris Android patches, getting them to run in an LXC container. Reaching some cleaner base that can be shared also helped to get other people involved (COVID-19 restrictions at the same time helped as well in some way :). Erfan Abdi stepped in, doing a monstrous effort to bring pieces together for his UBports GSI build that made it to being featured on XDA portal. He also worked on getting components such as the camera, media and fingerprint reader functional.
The rest of my Halium 9 efforts basically involved cleaning up earlier parts, improving the Volla Phone port, and working on a way to make device-specific ports easier. I did the latter by building only the kernel and overlays part, but keeping a generic Halium LXC container image instead of a device-specific systemimage (now colloquially known as GitLab CI ports). Independently from Volla, in October 2020 I started to work on porting Halium 9 changes to the Android 10 base (Halium 10). It was a smaller effort compared to what was needed for the jump from Halium 7 to 9. But it still took a considerable time, and we only start seeing some Halium 10 based ports on the Ubuntu Touch devices page, with some functionality yet to be improved.
Talking about Xiaomi devices, they were never my particular target. Usually I tried to source a device with a port started by someone else to test it and possibly help with remaining issues to get the device supported for OTA updates from UBports. But since they’re usually pretty cheap compared to other brands, it turned easy to get addicted to buying new devices :).
From a porting perspective, the good thing about Xiaomi devices is that they have little low-level modifications (as opposed to the custom MIUI interface) from the SoC vendor/ODM base. That means that if a component on the Ubuntu Touch side should work in general with a particular Android base, it works. And if it doesn’t, the issue is often not device-specific. The bad thing I need to warn anyone about before buying their devices: the tedious unlock procedure. This often requires you to wait at least a week to get the bootloader unlocked and you have to use their Windows-only tool (even if it’s in a VM).
What are you currently working on? Do you have any new developments in the pipeline?
The most recent thing I’m working on is Halium 11 to get support for devices released with Android 11 stock. It’s pretty limited so far, but I got the user interface to boot on a few devices. It’s not a high priority, but more in a “slow-cooking” mode to prepare a starting base. How fast it will advance depends on interest and efforts from other parties as well in my opinion.
What's the number one feature you'd like to add to Halium in the future?
My “dream” target is to avoid or minimize the need for device-specific adaptations. Since Google introduced the Treble architecture, it’s theoretically possible to have a single operating system image working on a wide range of devices that pass compatibility tests mandated by Google. The unofficial Phh-Treble AOSP builds by Pierre-Hugues Husson (phhusson) prove that it’s feasible. However, the problem for us is simply that Ubuntu Touch isn’t Android. We do some things differently, require a special kernel configuration, and that’s enough to break abstraction layers meant for Android. Yet improving compatibility with that hopefully will reduce the amount of work needed to bring Ubuntu Touch to each particular Android device.
What advice would you give to people who want to port devices to Ubuntu Touch? Where should they start? Do you have some tips?
If you want to port a new device, my best advice is to start getting familiar with the UBports Porting and Halium Telegram groups. It would be great if we had proper documentation, but unfortunately things change and get outdated pretty quickly. Don’t be afraid, state a device you want to port together with its codename and the earliest Android stock version it got released with. This information will help people in those groups to understand if it’s something feasible to port in the first place. And maybe they can send you a link to relevant information or any prior attempts.
It can come as a cold shower, but unfortunately not all devices are feasible to port. Under feasible I mean the possibility to get something usable for a daily driver with a reasonable amount of effort. Nowadays this would require something released with Android 8/9/10, with an unlockable bootloader (so sadly no Huawei or Nokia device) and the Linux kernel source provided by the manufacturer. The latter is a requirement for the manufacturer according to the GPLv2, but it’s virtually impossible to enforce this for a regular buyer.
When debugging something, before asking a question, it’s really a good idea to do a text search in the same groups to see if someone has encountered a similar issue to yours. It’s sometimes hard to keep track on who is porting what. So make sure to include that information (device, codename, Android/Halium base version) together with your question.
One more thing I want to mention is that contrary to some claims, porting does require a knowledge of programming. Not as much as to being fluent in any particular language (C/C++ are the most beneficial though), but as to understanding general principles. You have to be able to follow code flow to figure out the root cause for a particular problem. Just following guides and recommendations from the porting groups can get you pretty far, especially if having a common hardware target without too many device-specific issues. But often this is not enough for a fully functional port. Building a custom Android ROM can be as simple as putting a set of LEGO bricks together in the right order. If I continue with this comparison, the problem is that Ubuntu Touch is not Android, and sometimes we simply lack matching bricks. So a general understanding of development is required to fix underlying issues in the operating system itself and get “bricks” matching your particular situation.
What are some of your interests outside of Ubuntu Touch?
I can joke that I have no life, or otherwise I wouldn’t be here :). Besides Ubuntu Touch, as I mentioned earlier, I have been also involved in the SailfishOS community and currently work as a sailor at Jolla. In general, I like travelling and seeing around the world, but the current COVID-19 situation still makes this pretty hard. I’m also interested in Asian countries. I’m able to speak a bit of Chinese thanks to a year I’ve studied there as a student, and I’m currently studying Japanese.