In part one you installed the base system and getting it bootable, this blog we are going into making it a usable phone.
Phosh can be installed using:
emerge --ask gui-wm/phosh-meta
Now start and enabled phosh and other services
1 2 3 4 5
systemctl --now enable seatd systemctl --now enable phosh systemctl --now enable eg25-manager systemctl --now enable NetworkManager #if not done before systemctl --now enable ModemManager
What is missing now is a onscreen keyboard.
I am using x11-misc/squeekboard but you can choose your own.
To install squeekboard just run
emerge --ask x11-misc/squeekboard
I have found some trouble intalling squeekboard so I've just build it myself.
First you need the emoticons package
emerge --ask media-fonts/noto-emoji
Then pull the git repo and compile the source.
1 2 3 4 5 6 7
$ git clone https://source.puri.sm/Librem5/squeekboard.git $ cd squeekboard $ mkdir _build $ meson _build/ --prefix=/usr/ $ cd _build $ ninja $ ninja install
To make sure it shows up enable gnome onscreen keyboard
gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true
afterwards make sure its configured for phosh.
Add the keyboard layout to the user (https://source.puri.sm/Li...ree/master/data/keyboards)
for the US version
1 2 3
cd $HOME/.local/share/squeekboard/keyboards #create if its not there yet wget https://source.puri.sm/Librem5/squeekboard/-/raw/master/data/keyboards/us.yaml wget https://source.puri.sm/mozzwald/squeekboard/-/raw/c1737c763f295e2a71f574d3d436ec7899adf9f1/data/keyboards/terminal.yaml
nano -w /etc/xdg/autostart/sm.puri.Squeekboard.desktop
1 2 3 4 5 6 7 8 9
[Desktop Entry] Name=Squeekboard GenericName=Squeekboard Virtual Keyboard Comment=Virtual Keyboard Exec=/usr/bin/squeekboard Terminal=false Type=Application NoDisplay=true Categories=GTK;Utility;
There are some pinephone applications that now needs installing you can just run:
emerge --ask app-mobilephone/pinephone
Ive installed these extra applications to make it more usable
emerge --ask media-sound/lollypop mail-client/geary media-plugins/gst-plugins-x264
Finding a good browser is crusial for a workable (smart)phone. There are two good options beside the default gnome webbrowser. You can try and compile Firefox or Chromium but they are very hefty compilations even with distcc on. I'm still trying to find a way to compile firefox without an error.
In the mean time I did find a good solution, a binary version of Chromium for arm64. It's part of the stha09 overlay, but I've also included it in my own overlay.
So what you can now do is simply run
emerge --ask www-client/chromium-bin
This installs the binary version of Chromium, from what I can tell this is still a very fast browser but without a very hefty compile time.
For Firefox a working compile I did was using the following
nano -w /etc/portage/package.use/firefox
www-client/firefox -clang hwaccel openh264 -screencast system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-web
Some applications are not really available so im using flatpak for those applications then you can install applications from flathub aswell.
emerge --ask sys-apps/flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
XMPP Client (Dino)
I myself use XMPP for some people so I can work around Facebook.
My prefered Linux client is Dino, wich at this moment is not native phone ready but there is a branch that is. So we need to build it ourself.
You can just download the zip file for the branch and then build it
1 2 3 4 5 6 7 8
pinephone /var/tmp # emerge --ask media-gfx/qrencode net-libs/libsignal-protocol-c pinephone /var/tmp # wget https://github.com/dino/dino/archive/refs/heads/feature/handy.zip pinephone /var/tmp # unzip handy.zip pinephone /var/tmp # cd dino-feature-handy/ pinephone /var/tmp # ln -s /usr/bin/valac-0.48 /usr/bin/valac pinephone /var/tmp/dino-feature-handy # ./configure --prefix=/usr/ pinephone /var/tmp/dino-feature-handy # make pinephone /var/tmp/dino-feature-handy # make install
In order to make the phone Daily useable alot of users will need andriod apps. We can use anbox for this but its not natively avalible for Gentoo so we need to build this ourself.
My experience is that anbox is very unstable, craches alot and apps dont always start. Its better to find alternative applications for the android apps then use anbox at the moment. But to give it a try I've included it in this blog.
If you followed part one you should have networkmanager installed, we can add the anbox network using that:
nmcli con add type bridge ifname anbox0 -- connection.id anbox-net ipv4.method shared ipv4.addresses 10.0.2.1/24
Edit two files to make sure lxc will work correctly
nano -w /etc/portage/env/remove-newsuidmap
nano -w /etc/portage/package.env/sys-apps_shadow-remove-newsuidmap
emerge -1 sys-apps/shadow
Afterwards install the following depencies
emerge --ask media-libs/sdl2-image app-emulation/lxc dev-libs/properties-cpp media-libs/glm dev-util/android-tools
Now download and build anbox
1 2 3 4 5 6 7
$ git clone https://github.com/anbox/anbox.git --recurse-submodules $ cd anbox $ mkdir build $ cd build $ cmake .. -DENABLE_WAYLAND="$(usex wayland)" $ make $ make install
I found that with GCC 10+ the tests break so what you can do is after step 2 is do
nano -w CMakeLists.txt
And then Comment line 141
Everythings once agian installs in /usr/local you can just move it to /usr yourself.
After you build anbox you need an android image and the startup scripts.
Download the image to /var/lib/anbox
Under dev create the binderfs directory
1 2 3
pinephone / # cd /dev/ pinephone /dev # mkdir binderfs pinephone /dev # mount -t binder none /dev/binderfs
You can add the followig to your fstab
none /dev/binderfs binder nofail 0 0
Next we need to create the services
nano -w /lib/systemd/system/anbox-container-manager.service
1 2 3 4 5 6 7 8 9
[Unit] Description=Anbox Container Manager Documentation=man:anbox(1) [Service] ExecStart=/usr/bin/anbox container-manager --daemon --data-path=/var/lib/anbox --container-network-gateway=10.0.2.1 [Install] WantedBy=multi-user.target
Start and enable the service
1 2 3
systemctl --now enable dnsmasq systemctl --now enable lxc systemctl --now enable anbox-container-manager
Create a second service
nano -w /etc/systemd/user/anbox-session-manager.service
1 2 3 4 5 6 7 8 9 10 11 12 13
[Unit] Description=Anbox Session Manager Documentation=man:anbox(1) After=basic.target Wants=basic.target [Service] ExecStart=/usr/bin/anbox session-manager --gles-driver=host Restart=on-failure RestartSec=5s [Install] WantedBy=graphical-session.target
and enable this service for the user
systemctl --user enable --now anbox-session-manager.service