#!/usr/bin/env .wiki Qemu has user binary emulation for numerous platforms. As a result, you can use debootstrap to create a chroot for a host platform, then actually chroot into it! If you're really sneaky, you can set up certain binaries (e.g. the compiler) to be compiled for the host, so that you can compile fast, but also compile software that's not cross-compiler-aware. And here's how! (Note: I've tested this with arm/armel and ppc/powerpc. The instructions below are for powerpc, since I wrote them after I'd already gotten arm working, and as I was getting PPC working) # You must have Qemu installed to some path other than /usr, such as /opt/qemu. I will use /opt/qemu throughout this text. # You must have set up qemu-binfmt-conf.sh to use the Qemu installed to /opt/qemu, and run it. Note: With MIPS in particular it was also necessary to create a symlink in /opt/qemu/bin from qemu-mipsn32 to qemu-mips. I have no idea why qemu-binfmt-conf.sh thinks that qemu-mipsn32 exists, or why a different ABI would require a different emulator. Anyway, it works this way. # Make a static version of the relevant Qemu user emulation binary: {{{cd .../qemu; CFLAGS="-O2 -g -static" LDFLAGS=-static ./configure --prefix=/opt/qemu --target-list=ppc-linux-user; make}}} # Now we start preparing the target directory. I used /usr/gnemul/debian-ppc to keep it near /usr/gnemul/qemu-ppc. Note that you CAN NOT use /usr/gnemul/qemu-ppc as your debootstrap chroot, but it doesn't have to be in /usr/gnemul. Copy in the qemu binary: {{{mkdir -p /usr/gnemul/debian-ppc/opt/qemu/bin; cp -a .../qemu/ppc-linux-user/qemu-ppc /usr/gnemul/debian-ppc/opt/qemu/bin}}} # Now, debootstrap into the target directory. {{{debootstrap --arch powerpc lenny /usr/gnemul/debian-ppc}}} Barring weird failures, you will now have a working, chroot-able Debian. With ARM I had to copy in a static version of /bin/rm compiled for the host architecture due to missing syscalls in qemu. With PPC I needed both a static version of /bin/rm AND a static version of dpkg! In short, you may or may not have to copy stuff in to make it all work, but it's assumed that what's failing will be fairly obvious, and so the solution will be clear (just build the proper thing as static for the host). For dpkg in particular, after running configure, edit config.h such that it thinks it's the target platform. (To be continued)