UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Emanuele Sorce
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 24
    • Groups 0

    Emanuele Sorce

    @Emanuele Sorce

    mainly C and C++ programmer
    linux user.

    14
    Reputation
    464
    Profile views
    24
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online
    Website github.com/TronFourtyTwo
    Location Earth

    Emanuele Sorce Unfollow Follow

    Best posts made by Emanuele Sorce

    • Guide: set up a clickable working environment inside a LXC contiainer

      INTRODUCTION

      Clickable is the Brian Douglass' program to build, manage, install and in general develop for the Ubuntu Touch platform without the need of the whole ubuntu SDK.
      It can runs virtually in any linux environment, but like me maybe also you encoutered problems setting up it in your favourite distro; here I am going to guide you throught setting up it in a LXC container.
      In this way you aren't forced to change distro or run an expansive virtual machine, but you can use clickable almost like a native set up.
      In this guide I consider using the apt package manager. Adapt the 'apt-get' commands to your circustances.

      SET UP LXD

      We are going to use an ubuntu 16.04LTS container. To use it we have to install lxd, the lxc container hypervisor deamon. With the following command:
      "sudo apt-get install lxd"
      You could be on a distro which hasn't in the repository LXD. No problem, if your distro supports snap packages you can install the snap version of LXD.
      I used the snap package to achieve the final result, but I suggest use your distro LXD package if you can. So first install snapd, then install LXD snap:
      "sudo apt-get install snapd"
      "sudo snap install lxd"
      Here is a deeper guide about the LXD snap package: https://stgraber.org/2016/10/17/lxd-snap-available/. If your are going to use the snap package, take a look there.
      Now we have lxd installed, let's configure it:
      "lxd init"
      Just press enter until the end for a standard set up.
      Troubleshooting:
      if you stumble in any strange error when running lxd commands, check if your user is in the lxd group, if not add yourself there:
      "usermod -a -G lxd username"
      Another common issue could be to not have the lxd daemon running; if so just run:
      "sudo systemctl start lxd.service"

      SET UP THE CONTAINER

      Now we'll set up the ubuntu container:
      "lxc launch ubuntu:16.04 best_container_name_ever"
      and lxc will automatically download and set up our new container.
      Before enter the new environment, we need to change some container policy option to enable nested lxc container creation:
      "lxc config set best_container_name_ever security.privilegied true"
      "lxc config set best_container_name_ever security.nesting true"
      now we are ready to enter the matr...emm shell of our ubuntu container:
      "lxc exec best_container_name_ever -- /bin/bash"

      INSIDE THE CONTAINER

      Inside the container we have to do basically three things: basic configuration of the system, creation of a new not-root user and configuring clickable.
      First of all we need some basic utility:
      "apt-get update"
      "apt-get install nano sudo git"
      These packages may be already installed, but who know?
      Next step is to configure a not root user. These commands should work, but I haven't tested them:
      "useradd mr_nice_guy"
      "passwd mr_nice_guy"
      Enable him to run sudo
      "usermod -a -G sudo mr_nice_guy" // (Maybe this is not the most clean way to do it?)
      Now we are ready to being the nice guy.
      "su mr_nice_guy"
      Step in our home directory
      "cd"
      Let's install and configure LXD. See the previous 'SET UP LXD' section, here is the same story.

      CONFIGURE CLICKABLE (INSIDE THE CONTAINER)

      Here we are! Let's eventually download clickable:
      "git clone https://github.com/bhdouglass/clickable.git"
      Let's enter the master directory. Here we need to install the usdk-target executable to be able to run it.
      Inside the container we need to run sudo with the '-S' option, because without it will fail.
      "sudo -S cp usdk-target /bin"
      "sudo -S cp usdk-target /usr/bin"
      "sudo -S cp usdk-target /usr/sbin"
      "sudo -S cp usdk-target /sbin"
      I copyied it into all the four directoryes because I don't know in which one I should copy it; it's a quick-and-dirt solution, but I am too lazy.
      Now we need to patch the clickable executable. I said before that in this environment we have to run sudo with the '-S' option.
      "nano clickable"
      Look for the line:
      "subprocess.check_call(shlex.split('sudo {} usdk-target create -n {} -p {}'.format(env, name, fingerprint)))"
      And add the -S option. Here it is the result:
      "subprocess.check_call(shlex.split('sudo -S {} usdk-target create -n {} -p {}'.format(env, name, fingerprint)))"
      Save with CTRL-O and exit nano.
      You have succeffully set up clickable inside an lxd container!
      Now you can run clickable inside the lxc container like a charm without problems: see the clickable README for informations.
      Note that canonical server might not work, you can tell clickable to use a different image server with the 'USDK_TEST_REMOTE' environment variable.

      FINAL THOUGHTS
      Clickable is a wonderful tool to develop app for ubuntu touch, thanks Brian Douglass and all the devs for manteining it and for all the help they gave me 😄
      If you see any error or incongruence in this guide, please point it out, I'll be happy to correct, expand the guide or just help you.
      Good coding everyone!!!

      edit: fixed a typo

      posted in App Development clickable
      Emanuele SorceE
      Emanuele Sorce
    • RE: Welcome to the UBports community! Introduce yourself here!

      Hi all! I am a C, C++ and basic javascript, QML and HTML programmer. I own a bq E5 since OTA 7. I am currently learning the ropes of ubuntu touch developing to make an app(s) soon

      posted in General
      Emanuele SorceE
      Emanuele Sorce
    • RE: Libreoffice

      Check out the wiki article I written about it:
      here

      posted in General
      Emanuele SorceE
      Emanuele Sorce
    • RE: Guide: set up a clickable working environment inside a LXC contiainer

      I moved the guide to the wiki, where could be accessed, expanded and corrected with more ease: https://wiki.ubports.com/wiki/Set-up-a-Clickable-working-environment-inside-an-LXC-container Refer to it to have an updated guide

      posted in App Development
      Emanuele SorceE
      Emanuele Sorce
    • RE: Fantastic job so far. Few questions

      @ControlledCorpse
      Just install the Desktop App Scope from the Canonical scope, and you will see your installed apps there

      posted in General
      Emanuele SorceE
      Emanuele Sorce
    • RE: Guide: set up a clickable working environment inside a LXC contiainer

      @wgarcia @NeoTheThird
      You're welcome

      posted in App Development
      Emanuele SorceE
      Emanuele Sorce
    • RE: Guide: set up a clickable working environment inside a LXC contiainer

      Good guide 🙂 . Would be nice to have it in the ubports wiki...

      posted in App Development
      Emanuele SorceE
      Emanuele Sorce

    Latest posts made by Emanuele Sorce

    • RE: T-Shirt Slogan Competition!!

      Ubuntu Touch
      Free as in yours

      posted in Marketing Incubator
      Emanuele SorceE
      Emanuele Sorce
    • RE: libertine

      @Macadam About the Sturm Reader margin issue, the size of the margin is a setting you can adjust in the book style settings (the button at the bottom of the book page swiping up). Maybe it has been set to a too big value?

      posted in Support
      Emanuele SorceE
      Emanuele Sorce
    • RE: libertine

      If your goal is to read e-books on Ubuntu Touch, have you tried the native reader applications in the Open Store such as Sturm Reader or EPubViewer?

      posted in Support
      Emanuele SorceE
      Emanuele Sorce
    • RE: Arm64 apps and testing

      @AppLee thank you!

      posted in App Development
      Emanuele SorceE
      Emanuele Sorce
    • RE: Arm64 apps and testing

      Hi all!
      Looks like my app Sturm Reader crashes on start on arm64 devices... Maybe it is because I still use the old com.canonical.Oxide API. If someone with a arm64 device could download it from the Open Store and send me logs would be amazing!!! Thanks 🙂

      posted in App Development
      Emanuele SorceE
      Emanuele Sorce
    • RE: Development testers for Anbox

      Just followed the procedure on my OPO and it has gone flawlessly! Apps don't launch always, thought. I once opened the settings app successfully, but now every app crashes right after lauching.

      posted in OS
      Emanuele SorceE
      Emanuele Sorce
    • RE: Can't install Ubuntu Touch/Ubports on Nexus 7 flo.

      @Stefano said in Can't install Ubuntu Touch/Ubports on Nexus 7 flo.:

      block

      Have you tried to change the usb cable?

      posted in Support
      Emanuele SorceE
      Emanuele Sorce
    • RE: Fantastic job so far. Few questions

      @ControlledCorpse
      Just install the Desktop App Scope from the Canonical scope, and you will see your installed apps there

      posted in General
      Emanuele SorceE
      Emanuele Sorce
    • RE: I need help reorganizing the Wiki

      @UniSuperBox
      If we are going to move to ReadTheDoc and remove the current wiki, I think is better to go with ReStructuredText straight to RTD.

      posted in General
      Emanuele SorceE
      Emanuele Sorce
    • RE: I need help reorganizing the Wiki

      I think you are right planning to reorganize the wiki. I think I will help if you like.
      Your sheme is the more logical solution as far as I can say. Anyway, I would add a section like "Daily Use" or something like that, oriented to non-developer users where is explained how to use non-obvious features of ubuntu touch (like for example the already existent guides about CalDav and Libertine). Maybe that is supposed to be the "Documentation" section?

      posted in General
      Emanuele SorceE
      Emanuele Sorce