DQIB, the Debian Quick Image Baker

Posted on Sun 09 June 2019 in debian

Debian supports (either officially or unofficially) a lot of architectures, which is of course a nice thing. Sometimes you want to play with some exotic architecture you are not familiar with, or you want to debug a problem with that architecture, but you do not have a computer implementing that architecture. Fortunately QEMU is able to emulate most of the architectures supported by Debian (ia64 being an exception), however it can be difficult to install it or to find ready-to-use images on the Internet (there are some, but usually they are quite a few years old). Let's also say that for some reason you cannot or do not want to use the Debian porterboxes (maybe you are not a DD, or you want to mess up with the network, or you want to be root). What do you do?

Mostly for the fun of hacking on some exotic architectures, I tried to brew together a little script, the Debian Quick Image Baker (DQIB). It is basically a wrapper that calls qemu-debootstrap with the right options (where "right" means "those that I have experimentally found to work"), with some thin icing layer on top. qemu-debootstrap is basically another wrapper on top of debootstrap, which of course does the heavy lifting, and qemu-user-static, that allows debootstrap to run executables for foreign architectures.

With DQIB you can quickly create working images for most Debian official architectures (i386, amd64, mips, mipsel, mips64el, armhf, arm64, ppc64el). s390x works, but requires a little workaround because of a little bug that was fixed in recent QEMU versions. Images for armel can be created, but the only Linux kernel offered by Debian for armel does not work on any QEMU machine. I don't know of a workaround here. I would also like to support non official architectures, but this is work in progress. For all the non official architecture, either qemu-debootstrap fails for some reason, or I cannot find the right options to make the Debian-distributed kernel running (except for riscv64, where I know how to make the kernel work, but it requires some non trivial changes to the DQIB script; however, the riscv64 panorama is very dynamical and things could change in very little time).

You can either clone the repository and run DQIB on you computer (check out the README), or download pre-baked images regenerated weekly by a CI process (which include the right command line to launch QEMU; see above for the definition of "right").

(You might ask why this is hosted on Gitlab.com instead of the Debian Developer's obvious choice. The reason is that the artifacts generated by the CI are rather large, and I am not sure DSA would be happy to have them on their servers)

Have fun, and if know how to support more architectures please let me know!

Leave a comment

Comment will be manually reviewed before being published.