Skip to content

Instantly share code, notes, and snippets.

@lymieux
Last active October 5, 2024 09:54
Show Gist options
  • Save lymieux/f821f0f0fbbe949cdabe0c28c36ed26f to your computer and use it in GitHub Desktop.
Save lymieux/f821f0f0fbbe949cdabe0c28c36ed26f to your computer and use it in GitHub Desktop.
Arch Linux Arm Desktop Instructions

Arch Linux Arm Desktop Environment Tutorial:


  • Tutorial on how to setup a desktop environment on Arch Linux Arm, specifically for the Raspberry Pi 3*
  • Any questions on the steps can be left on a comment, or checking the Arch Wiki
  • Newer kernel versions are being tested, as well as Wayland instead of X
  • If you have questions or errors, leave a comment! - moral-g

Boot:


lsblk
fdisk /dev/sdX

X filing in for lsblk output

  • Type o. This will clear out any partitions on the drive.
  • Type p to list partitions. There should be no partitions left.
  • Type n, then p for primary, 1 for the first partition on the drive, press ENTER to accept the default first sector, then type +200M for the last sector.
  • Type t, then c to set the first partition to type W95 FAT32 (LBA).
  • Type n, then p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
  • Write the partition table and exit by typing w.
mkfs.vfat /dev/sdX1
mkdir boot
mount /dev/sdX1 boot
mkfs.ext4 /dev/sdX2
mkdir root
mount /dev/sdX2 root
wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz
bsdtar -xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C root
sync

Move boot files to the first partition:

mv root/boot/* boot
sync
umount /dev/sdX*

Insert formatted SD card into the Raspberry Pi and power on Login to root [pw:root] (alarm [pw:alarm] doesn't have [doas|sudo|etc] yet)

Locale, keymap, timezone:


Edit the /etc/console.conf and set the following line accordingly (if unsure: localectl list-keymaps)

KEYMAP=us

Edit the /etc/locale.conf and set the following line accordingly (if unsure: cat /etc/locale.gen | less)

LANG=en_US.UTF-8  

Edit the /etc/locale.gen and uncomment the one specified in /etc/locale.conf (above) Finish with:

locale-gen

Run timedatectl set-timezone Zone/SubZone (if unsure: timedatectl list-timezones)

timedatectl set-timezone America/New_York

Pacman keyring initialization and population, as well as mirror:


pacman-key --init
pacman-key --populate archlinuxarm

Edit /etc/pacman.conf and uncomment or add the following lines:

SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional

Edit the /etc/pacman.d/mirrorlist and uncomment the wanted ones

Wi-Fi Setup (skip if using ethernet):


Wi-Fi setup Option 1: [easier but must be redo every reboot]

wifi-menu

Option 2: Edit the /etc/systemd/network/wlan0.network and add:

[Match]
Name=wlan0

[Network]
Description=On-board wireless NIC
DHCP=yes

Finish with:

systemctl restart systemd-networkd  

Edit the /etc/wpa_supplicant/wpa_supplicant-wlan0.conf and add:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=wheel
network={
     ssid="SSID"
     scan_ssid=1
     key_mgmt=WPA-PSK
     psk="PASSWORD"
}

Finish with:

systemctl start wpa_supplicant@wlan0.service
systemctl ENABLE wpa_supplicant@wlan0.service

IF WLAN0 DOES NOT SHOW:

rmmod brcmfmac && modprobe brcmfmac
reboot

Downloading [sudo|doas|etc] and other essentials:


Configure sudo, doas, or any root user pacakge for the users Make sure you exit and login to alarm [pw:alarm]

EVERYTHING FROM NOW WILL BE DONE IN DEFAULT USER 'ALARM': make sure you [sudo|doas|etc]

Changing the config.txt:


Edit the /boot/config.txt and make sure it contains:

dtoverlay=vc4-kms-v3d
disable_overscan=1

FROM THIS POINT IT IS RECOMMENEDED TO SSH INTO THE PI: FIND THE IP BY ip addr show wlan0 or ip addr show eth0

X-Server:


Update pacman and packages:

pacman -Syu

Once all are downloaded and installed, one more package:

pacman -S accountsservice

Add the correct permissions:

usermod -aG video,tty,audio alarm

Edit /etc/X11/Xwrapper.config, it must have:

allowed_users=anybody
needs_root_rights=yes

X-server is now done

Desktop and Window Manager:


Download and configure your Desktop Environment and Window Manager NO matter the DE or WM you must add:

Edit /etc/X11/xinit/xinitrc and add ):

xset s off
xset -dpms
xset s noblank

Copy system xinitrc to personal

cp /etc/X11/xinit/xinitrc ~/.xinitrc

Input troubles?:


Remove xf86-input-libinput and replace with xf86-input-evdev, DO NOT get rid of xorg if prompted:

sudo pacman -Rdd xf86-input-libinput
sudo pacman -Sw xf86-input-evdev
sudo pacman -U /var/cache/pacman/pkg/xf86-input-evdev-VERSION.pkg.tar.xz

Fin:


sudo reboot
@gearhead
Copy link

gearhead commented Nov 25, 2022

@lymieux I think something changed with Arch Arm. I had X11 working with my install and just tried this with a fresh SD card. After the reboot and typing xinit, I get a black screen and cannot switch to any vt with 'ctrl' 'alt' f2, etc. Still looking into this as your instructions had a few differences to my previous trial...

edit, had to add the fbdev driver and weston works, but X11 still shows a black screen pacman -Sy xf86-video-fbdev

@gearhead
Copy link

One more comment. Best I can tell as of now Nov 28 2022, the armv7 version is broken and displays a black screen when X11 is launched with xinit or startx. The aarch64 version with the rpi-linux package installed, though, works as advertised. Interestingly, it starts properly on aarch64 with and without dtoverlay=vc4-kms-v3d. Arch Arm has broken X11 with the armv7 code base, somehow. I thought I'd mention that weston/wayland works on armv7 as the basis of a desktop though that is not the focus of this gist.

@lymieux
Copy link
Author

lymieux commented Dec 17, 2022

One more comment. Best I can tell as of now Nov 28 2022, the armv7 version is broken and displays a black screen when X11 is launched with xinit or startx. The aarch64 version with the rpi-linux package installed, though, works as advertised. Interestingly, it starts properly on aarch64 with and without dtoverlay=vc4-kms-v3d. Arch Arm has broken X11 with the armv7 code base, somehow. I thought I'd mention that weston/wayland works on armv7 as the basis of a desktop though that is not the focus of this gist.

@gearhead Yes, there are some development problems with the armv7 version. Since Arch is rolling release, some of the packages I had to download from the Arch Rollback Machine, and the Rollback Machine that hosted the armv7 packages got shutdown and I am looking for something else. I got weston/wayland working thanks to your previous comment on a test Raspberry Pi, but like your said, the gits focuses on X11, which I'll update the instructions soon, given that I find the packages. Thanks

@gearhead
Copy link

gearhead commented Dec 18, 2022

If the rollback machine is not working, try this:
tardis
this guy keeps copies of most if not all packages for the arm packages. Even has old arm and armv6 from back before Arch discontinued them in Feb 2022.

@lymieux
Copy link
Author

lymieux commented Dec 18, 2022

If the rollback machine is not working, try this: tardis this guy keeps copies of most if not all packages for the arm packages. Even has old arm and armv6 from back before Arch discontinued them in Feb 2022.

Thanks!

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