Pleroma on the Steam Link
This is a little crappy doc about how to run Pleroma on a Steam Link. It only contains the initial steps to get everything ready for Pleroma.
- Root access
- A USB stick of at least 4GB
- You should know some bash scripting (I will give commands to setup and initial start, but not a script to start it when you restart your Steam Link)
- An internet connection (Prefer Ethernet, I haven't tried on Wi-Fi but it should work if you don't kill wpa_supplicant)
Setup a chroot environment
We will use ArchLinux ARM distro in a chroot environment
Here is a script to setup the usb stick (make sure that you plug the usb stick AND restart the Steam Link before continue)
#!/bin/sh # TODO: test this script mkdir -p /mnt/usb # Format the USB stick to use ext4 mkfs.ext4 /dev/block/sda1 # mount the USB stick mount /dev/block/sda1 /mnt/usb wget http://os.archlinuxarm.org/os/ArchLinuxARM-armv7-latest.tar.gz -O /mnt/usb/rootfs.tar.gz tar -xf /mnt/usb/rootfs.tar.gz -C /mnt/usb/ rm /mnt/usb/rootfs.tar.gz # The root home is /home/steam, create it to keep env variable clean mkdir -p /mnt/usb/home/steam # prepare stuffs to chroot mount -t proc proc /mnt/usb/proc/ mount -t sysfs sys /mnt/usb/sys/ mount -o bind /dev /mnt/usb/dev/ mount -t devpts devpts /mnt/usb/dev/pts/ chroot /mnt/usb /bin/bash
You are now in a chrooted environment, enjoy!
So first of all we will need to update the packages with
pacman -Syu (Ignore errors after the upgrading part, the kernel is just lacking things but those packages aren't used in our chroot env)
After that we need to install some requires things for pleroma, use
pacman -S base-devel postgresql elixir git ntp to install them.
Prepare the Steam Link environment
So first of all, our environment lacks things like :
- A UTF-8 locale (elixir is supposed to use UTF-8)
- A proper time (we are at the epoch for now)
- A system daemon (not really needed)
Setup the locale
Uncomment your favourite locale in "/etc/locale.gen" (en_US.UTF-8 for me) and trigger an update of the locales using
Finally update "/etc/locale.conf" with the value of the previously uncommented entry.
ntpdate -s time.nist.gov.
Setup and start Postgres
#!/bin/sh # Make sure that the home of postgres user is correctly setup (mine wasn't for some reasons :/) mkdir -p /var/lib/postgres/data chown -R postgres: /var/lib/postgres/ # Setup the /run/postgres directory (you can change the configuration later to point to /var/run if you feel it) mkdir /run/postgresql chown -R postgres: /run/postgresql/ # Create the postgres cluster su postgres -c "initdb -D /var/lib/postgres/data" # Start the db su postgres -c "pg_ctl -D /var/lib/postgres/data -l /var/lib/postgres/logfile start" #
Now we create the pleroma database. First we get a psql shell
su postgres -c psql
And we finally create the pleroma db and user
CREATE database pleroma; \c pleroma CREATE user pleroma; ALTER user pleroma with encrypted password '<your password>'; GRANT ALL ON ALL tables IN SCHEMA public TO pleroma; GRANT ALL ON ALL sequences IN SCHEMA public TO pleroma; CREATE EXTENSION citext;
Prepare and start Pleroma
Now you can follow the README on the Pleroma repository