Hear me out…
I am often representing with my Ubuntu Touch hat on in here, but this is more of a Halium-related topic. I want to start this discussion to fill some blanks and have a clear idea forward. Now bear with me.
On Ubuntu Touch we use something called Halium to make porting of Ubuntu to Android-based devices easy.
Something similar to this in the Snap realms would be cool.
I’ve formed opinions about feasibility of making an Ubuntu Core type of environment work with Android devices or Halium adaptations. There are some things we’re able to get away with on Ubuntu Touch that simply aren’t supposed to work in Ubuntu Core:
- Overlay device-specific files on top of the rootfs at runtime
- Ubuntu Touch follows the Android partitioning scheme
- Ubuntu Core enforces its own, incompatible partitioning scheme
- Reusing Android’s /vendor partition inside a confined snap environment?
There are more questions but these are enough for now.
On Touch we use a generic rootfs while the port maintainer ships files to overlay on top of the rootfs at boot & runtime. I cannot imagine a clear way to do this with Snaps at the moment.
For things like PulseAudio support we often rely on modules-droid compiled against the exact Audio HAL API of that /vendor partition. On Touch we ship them all and have the port maintainer specify the appropriate one as another Halium file overlay when defaults don’t suffice.
Regarding partitioning schemes: Since Android 9 we use something called “Binderized HALs” and rely on static partitions of the required Android generation to provide these + all required libraries in /vendor. These HALs run as processes inside of a LXC container, libs can be loaded by the host through libhybris.
I have no clear idea how to approach libhybris in a feasible way here. Shoutout if you have an idea.
In the end I aim at making a bootable “Halium-ified Snap” environment installable with regular Android partition tools like fastboot
. This would also mean the initramfs to be different from the Ubuntu Core one, since Halium requirements can dramatically differ from device to device.
Thank you!