Q: Where do I start?

The project provides development and test environments for lots of different hardware platforms, based on busybox and uClibc and configured to run under QEMU.

Most people want to do one of three things:

For the first two, the downloads/binaries directory has all the prebuilt binaries for the current release.

For the third, go to the downloads directory and grab a release tarball, or else look at the mercurial archive to grab the latest development version out of source control. (If you don't want to mess with mercurial, you can grab a tarball of the current code at any time.

If all else fails, look at the pretty screenshots.

Q: ./run-emulator.sh says qemu-system-$TARGET isn't found, but I installed the qemu package and the executable "qemu" is there. Why isn't this working?

A: You're using Ubuntu, aren't you? You need to install "qemu-kvm-extras" to get the non-x86 targets.

The Ubuntu developers have packaged qemu in an actively misleading "interesting" way. They've confused the emulator QEMU with the virtualizer KVM.

QEMU is an emulator that supports multiple hardware targets, translating the target code into host code a page at a time. KVM stands for Kernel Virtualization Module, a kernel module which allows newer x86 chips with support for the "VT" extension to run x86 code in a virtual container.

The KVM project started life as a fork of QEMU (replacing QEMU's CPU emulation with a kernel module providing VT virtualization support, but using QEMU's device emulation for I/O), but KVM only ever offered a small subset of the functionality of QEMU, and current versions of QEMU have merged KVM support into the base package. (QEMU 0.11.0 can automatically detect and use the KVM module as an accelerator, where appropriate.)

It's a bit like the X11 project providing a "drm" module (for 3D acceleration and such), which was integrated upstream into the Linux kernel. The Linux kernel was never part of the X11 project, and vice versa, and pretending the two projects were the same thing would be wrong.

That said, on Ubuntu the "qemu" package is an alias for "qemu-kvm", a package which only supports i386 and x86_64 (because that's all KVM supports when running on an x86 PC). In order to install the rest of qemu (support for emulating arm, mips, powerpc, sh4, and so on), you need to install the "qemu-kvm-extras" package (which despite the name has nothing whatsoever to do with KVM).

Support for non-x86 targets is part of the base package when you build QEMU from source. If you ignore Ubuntu's packaging insanity and build QEMU from source, you shouldn't have to worry about this strangely named artificial split.

Q: I added a uClibc patch to sources/patches but it didn't do anything, what's wrong?

The Linux filesystem is case sensitive, so the patch has to start with "uClibc-" with a capital C.

Q: Why did the $NAME package build die with a complaint that it couldn't find $PREREQUISITE, even though that's installed on the host? (For example, distcc and python.)

Because you skipped the host-tools.sh step, and because installing a package on the host isn't the same as installing it on the target.

Even though host-tools.sh is technically an optional step, your host has to be carefully set up to work without it.

Not only does host-tools.sh add prerequisite packages your build requires, it _removes_ everything else from the path that might change the behavior of the build. Without this, the ./configure stages of various packages will detect that libtool exists, or that the host has Python or Perl installed, and configure the packages to make use of things that the cross compiler's headers and libraries don't have, and that the target root filesystem may not have installed.