• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

What's Inside the Black Box of Ubuntu Touch?

Scheduled Pinned Locked Moved General
49 Posts 9 Posters 10.0k Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U Offline
      UniSuperBox
      last edited by 30 Jan 2020, 01:53

      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

      1 Reply Last reply Reply Quote 1
      • R Offline
        rob
        last edited by 30 Jan 2020, 02:25

        @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?

        U 1 Reply Last reply 30 Jan 2020, 02:50 Reply Quote 0
        • U Offline
          UniSuperBox @rob
          last edited by 30 Jan 2020, 02:50

          @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.

          R 1 Reply Last reply 30 Jan 2020, 03:35 Reply Quote 0
          • R Offline
            rob @UniSuperBox
            last edited by 30 Jan 2020, 03:35

            @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?

            1 Reply Last reply Reply Quote 0
            • U Offline
              UniSuperBox
              last edited by 30 Jan 2020, 03:45

              @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

              1 Reply Last reply Reply Quote 0
              • R Offline
                rob
                last edited by rob 30 Jan 2020, 04:02

                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.

                D 1 Reply Last reply 30 Jan 2020, 16:21 Reply Quote 0
                • D Offline
                  dobey @rob
                  last edited by 30 Jan 2020, 16:21

                  @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+.

                  R 1 Reply Last reply 30 Jan 2020, 18:42 Reply Quote 0
                  • R Offline
                    rob @dobey
                    last edited by 30 Jan 2020, 18:42

                    @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 available

                    I 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,

                    D 1 Reply Last reply 30 Jan 2020, 20:29 Reply Quote 0
                    • R Offline
                      rob
                      last edited by 30 Jan 2020, 19:57

                      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.

                      D 1 Reply Last reply 30 Jan 2020, 20:33 Reply Quote 0
                      • D Offline
                        dobey @rob
                        last edited by 30 Jan 2020, 20:29

                        @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. Each gir1.2-foo package must be installed for the libraries you want to use in your app, if using python and gtk libraries.

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          dobey @rob
                          last edited by 30 Jan 2020, 20:33

                          @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 with ubuntu-app-launch on the command line.

                          1 Reply Last reply Reply Quote 0
                          • R Offline
                            rob
                            last edited by 30 Jan 2020, 20:45

                            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.

                            D 1 Reply Last reply 30 Jan 2020, 20:53 Reply Quote 0
                            • R Offline
                              rob
                              last edited by 30 Jan 2020, 20:48

                              On the Gobject installation, why did the apt install not automatically handle those dependencies?

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                dobey @rob
                                last edited by 30 Jan 2020, 20:53

                                @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 the ubuntu-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.

                                1 Reply Last reply Reply Quote 0
                                • R Offline
                                  rob
                                  last edited by 30 Jan 2020, 20:57

                                  @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..

                                  1 Reply Last reply Reply Quote 0
                                  • R Offline
                                    rob
                                    last edited by 30 Jan 2020, 21:04

                                    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.

                                    1 Reply Last reply Reply Quote 1
                                    • R Offline
                                      rob
                                      last edited by 30 Jan 2020, 22:53

                                      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.

                                      1 Reply Last reply Reply Quote 0
                                      • A Offline
                                        arubislander
                                        last edited by 30 Jan 2020, 22:57

                                        You are writing your own app, to run specifically in Libertine? To what effect?

                                        πŸ‡¦πŸ‡Ό πŸ‡³πŸ‡± πŸ‡ΊπŸ‡Έ πŸ‡ͺπŸ‡Έ
                                        Happily running Ubuntu Touch
                                        Google Pixel 3a (20.04 DEV)
                                        JingPad (24.04 preview)
                                        Meizu Pro 5 (16.04 DEV)

                                        1 Reply Last reply Reply Quote 0
                                        • R Offline
                                          rob
                                          last edited by 30 Jan 2020, 23:25

                                          @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..

                                          1 Reply Last reply Reply Quote 0
                                          • R Offline
                                            rob
                                            last edited by rob 31 Jan 2020, 00:29

                                            The other problem that makes it necessary to use the Libertine-Container is that even if I force a read-write on the main system, there's not enough space on /var/cache/apt/archives so you can't really even do much.

                                            And I'm only testing...

                                            Even doing a compile of one of the existing system apps like address-book-app will not work since there's no space to download a build system (perhaps this will not be a limitation on the pinephone since it won't have these specific android partitions)

                                            I realize that many things don't run on Libertine but if I know what the limitations are then it can be put to use. Yes it is pointless running GUI apps like Wireshark, Gimp, Libreoffice and such on it since it's not usable anyway.

                                            I know for example, that non-GUI apps made with Python run fine. Bash stuff runs fine. And that has value, particularly for cybersecurity.

                                            A 1 Reply Last reply 31 Jan 2020, 05:56 Reply Quote 0
                                            20 out of 49
                                            • First post
                                              20/49
                                              Last post