Raspberry Pi

From Void Linux Wiki
Jump to: navigation, search

Choosing the right file

As of 2017-11-30, Void Linux provides prebuild images as well as rootfs-tarballs. Compatible images and tarballs exist each for rpi1, rpi2 and rpi3, both in glibc and musl variant.

You can

  • either write the prebuild image directly to your sdcard (ex: dd if=<void-rpi.img> of=/dev/sdX bs=4M ; sync ), but that might give you a limited partition layout that has to be expanded manually afterwards
  • or prepare the partition layout of your sdcard manually and extract the tarball to your sdcard (ex: guide below)

After downloading the chosen file, make sure to check that sha256 is correct. The sha256 hash is stored in the sha256sums.txt file.

RaspberryPi3: 32bit or 64bit ?

It is possible ( and to some extent advised ) to run the rpi2 image on you rpi3, as the rpi2 images contain the official raspberry foundation's kernel image (https://github.com/raspberrypi/linux) and are therefore the most feature complete in regard to blobs, firmware and overall functionality. You just get a 32bit armv7 system. That is totally fine in general and is what the popular raspbian does too.

While you see images and tarballs labelled as "rpi3", you should be aware that those images contain the aarch64 (as in arm64) mainline linux kernel, which does not include the foundation's specific patches and blobs. Depending on your needs that may be ok for you, but some functionality is known to not work by now:

  • onboard wiFi
  • probably more...


Grab the latest platformfs tarball (containing the rootfs as well as architecture specific files) for your device from http://repo.voidlinux.eu/live/current/ ex: void-rpi2-musl-PLATFORMFS-<date>.tar.xz)

Preparing the SD card

The SD card must have at least 2 partitions, one as FAT (with partition type 0c!) for /boot and another one as ext4/f2fs for /; let's begin preparing the partitions and mounting them in a directory:

$ parted /dev/mmcblk0 <- change this to match your SD card

# Create the FAT partition of 256MB and make it bootable
(parted) mktable msdos
(parted) mkpart primary fat32 2048s 256MB
(parted) toggle 1 boot

# Create the rootfs partition until end of device
(parted) mkpart primary ext4 256MB -1
(parted) quit

Now let's create the filesystems in the SD card:

 $ mkfs.vfat /dev/mmcblk0p1 <- change this to match your SD card and FAT32 partition
 $ mkfs.ext4 -O '^has_journal' /dev/mmcblk0p2 <- change this to match your SD card and ext4 partition

The -O ^has_journal option disables journaling on ext4 partition. It'll extend the life of your drive (usually Flash drives).

Preparing target rootfs directory

 $ mkdir rootfs
 # mount /dev/mmcblk0p2 rootfs/
 # mkdir rootfs/boot
 # mount /dev/mmcblk0p1 rootfs/boot

Unpack the previously grabbed tarball into the target rootfs directory and sync to make sure files are written to storage:

 # tar xvfJp void-rpi*-PLATFORMFS-%DATE.tar.xz -C rootfs

 # sync
Do not forget to unpack the rootfs as root and with the -p flag to set appropiate permissions.

The /boot partition must also be added to /etc/fstab:

 # echo '/dev/mmcblk0p1 /boot vfat defaults 0 0' >> rootfs/etc/fstab

Umount the SD card filesystems from target rootfs directory.

You can tweak kernel boot cmdline arguments in the rootfs/boot/cmdline.txt file.

Insert the SD card and test the Raspberry PI boots correctly, the root password is voidlinux.

First Boot

Set the system time

Before it is possible to install or upgrade packages (ex: xbps-install -Su), it is necessary to set the clock. The Raspberry Pi does not have a battery backed clock so you must set the time manually or you will see HTTPS certificate errors.

Enable NTP server and wait for the date to be set

# ln -s /etc/sv/ntpd /var/services
# date
Sun Oct 29 09:21:49 CET 2017


At the very least this is the list of required packages:

# xbps-install -Sy xorg-minimal xf86-video-fbturbo

To install all X client applications:

# xbps-install -Sy xorg-apps

To install all X font packages:

# xbps-install -Sy xorg-fonts

As final step make sure the user running X is part of the groups audio and video.


Install the package via xbps-install(8):

# xbps-install -Sy ioquake-rpi

Copy .pk3 data files from original quake3 game or demo:

# For the system:
cp /path/quake3/*.pk3 /opt/ioquake3-rpi/baseq3/

# For just a normal user:
cp /path/quake3/*.pk3 ~/.q3a/baseq3/

If you do not have X installed just run SDL with the framebuffer video driver:



To get the soundchip to work, add dtparam=audio=on to /boot/config.txt


Enable serial console logins

 # mkdir ~/rootfs
 # mount /dev/sdX2 ~/rootfs
 # ln -s /etc/sv/agetty-ttyAMA0 ~/rootfs/etc/runit/runsvdir/default
 # umount ~/rootfs


  • See /boot/cmdline.txt for start-up configuration of serial port (device and baud)
  • See /etc/securetty for interfaces that allow root login, ttyAMA0 should already be listed.

Useful resources