I have downloaded some firmware and I want to run some commands in it. I have extracted the firmware, installed qemu and configured binfmts. The problem is that binfmt does not work in the chroot.
Mipsel files are automatically executed by qemu-mipsel-static:
firmware$ bin/ls
/lib/ld-uClibc.so.0: No such file or directory
The command qemu-mipsel-static is available within the chroot:
firmware$ sudo chroot . /usr/bin/qemu-mipsel-static /bin/ls
webroot tmp sbin media home dev
When combining the two, it no longer works:
firmware$ sudo chroot . /bin/ls
chroot: failed to run command ‘/bin/ls’: No such file or directory
It says "No such file or directory". Is there any way to get more information about this, for example which file can not be found? Is this indeed a problem with binfmt?
My binfmt config looks like this:
$ cat /proc/sys/fs/binfmt_misc/qemu-mipsel
enabled
interpreter /usr/lib/binfmt-support/run-detectors
flags:
offset 0
magic 7f454c4601010100000000000000000002000800
mask ffffffffffffff00fffffffffffffffffeffffff
Is it a problem that /usr/lib/binfmt-support/run-detectors is not available in the chroot?