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 a prebuilt 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 a tarball to your sdcard (ex: see 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.

The rpi-kernel packages for all raspberry variants are built from the raspberry foundation's kernel tree, which should enable you to use everything special like wifi and bluetooth.

RaspberryPi3: 32bit or 64bit ?

It is possible ( and to some extent advised ) to run the rpi2 images on you rpi3, as the rpi3's cpu supports both armv8 and armv7 instructions.

With the rpi2 image you obviously just get a 32bit armv7 system. That is totally fine in general and is what the popular raspbian does too. On the other hand, why did you buy a 64bit cpu in the first place? ;-)

Be aware that some packages are not available for armv7 (firefox) and others are not available for aarch64, so that might be a guide for your decision which one to pick.


Grab the latest platformfs tarball (containing the rootfs as well as architecture specific files) for your device from https://alpha.de.repo.voidlinux.org/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.

First Boot

The root password is voidlinux.

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 a NTP server and wait for the date to be set:

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

However, if you still encounter SSL related errors, it might be worth to reconfigure package chrony (xbps-reconfigure -f chrony) because some images tend to not create chrony user and group, often required by ntpd.


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.


To enable I2C, add "device_tree_param=i2c_arm=on to /boot/config.txt. Add bcm2708.vc_i2c_override=1 at the end of /boot/cmdline.txt.

If it doesn't exist, create the directory /etc/modules-load.d/ and in there, create the file i2c.conf with a line i2c-dev. Reboot.

Also, install i2c-tools package and try i2cdetect -l, it should show i2c-1i2c bcm2835 I2C adapter I2C adapter

Useful resources