[buildd-tools-devel] schroot and qemu

Wookey wookey at wookware.org
Wed Nov 6 13:19:53 UTC 2013


+++ Roger Leigh [2013-11-06 10:38 +0000]:
> On Tue, Nov 05, 2013 at 12:43:06AM +0100, Pascal Greliche wrote:
> > Hello I created a schroot with "mk-sbuild --arch armel" it works well by running qemu automatically.
> > Now I have a rootfs already built and would like to work the same way.
> > how schroot knows it needs to run qemu?
> 
> This bit is "magic"; schroot itself knows nothing about qemu.
> This is done entirely by the Linux kernel using its "binfmt_misc"
> support; the qemu package registers the qemu programs for each
> supported binary format, so when you run an ELF armel linux
> binary, it knows to run it using a particular qemu program.
> 
> The only thing schroot does is to bind mount the appropriate
> qemu interpreters in the chroot so that they are available.
> This is done by the 15binfmt setup script.  Apart from this
> tiny bit of setup, everything else is just handled by the
> kernel directly.

And this page ( https://wiki.debian.org/Arm64Qemu ) explains how to do
this 'manually' if you need to (e.g. for an arch not yet in the qemu
package). That shows where the files go and what they look like to
implement the binfmt magic. It's all rather nifty.


Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/



More information about the Buildd-tools-devel mailing list