I'm running Linux on an x86_64 system. I have a Raspbian image mounted on /mnt
. If I want run binaries under /mnt
, I can chroot
into the Rasbpian environment and the system will use qemu-arm-static
to run the armhf binaries.
I can run a single binary outside of the chroot
environment doing something like this:
qemu-arm -E LD_LIBRARY_PATH=/mnt/lib/arm-linux-gnueabihf/ \
/mnt/lib/ld-linux-armhf.so.3 /mnt/bin/echo hello world
But is there a way to override the dynamic linker path (in this case, /lib/ld-linux-armhf.so.3
) such that the first process can start additional arm binaries? For example, starting a shell works fine:
outside$ qemu-arm -E LD_LIBRARY_PATH=/mnt/lib/arm-linux-gnueabihf/ \
-E PATH=/mnt/bin:/mnt/usr/bin \
/mnt/lib/ld-linux-armhf.so.3 /mnt/bin/sh
$ echo hello world
hello world
But trying to spawn another binary fails:
$ ls
/lib/ld-linux-armhf.so.3: No such file or directory
Can I convince the kernel to find the dynamic linker (for arm binaries) in /mnt/lib/ld-linux-armhf.so.3
without running in a chroot'd environment?