On Tue, May 20, 2014 at 09:14:16AM +0300, Erez D wrote: > I am using centos 6 and developing for an armel platform > > i created a rootfs using multistrap/debbootstrap > > i copied qemu-arm-static to rootfs/usr/bin/qemu-arm-static
There's something missing from your description. I suspect you forgot to mention it: debootstrap's run can be broken to two parts: one that downloads everything, and the second stage that needs to run inside the chroot. In that case: debootstrap --foreign [--arch=] [rest of parameters] chroot to/chroot ./debootstrap --second-stage At least in Debian, the package qemu-user-static includes the wrapper qemu-debootstrap to do just that, and also copy the required qemu-user-static. > > and i was astonished that doing just 'chroot rootfs' worked, without > explicitly telling 'chroot' to use qemu-arm-static - somehow it decided > automatically to run everything under qemu-arm-static without me telling it > to. > > > after a restart of the server. rootfs does not work anymore automatically, > i get a "chroot: failed to run command `/bin/bash': Exec format error" > doing "chroot rootfs /usr/bin/qemu-arm-static /bin/bash" does chroot, but > i get : "bash: /bin/cat: cannot execute binary file" (although > rootfs/bin/cat is a perfectly ok armel binary, tested on the armel target). > i also checked the md5sum of the rootfs/qemu-arm-static binary, and it is ok A chroot does not replace the kernel. It's running on your kernel and that kernel does not natively support the armel binaries. In Debian, the package qemu-user-static registers foreign Linux ELF formats. So maybe you forgot this is needed. Specifically: $ cat /proc/sys/fs/binfmt_misc/qemu-arm enabled interpreter /usr/bin/qemu-arm-static flags: offset 0 magic 7f454c4601010100000000000000000002002800 mask ffffffffffffff00fffffffffffffffffeffffff -- Tzafrir Cohen | tzaf...@jabber.org | VIM is http://tzafrir.org.il | | a Mutt's tzaf...@cohens.org.il | | best tzaf...@debian.org | | friend _______________________________________________ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il