Fixing mirrorlist on Arch Linux Arm (Raspberry Pi)

I hadn’t updated my Raspberry Pi (a B+ model for my rpi-drd project) in about a year. Pacman -Syu kept complaining about being unable to find files on any of the mirrors.

So I, without thinking, ran reflector on an x86 host and copied it over. Oops. Now it definitely can’t find packages.

The website gave me the hostname I needed, but not the entire URL. Put this in your mirrorlist (as the sole entry) to restore functionality:

Server =$arch/$repo

Raspberry Pi Robot – Assembly Part 1

So you’ve got a bunch of parts, assembly is pretty easy. I’m going to skip over most of the chassis assembly since it came with instructions, but I have a couple pointers and I’ll go over how I attached the encoders. Then I’ll talk about soldering the motor controller and wiring the encoders up, and which pins to pick from the GPIO of the Pi.

So this is what the chassis looks like fully assembled:

IMG_20141122_141839 Continue reading

Raspberry Pi – Cross-compiling

Now that you have the hardware built and tested (although that’s not necessary), you can either use the code I’ve written–which is specific to the hardware and environment I have, or compile your own version. If you want to compile your own there are two options:

  1. Compile on the Pi itself
  2. Compile on an ARM virtual machine
  3. Cross-compile on a faster machine

The trade off? Compiling on the Pi is slow (very slow). The virtual machine is a marked improvement for compiling speed, but is complicated to setup. Cross-compiling is about the same difficulty as setting up a virtual machine but a bit faster and less “bulky”. So it depends. The virtual machine is nice if you have a lot of libraries you want to use, since you’ll have to compile all of them to be available for linking. If any of them have poor autoconfig support, it might be a pain to fix if you weren’t already on the target machine. But, since I just needed one or two popular libraries, I decided to setup cross-compiling from my host (x86_64) machine.

The last time I setup cross-compiling it was on Gentoo, and it wasn’t pleasant. However, after a little bit of research it looks like the crosstool-ng project is pretty popular and useful. I only had to patch one tiny thing.

Here’s the overall process:

  1. Install crosstool-ng
  2. Configure a cross toolchain with it
  3. Try and build the toolchain
  4. Use the toolchain to build your Pi code

Continue reading