What's Inside the Black Box of Ubuntu Touch?
-
@UniSuperBox This is great! Exactly the detail I'm looking for. Thanks!
-
By "Pine64's u-boot", I meant the one that all of us in the Pine64 community maintain together. All of the projects that are shared among almost all of the OSs are here: https://gitlab.com/pine64-org
-
@UniSuperBox didn't realize you were Dalton. Good to talk to you!
"PID 1 on an Ubuntu Touch system is Upstart provided by the 16.04 rootfs. Android runs in a lxc container."
You say Android runs in an lxc container. Is this what is referred to as the Halium container?
-
@rob, the stealth is not entirely accidental! I can turn on special badges, but prefer not to. Seems like a weird status symbol. Not having a profile picture is sloth, though.
Yes, that could be referred to as the Halium container I suppose. It's really just a stripped-down Android build with no Java stack, though. It exists to allow our software to communicate with Android Services (capital-S Services) through Unix domain sockets. The camera Service and rild (Radio Interface Layer Daemon) are two examples that we communicate to. Using these services directly allows us to reuse closed-source drivers from Android and bring up Ubuntu Touch on a variety of Android phones faster than if we had to reverse-engineer drivers.
-
@UniSuperBox LOL. I didn't identify myself here before either but someone outed me. Haha..,
The specific details of what you have to access with halium is definitely very interesting and I'll get to that! LOL. My focus right now is understanding the big picture (by understanding the detailed fundamentals). I'm not originally a Linux developer so some of the internal processes for each project are definitely illuminating.
So is the Pinephone Kernel an actual mainline image or is it custom-compiled by someone? And if so where did ubports acquire it?
-
@rob, the PinePhone's Linux kernel is tracked at https://gitlab.com/pine64-org/linux and compiled by GitLab CI for consumption. More information on how our images are built can be found in the README at https://gitlab.com/ubports/community-ports/pinephone
-
I see the familiar names now in that Kernel project! Thank you for passing that!
Now in an earlier question on the Libertine Container, you implied that there's more to running an application to just creating it in the Libertine-Container. And I've tried non-graphical python applications and they appear to work fine.
So back-pedaling here, I presume that the issue is the display server mapping from the container to Mir? This is clearly very vague to me.
Is there code that I can look at that shows what needs to be done, first in a manual way? 90% of the time adding a package from the Libertine UI doesn't tell me what's happening. It just stops without an error message so I prefer to install things manually so I understand what the limitations are.
For example, I've had issues running Python3 apps due to Gtk dependency issues. My guess is that Xenial doesn't support them. Although Xenial supposedly supports Gtk3, Python in Xenial does not.
If I can unlock the complexities of Libertine-Containers, a lot of people will start to see Ubuntu touch to be more open that it is perceived to be.
Right now, without full understanding, the difficulty in installing Desktop apps will push people to PostmarketOS since it won't have this lxc/chroot jail built in.
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
Although Xenial supposedly supports Gtk3, Python in Xenial does not.
It certainly does via https://packages.ubuntu.com/xenial/python3-gi though the necessary GObject Introspection libraries are probably not installed by default in the container, and if you haven't installed any apps via packages which depend on them in the container, you would need to install them manually to run your own python3 apps that use GTK+.
-
@dobey I converted my app to Python 2.7 for other compatibility reasons (with Xenial) but even after successfully installing gi and gobject, I get this error on my python program:
gi.require_version('Gtk',3.0)
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not availableI realize that it is recommended that I learn Qt/QML and rewrite the app but I was just testing what's possible on Libertine-Containers.
And so far I haven't had success using Libertine-Launch. I'm only starting things from bash within the container itself,
-
If running a GUI in a Libertine-Container, does it use Xmir or Xwayland or is there something else that has to be enabled on the host, after setting the DISPLAY environment variable? This is one of those Ubuntu specific things that just make it different and a little bit frustrating for those who don't know.
I've tried searching all over to understand this but there is so little documentation on this. And all I'm trying to do is demonstrate that I can make my own app only load it on my own phone.
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
ValueError: Namespace Gtk not available
Yes, this means that the package which provides the GObject Introspection code for GTK+ (
gir1.2-gtk-3.0
) is not installed. Eachgir1.2-foo
package must be installed for the libraries you want to use in your app, if using python and gtk libraries. -
@rob said in What's Inside the Black Box of Ubuntu Touch?:
If running a GUI in a Libertine-Container, does it use Xmir or Xwayland or is there something else that has to be enabled on the host, after setting the DISPLAY environment variable? This is one of those Ubuntu specific things that just make it different and a little bit frustrating for those who don't know.
Currently, Xmir is used, however, you cannot simply run GUI apps from the command line, such as just typing
firefox
as Unity 8 authenticates apps in a certain way. Xwayland will eventually replace Xmir, when Wayland replaces MirClient as the protocol used, and the work to make Xwayland work properly in Unity 8 is done. You will need a.desktop
file and icon, for any GUI app, and it will need to be started from the Unity 8 app drawer (or the legacy apps scope if using earlier versions), or withubuntu-app-launch
on the command line. -
Thank you @dobey. Everything I learn will be shared with others in a simplified way so please consider me a time investment for UT.
Is there further documentation on ubuntu-app-launch? I've been searching for this since early today and haven't found much.
Yes, I understand about handling .desktop which I can see is stored in the container in the regular /usr/share/applications.
Is this launch command handling the display server? Is the handling of Xmir/Xwayland (future) done automatically? Or do I have to do something else either on the host or in the container?
I'm seeing prompts for setting the DISPLAY env variable and I see a -E parameter. But the sparse documentation doesn't make it clear what I have to do.
-
On the Gobject installation, why did the apt install not automatically handle those dependencies?
-
@rob said in What's Inside the Black Box of Ubuntu Touch?:
Is there further documentation on ubuntu-app-launch? I've been searching for this since early today and haven't found much.
There is some API documentation for developers working on the system, but the
ubuntu-app-launch
tool itself is quite trivial. It only takes one argument, the appid that is being launched.ubuntu-app-launch-appids
will list the installed appids available to launch.@rob said in What's Inside the Black Box of Ubuntu Touch?:
Is this launch command handling the display server? Is the handling of Xmir/Xwayland (future) done automatically? Or do I have to do something else either on the host or in the container?
Xmir does not work in the same way that Xwayland does. A server is started for each X11 app that is being run (so that X11 apps cannot pry into the
$DISPLAY
and steal data from other X11 apps) with Xmir, while Xwayland has a single display server. Therefore, starting of Xmir for each app is handled by theubuntu-app-launch
code, hence why you need to launch GUI apps with it.@rob said in What's Inside the Black Box of Ubuntu Touch?:
On the Gobject installation, why did the apt install not automatically handle those dependencies?
Why should it, if you did not install anything which doesn't need them? As you are the developer in this case, you need to install the dependencies you need when developing an application. The libertine container doesn't know what you need in it, for your own code.
-
@dobey said in What's Inside the Black Box of Ubuntu Touch?:
Why should it, if you did not install anything which doesn't need them? As you are the developer in this case, you need to install the dependencies you need when developing an application. The libertine container doesn't know what you need in it, for your own code.
It's only a comment related to consistency between UT/Libertine-Container vs let's say an Ubuntu 18.04 desktop which is what I'm using. I documented the dependencies needed to install it on Ubuntu 18.04 and am discovering that it is differently packaged for UT. Maybe this is a 16.04 thing..
-
And the ubuntu-app-launch worked on something I installed from apt! Thanks! Slowly making sense.
My python app is still failing on some other aspect of gtk so I'll research that some more. But glad to have made some progress.
-
I moved now to a different approach which is to try to make a Python QT app. So I get the error:
This application failed to start because it could not find or load the Qt platform plugin "ubuntumirclient".Then I see that this is now deprecated and that this will replaced by Xwayland. But this is just a basic Qt app.
I can't even get a simple python Hello World in QT to work in a Libertine Container. That''s all I'm doing.
-
You are writing your own app, to run specifically in Libertine? To what effect?
-
@arubislander hi there! This is more than a simple attempt at making an app. This is a deeper attempt at uncovering how things work on UT. Given that the host system is locked down, the place to do anything else is in a Libertine-Container if that is doable.
This is part of an education series that I'm doing to get more people to appreciate UT (see this video https://youtu.be/rMmWmNyDKG8 )
Yes, I did write a cybersecurity GTK app that I'm sure can be made to run on PureOS on a Librem5 (I don't have one yet so I'm unable to try it). But it runs fine on any Gnome distro. Happy to convert it to QT as well though I have not used QT before.
I can tell you that people will migrate to PostmarketOS on a Pinephone if they can't figure out how UT works. So that is the bigger picture here.
Now for a personal use case, I can easily write things that I can find a purpose for without necessarily wanting to make some Openstore click package. As example, something for a cybersecurity purpose. So doing simple programs is something I expect I can do on any Linux device, for example, a Raspberry PI.
I realize that UT is a different animal but I'm just looking for a predictable behavior so I can push it in a positive way..