Skip to content

Instantly share code, notes, and snippets.

@digitsensitive
Last active March 1, 2026 20:31
Show Gist options
  • Select an option

  • Save digitsensitive/19f0483e1ae12bb270bc7bf15c9d65e5 to your computer and use it in GitHub Desktop.

Select an option

Save digitsensitive/19f0483e1ae12bb270bc7bf15c9d65e5 to your computer and use it in GitHub Desktop.
Arch Linux ARM on Argon ONE UP CM5

Arch Linux ARM on Argon ONE UP CM5

Prepare SD-Card

Install Raspberry Pi OS (64-bit) f.e. via Raspberry Pi Imager on your SD-Card.

Prepare NVMe drive

Boot with the SD-Card inside Raspberry Pi OS. Open a Terminal.

lsblk

# look for your NVMe drive, f.e. nvme0n1

sudo fdisk /dev/nvme0n1

# Press d
# Press 1
# Press d
# Press w

export SDDEV=/dev/nvme0n1
export SDPARTBOOT=/dev/nvme0n1p1
export SDPARTROOT=/dev/nvme0n1p2
export SDMOUNT=/mnt/sd
export DOWNLOADDIR=/tmp/pi

# https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4
export DISTURL="http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz"

mkdir -p $DOWNLOADDIR
(
cd $DOWNLOADDIR && \
curl -JLO $DISTURL
)

sudo sfdisk --quiet --wipe always $SDDEV << EOF
,512MB,0c,
,,,
EOF

sudo mkfs.vfat -F 32 $SDPARTBOOT
sudo mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 -F $SDPARTROOT

sudo mkdir -p $SDMOUNT
sudo mount $SDPARTROOT $SDMOUNT
sudo mkdir -p ${SDMOUNT}/boot
sudo mount $SDPARTBOOT ${SDMOUNT}/boot
sudo tar -xpf ${DOWNLOADDIR}/ArchLinuxARM-rpi-aarch64-latest.tar.gz -C $SDMOUNT

sudo rm -rf ${SDMOUNT}/boot/*
sudo mkdir -p ${DOWNLOADDIR}/linux-rpi

cd "${DOWNLOADDIR}/linux-rpi" || exit 1

# https://archlinuxarm.org/packages/aarch64/linux-rpi
sudo curl -JLO http://mirror.archlinuxarm.org/aarch64/core/linux-rpi-6.18.12-2-aarch64.pkg.tar.xz
sudo tar xf linux-rpi-6.18.12-2-aarch64.pkg.tar.xz
sudo cp -rf boot/* "${SDMOUNT}/boot/"

cd - || exit 1
sync && sudo umount -R "$SDMOUNT"

Chroot into NVMe

sudo mount /dev/nvme0n1p2 /mnt

sudo mount --bind /dev  /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys  /mnt/sys
sudo mount --bind /run  /mnt/run

sudo mount /dev/nvme0n1p1 /mnt/boot

sudo chroot /mnt /bin/bash

# UPDATE /boot/config.txt
nano /boot/config.txt
# add under [all] the following:
# dtparam=nvme
# dtparam=pciex1_gen=3
# dtoverlay=dwc2,dr_mode=host
# dtparam=ant2

# UPDATE /etc/fstab
blkid
# remember the both PARTUUID

nano /etc/fstab
# edit the two <PARTUUID>
# PARTUUID=<PARTUUID>  /boot   vfat    defaults          0  2
# PARTUUID=<PARTUUID>  /       ext4    defaults,noatime  0  1

# UPDATE root device
nano /boot/cmdline.txt

# Edit the root parameter
# root=/dev/nvme0n1p2 rw rootwait console=serial0,115200 console=tty1 fsck.repair=yes

sync

exit
sudo umount -R /mnt
sudo mount /dev/nvme0n1p2 /mnt

sudo mount --bind /dev  /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys  /mnt/sys
sudo mount --bind /run  /mnt/run

sudo mount /dev/nvme0n1p1 /mnt/boot

# From Raspberry Pi OS terminal (not chrooted yet)
# First, back up the existing one in Arch (if any)
sudo mv /mnt/etc/resolv.conf /mnt/etc/resolv.conf.backup

# Copy the working one from Raspberry Pi OS
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf

# Then chroot as before
sudo chroot /mnt /bin/bash

# Repair installation
pacman-key --init
pacman-key --populate archlinuxarm
pacman -R linux-aarch64 uboot-raspberrypi --disable-sandbox
pacman -Syu --overwrite "/boot/*" linux-rpi-16k --disable-sandbox

sync

pacman -S networkmanager iwd --disable-sandbox

exit
sudo umount -R /mnt

Boot into NVMe

Shutdown. Remove the SD-card. Restart, it will boot into NVMe Arch Linux. Login with alarm, Password: alarm su -, Password: root

systemctl enable NetworkManager
systemctl start NetworkManager

nano /etc/NetworkManager/conf.d/wifi_backend.conf
# [device]
# wifi.backend=iwd
systemctl enable --now iwd
systemctl restart NetworkManager

# UPDATE /boot/config.txt AGAIN
nano /boot/config.txt
# add under [all] the following:
# dtparam=nvme
# dtparam=pciex1_gen=3
# dtoverlay=dwc2,dr_mode=host
# dtparam=ant2

nmcli radio wifi on
nmcli dev wifi list
# for network-ssid use the ssid name; alternative: use nmtui
nmcli --ask dev wifi connect network-ssid

# Install sudo and add alarm user to the Sudoers list
# Switch to root: su - (Password: root)
pacman -S sudo
# Open the configuration
EDITOR=nano visudo
# Search the line: # %wheel ALL=(ALL:ALL) ALL Remove the # at the beginning (Comment)
# Add your user to the group:
usermod -aG wheel alarm
# Logout or reboot

# Keyboard configuration
localectl set-keymap --no-convert <KEYMAP> (f.e. de_CH-latin1)

Now you can stick with this basic Arch Instance or Install a desktop environement like Xfce, Lxqt, labwc, sway etc. I would not recommend using hyprland, since it does need a lot of GPU/CPU resources, which is limitied on the CM5.

Have fun! :-)

References

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