Arch ARM on Raspberry Pi 4
Raspberry Pi 4 uses an ARMv7 processor according to its /proc/cpuinfo file, although Wikipedia says that it is an ARM Cortex A72, which is an ARMv8 model. The v7 architecture is 32-bit architecture while the v8 is 64-bit. I don't know why they mix these two architectures, but presume that the 32-bit code can run on a 64-bit chip and point out my observations here for your awareness.
To find the Raspberry Pi 4 on the archlinuxarm.org site open Platforms, then ARMv8, the Broadcom, and you will see the Pi4 listed. The firmware for the Pi4 is, however, named
- Install the base O/S following the instructions at https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4
- Configure accounts
- log-in as alarm
- change the password
- log-in as root
- change the password
- create an account for yourself, including it in the wheel group or make a sudo group and put it in there.
- configure sudo to allow the wheel group using
visudo -f /etc/sudoers.d/my.rules
- If you are using the Pi with a computer monitor rather than a TV, or a TV that does not require over-scanning, then insert this into /boot/config.txt to get rid of the black border:
disable_overscan=1
Install common tools
Choose for yourself, but here's what I installed right away:
sudo su ← become root first, or else type sudo before every following command pacman -Syu pacman -S vim rsync tmux mlocate updatedb pacman -S base-devel unrar unzip subversion git gpm systemctl enable --now gpm
Install GUI desktop
pacman -S xorg xorg-fonts xorg-drivers xorg-apps xfce4 xfce4-goodies pulseaudio hunspell-en_GB firefox firefox-i18n-en-gb pavucontrol bluez python2-pybluez
In your unprivileged (normal) user account create .xinitrc to start XFCE:
vim ~/.xinitrc exec startxfce4
X should now start with the startx
command.
If you would prefer a graphical log-in then the LXDE Display Manager is a good light-weight choice:
pacman -S lxdm systemctl enable --now lxdm
Move root file system to a USB hard disk
I have tried several SD card brands with the Pi4 and they are all really slow and give time-out errors when updating the O/S. I found that using an external USB HDD improved the speed tremendously. A USB SSD would be even faster, but those require more power. I don't want to have to upgrade my power supply, so I used a spinning HDD instead of an SSD.
It is fairly quick to do this. Here are the basic steps:
- Plug both the SD card and the USB HDD into a desktop computer.
- Do not mount the HDD. If it automounts, then you will need to unmount it before formatting.
- Format the HDD to have a 4GB swap partition, a 30GB root partition, and the rest you can use for the /home directory or anything else you like. Using
fdisk
the commands would be roughly like this, assuming your USB HDD is sdX (which it is not, so change to suit your situation):fdisk /dev/sdX o ← write a new partition table n ← create a new partition p ← primary partition ENTER ENTER +4G ← make a 4GB swap partition t ← change type 82 ← change to Linux Swap n ← create a new partition p ← primary partition ENTER ENTER +30G ← make a 30GB root partition n ← create a new partition p ← primary partition ENTER ENTER ENTER (use the rest of the available space) t ← change type 8e ← change to Linux LVM w ← write changes and exit
- Format the swap space.
mkswap /dev/sdX1
Remember to replace X with whatever the USB drive letter is, e.g., sdb1. - Format the root space
mkfs -t ext4 -L PiRoot /dev/sdX2
Again, replace the X as appropriate in your case. - Mount the root partition, e.g.,:
mkdir /mnt/usbhdd mount /dev/sdX2 /mnt/usbhdd
Replace X with the actual drive letter. - Mount the SD card, if did not auto-mount when plugged-in, e.g.:
mkdir /mnt/sdcard mount /dev/mmcblkn0p1 /mnt/sdcard
Replace mmcblkn0p1 with the actual device name, if different, e.g., on my desktop it is /dev/sdl1. - Copy everything from the SD card to the HDD, e.g.,:
rsync -av /mnt/usbhdd/* /mnt/sdcard/
- Change the boot config.txt file on the SD card (the boot kernel etc. must remain on the SD card):
nano /mnt/sdcard/config.txt
Change where it saysroot=/dev/mmcblkn0p2
toroot=/dev/sda2
so it uses the HDD for everything other than /boot. - Unmount both.
umount /mnt/sdcard umount /mnt/usbhdd
- Plug both into the Pi and boot, see if it works! It should be much faster now.