Table of Contents

Arch on a Pi

Some random notes related to Arch Linux ARM on a Raspberry Pi. Some of these notes might be turned into their own page one day.

Blender

Installing from packages on RPi3

Blender is compiled for ARMv8 architecture only for AArch64.

See bottom of this page for the right archive to use at installation: https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3#installation

Rendering a default file seems to require xvfb:

xvfb-run blender -b -noaudio untitled_e.blend -o // -f 1

Compiling on RPi2

If it's still not in the repositories, here's a way to compile latest stable Blender for RPi2 Download these two files. And change these two lines from PKGBUILD:

arch=('i686' 'x86_64')
…
  make -j4 # -j5 needs 48 GB of RAM while -j9 needs 64 GB

into

arch=('armv7h')
…
  make -j2

This will get it compiled on the Raspberry Pi 2 itself. It will take a while ( couple hours ).

Installing server

As root

pacman -Syu nginx php-fpm

Start and enable nginx and php-fpm

systemctl start nginx 
systemctl start php-fpm
systemctl enable nginx
systemctl enable php-fpm

Check if it is serving the default pages, but it should be.

Change /etc/nginx/nginx.conf

user http;

server {
        listen       80;
        
        # watch out for the root location here, must be accessible from the user http
	root /srv/http; 

        location / {
            # add index.php to this line
            index  index.html index.htm index.php;
        }

        # pass the PHP scripts to FastCGI server listening on php-fpm.sock
        location ~ \.php$ {
            fastcgi_pass   unix:/run/php-fpm/php-fpm.sock; 
            fastcgi_index  index.php;
            include        fastcgi.conf;
        }

Installing ikiwiki

Install git and dev tools.

$: sudo pacman -Syu git base-devel

Install ikiwiki from Aur package.

You'll need 2 extra dependencies from Aur:

Install those first. Compiling ikiwiki takes a while on a Raspberry Pi. Be patient.

If you want to have images handle by the wiki, you will need also Imagemagick

Although ikiwiki could be running from any server, I found it easier to run it behind Apache. So be sure to have that installed.

Create an unprivileged user (here called wiki) who will be editing the wiki:

sudo useradd -m wiki
sudo passwd wiki

Following https://www.linode.com/docs/websites/wikis/ikiwiki-on-arch-linux/

Resizing a partition

Copied from http://raspberrypi.stackexchange.com/a/501

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        2048   206847   204800  100M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      206848 60588031 60381184 28.8G 83 Linux

Why This Works

Actually, when we delete a partition, we don't delete data, we just delete the reference to the partition in the partition table. By creating a new partition exactly from the same spot and of the same type, we keep the data but expanded the size to the full available space of the SD card.

By resizing (which is safe to run on a mounted disk), we tell the file system to use all the space in the new partition.

Python UnicodeEncodeError horror

So your Python script works on your machine. But when you port it to a freshly installed Arch Linux Arm on a Pi, all hell breaks loose as soon as a weird character pops up. Something like this shows up:

UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 227: ordinal not in range(128)

Well, don't start modifying your Python code (as you said, it does not have that problem on your machine). It's because the default locale of Arch Linux is LANG-C and what you want is UTF-8 support. There is many ways to solve this, including forcing Python to use a locale different from the system. But I like to have my systems with similar settings. So just follow tutorials here.