[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] Chroot exec error inspite of qemu-static-arm being in

From: Urmish Ajit Thakker
Subject: Re: [Qemu-discuss] Chroot exec error inspite of qemu-static-arm being installed
Date: Thu, 23 Oct 2014 12:28:28 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0


Thanks for the reply.
I tried your advice and got the following results.
I cd into my chroot directory -
cd <mount place of image>

1) usr/bin/qemu-arm-static --help
R - Prints out help

2) sudo chroot . /usr/bin/qemu-arm-static --help
R - Prints out help

3) usr/bin/qemu-arm-static bin/ls
E - Error while loading bin/ls: No such file or directory

Note : bin/ls exists

4) sudo chroot . /usr/bin/qemu-arm-static /bin/ls
R - /bin/ls: Invalid ELF image for this architecture

5) sudo chroot . /bin/ls
R - chroot: failed to run command `/bin/ls': Exec format error

If I understand your instructions clearly, 3 & 4 should not happen. Am I correct?

On 10/23/14 04:26, Peter Maydell wrote:
On 23 October 2014 02:47, Urmish Ajit Thakker <address@hidden> wrote:

I am trying to chroot into an arm system from a x86 host. However, I keep
getting the following error

chroot: failed to run command `/bin/bash': Exec format error.

I think I have already installed the required files and I am not able to
debug the issue. Can anyone help me with this?
A set of things you can try to narrow down the problem:

/path/to/chroot/usr/bin/qemu-arm-static --help
  # if this doesn't work you haven't installed the right QEMU into
  # your chroot
sudo chroot /path/to/chroot /usr/bin/qemu-arm-static --help
  # if this doesn't work then your allegedly static QEMU
  # isn't actually statically linked
/path/to/chroot/usr/bin/qemu-arm-static /path/to/chroot/bin/ls
  # this *should* fail with "/lib/ld-linux.so.3: No such file or directory"
  # or similar, indicating we read the executable but couldn't find
  # the dynamic linker. If this fails then maybe your chroot doesn't
  # have ARM binaries in it...
sudo chroot /path/to/chroot /usr/bin/qemu-arm-static /bin/ls
  # this should work and list the files in the chroot directory.
  # if it doesn't work then likely your chroot is wrongly set up
sudo chroot /path/to/chroot /bin/ls
  # if this fails but the previous command worked, then your binfmt-misc
  # registration is broken.

-- PMM

reply via email to

[Prev in Thread] Current Thread [Next in Thread]