So, you got one of 'dem new-fangled clicky Pi computers with RGB, and want to run AAAAAAAAAAAAAAAAAAAAARCH!!1! on it because you can't live without AUR? And what about BTRFS filesystem instead of the crusty olde ext4? And what about running it all from the included NVME storage instead of the unreliable SD-cards that tend to break after few months of medium usage?
Well then I have good news, so do I!
NOTE: This is not a basic ArchLinux install guide. This only covers necessary tweaks and screws to make sure it works. Once we are past that point, you are on your own. Sounds good?
NOTE NOTE: All commands are run as root user, in case it isn't obvious.
1. Flash Raspbian on an SD-card (whichever you prefer, I went with light variant and installed KDE Plasma on it for shits and giggles. It also sets expectations.).
2. Put the SD card into Pi and turn it on. It loads before NVME, so there's no need for you to press anything.
3. Once loaded, install GParted or any other disk partitioner you fancy and setup partitions like so:
512MB FAT32 where our bootloader and kernel will reside Rest of the space will go to btrfs4. Mount the BTRFS filesystem somewhere (/tmp/archlinux for example) and create subvolumes:
mount /dev/nvme0n1p2 /tmp/archlinux btrfs subvolume create /tmp/archlinux/@ btrfs subvolume create /tmp/archlinux/@home btrfs subvolume create /tmp/archlinux/@var btrfs subvolume create /tmp/archlinux/@var_log5. Once done, mount the subvolumes and our boot partition to prepare it for the Archening:
mkdir /mnt/arch/ mount -o subvol=@ /dev/nvme0n1p2 /mnt/arch mkdir -p /mnt/arch/{boot,home,var} mount -o subvol=@home /dev/nvme0n1p2 /mnt/arch/home mount -o subvol=@var /dev/nvme0n1p2 /mnt/arch/var mkdir -p /mnt/arch/var/log mount -o subvol=@var_log /dev/nvme0n1p2 /mnt/arch/var/log mount /dev/nvme0n1p1 /mnt/arch/boot6. Once all is mounted and ready, we can finally download Arch and extract it:
cd /mnt/arch wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz tar -xavf ArchLinuxARM-rpi-aarch64-latest.tar.gz7. Remove the content of /boot and replace with Pi Foundation kernel
rm /mnt/arch/boot/*Open this page and look for latest linux-rpi-16k package (this one was available at the time of writing).
http://mirror.archlinuxarm.org/aarch64/core/linux-rpi-16k-6.12.46-1-aarch64.pkg.tar.xzDownload and extract it somewhere (e.g. in your downloads directory), then copy the contents of boot folder into our Arch boot folder on NVME (don't worry about the other folders, this is mainly done to get necessary files there).
cp -rv (extracted folder)/boot/* /mnt/arch/boot8. Chroot time!
cd /mnt/arch mount -t proc /proc proc/ mount -t sysfs /sys sys/ mount --rbind /dev dev/ mount --rbind /run run/ rm etc/resolv.conf cp /etc/resolv.conf etc/resolv.conf # Needed, otherwise you won't get DNS resolution chroot /mnt/arch /bin/bash9. ArchLinux setup
From here, we essentially follow classic ArchLinux install with few differences.
# Setup root password, just in case. Once you are booted into GUI, you can remove it if you so wish.
passwdNow to setup keys and install 16k page kernel + bootloader
pacman-key --init pacman-key --populate archlinuxarm pacman -R linux-aarch64 uboot-raspberrypi pacman -Syu --overwrite "/boot/*" linux-rpi-16k linux-rpi-16k-headersWhy 16k you might ask? Added bonus performance. More about it here:
https://forums.raspberrypi.com/viewtopic.php?t=361390You'll see few errors when it's generating initcpios. Let's fix them by installing btrfs utilities:
pacman -S btrfs-progsvim /etc/locale.gen
# uncomment your preferred locale, I went with en_US.UTF-8 as my default.
/etc/locale.conf
LANG=en_USThen we must add btrfs module to mkinitcpio, otherwise we won't boot.
vim /etc/mkinitcpio.conf
Make sure to also remove kms from HOOKS, there are reports it causes problems, and also remove microcode as this is not used for Pi.
Once done, recreate the boot image.
There should be no errors afterwards.
Now onto fstab:
pacman -S arch-install-scripts vim # for convenienceGenerate fstab file itself.
genfstab -U / >> /etc/fstabThen open the /etc/fstab and remove few lines containing these lines:
/dev/mmcblk0p1 at the beginning, as ArchLinux for ARM makes an assumption it will run from SD-card by default. portal zram0# We must edit boot parameters
vim /boot/cmdline.txt
Replace root=PARTUUID with yours from the output of blkid, and add everything after rootfstype.
root=PARTUUID=b0323ab9-02 rw rootwait console=serial0,115200 console=tty1 fsck.repair=yes rootfstype=btrfs rootflags=subvol=@ brcmfmac.roamoff=1 brcmfmac.feature_disable=0x282000From this point, you can continue setting this up as a regular arch install. Feel free to install whatever desktop/WM you want from this point on. This is what I did to setup KDE Plasma and SDDM greeter.
Make sure to remove the default alarm user if you don't plan on using it and create your own.
pacman -S plasma-meta sddm konsole kate dolphin ark pipewire pipewire-jack networkmanager firewalld base-devel sudo htop git vulkan-broadcom chronyGrab some cup of java or some other preferred beverage and wait until this gets downloaded and installed.
Due to some issues with X server, sddm will be stuck with blinking cursor at boot.
We need to set it up to use Wayland.
mkdir /etc/sddm.conf.d/etc/sddm.conf.d/10-wayland.conf
[General] DisplayServer=wayland GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell [Wayland] CompositorCommand=kwin_wayland --drm --no-lockscreen --no-global-shortcuts --locale1Then enable the needed services to start at boot.
systemctl enable sddm.service systemctl enable NetworkManager.service systemctl enable chronyd.serviceDon't forget to setup timezone, it will save you some hassle later.
timedatectl set-timezone Country/CityAnd that's it. Disconnect from the chroot, unmount partitions, shut-down Pi, remove SD-card and boot into your fresh Arch install with some KDE goodness.
10. Profit.
You were expecting neofetch weren't you, you little rascal?
This guide was made with the help from similar guides for setting up Arch on Pi 5 that I shamelessly plagiarized took inspiration from and made few edits to make this possible.
https://kiljan.org/2023/11/24/arch-linux-arm-on-a-raspberry-pi-5-model-b/ https://github.com/literatesnow/pi-5-archlinux-arm-encrypted-root.png)




