Skip to content

Instantly share code, notes, and snippets.

@nnathan
Last active August 15, 2024 03:20
Show Gist options
  • Save nnathan/b9bf08a085384eb36415850452c79d16 to your computer and use it in GitHub Desktop.
Save nnathan/b9bf08a085384eb36415850452c79d16 to your computer and use it in GitHub Desktop.
Install Arch Linux ARM (alarm) on Raspberry Pi 4 B (2024 Edition)

As of 2024-08-05 the installation instructions to install Arch Linux ARM on pi 4 doesn't work.

This is my version, with the added bonus of using btrfs instead of ext4 so you can get data checksumming, subvolumes, and compression.

If you want bcachefs flavour of these instructions click here.

Arch Linux ARM (aarch64) installation for Raspberry Pi 4 with btrfs

  1. Start cfdisk to partition the drive: cfdisk /dev/sdX.
  2. Create a dos partition table (my understanding is gpt doesn't work at this time).
  3. Press New, Partition Size 512M, press primary, and set type to c W95 FAT32 (LBA).
  4. Select "Free Space", and press New, use the suggested size which is remainder of space, press primary, and type should already be set to Linux.
  5. Press Write and confirm the prompt.
  6. Create and mount the FAT filesystem:
mkfs.vfat /dev/sdX1
mkdir /mnt/sdcard-boot
mount /dev/sdX1 /mnt/sdcard-boot
  1. Create and mount the btrfs filesystem (you will need btrfs-progs):
mkfs.btrfs /dev/sdX2
mkdir /mnt/sdcard-root
mount /dev/sdX2 /mnt/sdcard-root
btrfs property set /mnt/sdcard-root compression zstd # (optional)
  1. Download and extract the root filesystem (as root, not via sudo):
wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz
bsdtar -C /mnt/sdcard-root -vxpf ArchLinuxARM-rpi-aarch64-latest.tar.gz
sync
  1. Patch the bootloader (this deviates from the instructions); you will need uboot-tools -- see last post in this forum post and also this post
(nano/vim/whatever) /mnt/sdcard-root/boot/boot.txt   # find the `booti` lines and change `${fdt_addr_r}` to `${fdt_addr}`
( cd /mnt/sdcard-root/boot; mkimage -A arm -T script -O linux -d boot.txt boot.scr; )
  1. Move boot files to the first partition:
mv /mnt/sdcard-root/boot/* /mnt/sdcard-boot/
sync
  1. Unmount the two partitions:
umount /mnt/sdcard-root /mnt/sdcard-boot
  1. Insert the SD card into the Raspberry Pi, connect ethernet, and apply 5V power.
  2. Use the serial console or SSH to the IP address given to the board by your router.
  • Login as the default user alarm with the password alarm.
  • The default root password is root.
  1. Initialize the pacman keyring and populate the Arch Linux ARM package signing keys:
pacman-key --init
pacman-key --populate archlinuxarm

Note: we ignore the instruction from the official Arch install of changing mmcblk0 to mmcblk1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment