Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Arch RPi miscellany

Some notes on getting Arch to work on the RPi.

Rebooting

At first, running shutdown -r now would cause the RPi to halt but not restart. A firmware upgrade fixed this. Install git, then clone and run rpi-update. (The script requires git to run, so you can't just copy it from the repository.)

Pacman and udev

pacman used to complain about being out of date, and ask if I wanted to upgrade; and it would complain about udev-oxnas and systemd-tools both wanting to own udev. (I no longer remember exactly what the errors were.)

Saying yes when it asked to upgrade pacman didn't work, but explicitly upgrading with pacman -Sy pacman did.

To get rid of the udev error, run pacman -Syuf. It asks to replace some packages with others (in my case, libusb with core/libusbx, procps with core/procps-ng and udev with core/systemd-tools); say Y to each of these. It takes a few minutes to upgrade everything, but seems to fix the problem.

Inability to log in

At some point, my /bin/login file got deleted. This might have been from pacman -Syuf, but the time frame it might have happened in is too large to be confident of any specific cause.

The symptoms of missing login were that I would get a login prompt, but after entering my username, I wouldn't get a password prompt. Instead, a few seconds would pass and then the screen would reset to just the login prompt again. ps ax revealed that at these times, the agetty process was dying and getting restarted (which is performed by sysinit). (I could still log in through ssh, or I would probably have had no idea how to diagnose or fix the problem except by reinstalling.)

login is contained in the util-linux package, so I reinstalled that to fix the problem.

Playing music

Initially mplayer would print a load of errors and be silent. It turned out I needed to load a kernel module: sudo modprobe snd_bcm2835. To load it on boot, put it in the MODULES line of /etc/rc.conf: MODULES=(snd_bcm2835).

X

To get X working, I needed to install xorg-server and xf86-video-fbdev. I also installed awesome and rxvt-unicode. My .xinitrc file contains just the line exec awesome. Once awesome has started, pressing winkey-r brings up a prompt from which you can run programs.

X forwarding

Add the line X11Forwarding yes to /etc/ssh/sshd_config, and pass the -Y option to ssh when connecting.

I2C

To get I2C to work, you need to load the module i2c-dev (put it in the MODULES line of /etc/rc.conf to enable it from boot). This creates devices /dev/i2c-0 and /dev/i2c-1. The package i2c-tools contains programs for interfacing with them.

You might need a kernel update (available with rpi-update) to use this; I didn't realise I needed to load the module until after updating my kernel, so I don't know.

rpi-update and kernel modules

Arch seems to be in the process of moving kernel modules from /lib/modules to /usr/lib/modules, which seems to be nonstandard. rpi-update assumes /lib/modules, and this causes it to throw an error. (Specifically the error is thrown by depmod, but not explicitly labelled.) I got around this by editing the script and changing FW_MODPATH="${ROOT_PATH}/lib/modules to FW_MODPATH="${ROOT_PATH}/usr/lib/modules". You then need to call it with the environment variable UPDATE=0, because otherwise it self-updates and destroys your local changes.

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