<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:14pt"><div style="" class=""><br style="" class=""><br style="" class=""><br style="" class=""><br style="" class="">>________________________________<br style="" class="">> From: Erez D <<a style="" class="" href="mailto:erez0001@gmail.com">erez0001@gmail.com</a>><br style="" class="">>To: linux-il <<a style="" class="" href="mailto:linux-il@cs.huji.ac.il">linux-il@cs.huji.ac.il</a>> <br style="" class="">>Sent: Tuesday, May 20, 2014 9:14 AM<br style="" class="">>Subject: qemu and chroot<br style="" class="">> <br style="" class="">><br style="" class="">><br style="" class="">>I am using centos 6 and  developing for an armel platform<br style="" class="">><br style="" class="">>i created a rootfs using multistrap/debbootstrap<br style=""
 class="">><br style="" class="">>i copied qemu-arm-static to rootfs/usr/bin/qemu-arm-static<br style="" class="">><br style="" class="">>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.<br style="" class="">"It" can't decide by itself to run qemu-arm-static.<br style="" class="">When you are trying to run executable that no native executable pattern is checked<br style="" class="">and if there is registered runners (like qemu, wine, etc) then this runner used.<br style="" class=""><br style="" class="">In order to register runner you have to write magic string into<br style="" class="">/proc/sys/fs/binfmt_misc/register<br style="" class=""><br style="" class="">Format of this string described for example here:<br style="" class=""><a style="" class="" href="http://en.wikipedia.org/wiki/Binfmt_misc" target="_blank">http://en.wikipedia.org/wiki/Binfmt_misc</a><br style="" class=""><br style="" class="">Valery<br style="" class=""><br style="" class=""><br style="" class=""><br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">>after a restart of the server. rootfs does not work
 anymore automatically,<br style="" class="">><br style="" class="">>i get a "chroot: failed to run command `/bin/bash': Exec format error"<br style="" class="">><br style="" class="">>doing "chroot rootfs /usr/bin/qemu-arm-static /bin/bash" does chroot, but<br style="" class="">><br style="" class="">>i
 get : "bash: /bin/cat: cannot execute binary file" (although 
rootfs/bin/cat is a perfectly ok armel binary, tested on the armel 
target).<br style="" class="">><br style="" class="">>i also checked the md5sum of the rootfs/qemu-arm-static binary, and it is ok<br style="" class="">><br style="" class="">><br style="" class="">>i
 mounted the rootfs on the armel target using nfs, and chrooted from the
 target, and it works perfectly, meaning there is nothing wrong with the
 rootfs filesystem<br style="" class="">><br style="" class="">><br style="" class="">>as it wonderously worked, now it wonerously  doesn't<br style="" class="">><br style="" class="">><br style="" class="">>tryed googleling for it , but still cant find how to make it work<br style="" class="">><br style="" class="">><br style="" class="">>any idea ?<br style="" class="">><br style="" class="">><br style="" class="">><br style="" class="">>_______________________________________________<br style="" class="">>Linux-il mailing list<br style="" class="">><a style="" class="" href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br style="" class="">><a style="" class="" href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br style="" class="">><br style="" class="">><br style="" class="">></div><div
 style="" class=""><br style="" class=""></div></div></body></html>