Starting Development on the Nexus 5 - Basic Questions Within



  • Hi All!

    I got Convergence working (a decent connector will do that, apparently!) and am excited to play around with my new ultra-ultra-portable device.

    The first thing I'd like to do is write some simple scripts, and to do that I need to have my source control running. I know it's generally against the rules to apt-get install git, but I'm not familiar with libertine containers. How do I get basic cli tools running in libertine containers, or is there a better way to do this?



  • Really, you just create the container, and then you can apt install anything in the Ubuntu repository that's built for armhf, in that container.

    You can run a shell inside the container, and do whatever you want within it, for the most part, as if it were a traditional Linux distro install. Do not instlal the sudo package or attempt to use it though. It's not necessary as the container is unprivileged.



  • Hi @TimWinter,

    I have written a guide (for myself as reference actually) that walks through creating a container and installing some command line tools. I have copied some of the info under here. I assume an adb shell connection to the device:

    First you create your container. I am calling mine Xerus and giving it the id xenial:

    $ libertine-container-manager create-container -i xenial -n "Xerus"
    

    This might take a while to complete. Next install the command line tools we want to use in the newly created container.

    $ libertine-container-manager install-package -i xenial -p git
    $ libertine-container-manager install-package -i xenial -p screenfetch
    

    To invoke the tools use libertine-launch. I will illustrate with screenfetch:

    $ libertine-launch -i xenial screenfetch
    : DISPLAY environment variable not set!
    [[ ! ]] awk: fatal: cannot open file `/sys/devices/system/cpu/cpu0/
    cpufreq/scaling_max_freq' for reading (Permission denied)
                              ./+o+-       phablet@android
                      yyyyy- -yyyyyy+      OS: Ubuntu 16.04 xenial
                   ://+//////-yyyyyyo      Kernel: aarch64 Linux 3.10.93+
               .++ .:/++++++/-.+sss/`      Uptime: 2m
             .:++o:  /++++++++/:--:/-      Packages: 679
            o:+o+:++.`..```.-/oo+++++/     Shell: 21829
           .:+o:+o/.          `+sssoo+/    CPU: MT8163
      .++/+:+oo+o:`             /sssooo.   RAM: 1324MiB / 1962MiB
     /+++//+:`oo+o               /::--:.  
     \+/+o+++`o++o               ++////.  
      .++.o+++oo+:`             /dddhhh.  
           .+.o+oo:.          `oddhhhh+   
            \+.++o+o``-````.:ohdhhhhh+    
             `:o+++ `ohhhhhhhhyo++os:     
               .o:`.syhhhhhhh/.oo++o`     
                   /osyyyyyyo++ooo+++/    
                       ````` +oo+++o\:    
                              `oo++.      
    

    You can optionally add aliases to the commands you install in the container in your ~/.bash_aliases file:

    alias git='libertine-launch -i xenial git'
    alias screenfetch='libertine-launch -i xenial screenfetch'

    Hope this helps



  • The part with the aliases is clever.



  • @arubislander said in Starting Development on the Nexus 5 - Basic Questions Within:

    You can optionally add aliases to the commands you install in the container in your ~/.bash_aliases file:
    alias git='libertine-launch -i xenial git
    alias screenfetch='libertine-launch -i xenial screenfetch

    nice :) https://github.com/ubports/docs.ubports.com/pull/148


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.