Pleroma on the PYNQ Z1

Wim Vanderbauwhede edited this page May 16, 2018 · 6 revisions

Pleroma on PYNQ-Z1

The PYNQ-Z1 is a board with a Xilinx Zynq chip, an FPGA-based System-on-Chip with a 650MHz dual-core Cortex-A9 and 512MB RAM.

PYNQ-Z1 board

This system does not have enough memory to run Mastodon but enough to run Pleroma. Please read my other guide, Mastodon and Pleroma on the Raspberry Pi 3 first for links and details on installing Pleroma.

The system runs Ubuntu 15.10 "Wily" for arm64. This is alas not an LTS release, its End of Life was July 28, 2016. Cue lots of problems ...

In the end I got what I needed by combining wily, wily-updates with jessie-backports. TIL: Ubuntu Wily and Debian Jessie are basically the same.

Accessing PYNQ over Ethernet

  • The Ethernet device of the board has a fixed IP address There is no WiFi.


The default account is xilinx, password xilinx, but I disabled SSH access for that one and created a separate development account wim and an account pleroma.

Distro Problems

The problem is that the Ubuntu release shipped with the board (15.10 'Wily') is no longer in the standard apt-get repo as it is too old. I eventually figured out that the file /etc/apt/sources.list.d/multistrap-wily.list should look like the following:

deb [arch=armhf] wily universe main
deb-src wily universe main
deb [arch=armhf] wily-updates universe main
deb-src wily-updates universe main

Furthermore, as detailed below, you also need /etc/apt/sources.list.d/erlang-solutions.list:

deb jessie contrib

And also the Jessie backports as /etc/apt/sources.list.d/postgres-jessie-backport.list:

deb jessie-backports main

Make sure to run apt-get update before installing any package. In principle, this should solve all your distro problems; if not, read on.

Git Cert problem!

Problem: missing CAcert root certificate.

Solution from here -- but DON'T DO THIS, IT'S A RED HERRING!

  • Create a directory in which to store the CAcert certificate files.
    sudo mkdir /usr/local/share/ca-certificates/
  • Download the root certificates from the cacert website.
    sudo wget -P /usr/local/share/ca-certificates/
  • Update the certificate bundle
    sudo update-ca-certificates
    git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt

But the actual reason for the problem was ...

Date not set correctly!

  • Setting the date:

    timedatectl set-ntp false
    timedatectl set-time 14:55:00
    timedatectl set-time 2017-12-12
    timedatectl set-ntp true
    timedatectl status
  • Still not OK, could not restart the sync service. Conflict with ntpd. Solution:

    apt purge ntp
    systemctl start systemd-timesyncd
    systemctl status systemd-timesyncd
    systemctl list-unit-files | grep sync
  • Finally OK!

Elixir is too old!

apt-get install update-manager-core

=> No good!

So I tried by adding Debian Jessie packages for erlang and elixir, as /etc/apt/sources.list.d/erlang-solutions.list:

deb jessie contrib


apt install elixir

=> That seems to have worked.

But then some mix build failed!

apt install erlang-dev 

=> still not OK

apt install erlang-parsetools

=> OK, all seemed well

But in the end we were still missing something:

apt install erlang-xmerl

=> And then it works!

PostgreSQL woes!

Creating the PostgreSQL database for Pleroma:

su postgres -c psql
CREATE USER pleroma;
CREATE DATABASE pleroma_dev;
ALTER user pleroma with encrypted password 'pleroma';
GRANT ALL ON ALL tables IN SCHEMA public TO pleroma;
GRANT ALL ON ALL sequences IN SCHEMA public TO pleroma;

Then run the script generated by the build, it basically changes the password

mix ecto.migrate
mix phx.server
  • So now I get a database syntax error. So I tried a clean slate: delete user & db, fresh cloned repo. No joy. Turns out I need a more recent postgresql than the one in Wily.
  • Tried do-release-upgrade, FAIL.
  • Finally after much trouble installed postgresql-9.6 from using dpkg -i to install the .deb files. I forgot but I guess I might have needed apt-get install -f afterwards.

I added the Jessie backports as /etc/apt/sources.list.d/postgres-jessie-backport.list:

deb jessie-backports main
  • And now it works!

Saving memory

By default the PYNQ runs Samba for file sharing and Jupyter Notebooks. These us a lot of memory, so I killed them.

systemctl stop smb*
killall python3.6 or use kill -9 PID

As far as I can tell Pleroma uses only about 50MB, the rest is mainly PostgreSQL.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.