xuv's notebook

Side notes, howtos and random bits of information related to Julien Deswaef's projects

User Tools

Site Tools


This is an old revision of the document!

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.

Compiling Blender

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


  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
  • Install Make
  • <code=bash>$: cpan</code>
  • Use Pacman with this Aur package

Resizing a partition

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

  • sudo fdisk /dev/mmcblk0
  • Type p to list the partition table
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
  • Take note of the start number for partition 2 (if that's the one you want to resize)
  • Type d to delete a partition.
    You will then be prompted for the number of the partition you want to delete. In the case above you want to delete partition 2.
  • Type n to create a new partition.
  • This new partition needs to be a primary partition so type p.
  • Next enter 2 when prompted for a partition number.
  • You will now be prompted for the first sector for the new partition. Enter the start number from the partition 2 you deleted before.
  • Next you will be prompted for the last sector you can just hit enter to accept the default which will utilize the remaining disk space.
  • Type w to save the changes you have made. (There will be some error showing saying: “Re-reading the partition table failed.: Device or resource busy”, but no worries).
  • Reboot the Pi: sudo reboot
  • Once the system has reboot and you are back at the commandline enter: sudo resize2fs /dev/mmcblk0p2 Note: this can take a long time (epending on the card size and speed) be patient and let it finish.
  • Reboot one more time.
  • You can now verify that the system is using the full capacity of the SD Card by entering the following command: df -h

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.

arch/arch_on_the_pi.1475855370.txt.gz · Last modified: 2016/10/07 17:49 by Julien Deswaef