Re: Executing a command of a chroot outside of the chroot

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



On 6 December 2012 15:07, Δημήτρης Ζέρβας <01ttouch@xxxxxxxxx> wrote:
> I have a chroot environment on /data/workbench/mnt and I want to execute a
> binary which is inside the chroot environment (for example
> /data/workbench/mnt/bin/bash). I added the chroot library path to
> $LD_LIBRARY_PATH and I just did /data/workbench/mnt/bin/bash. I get a very
> strange error: No such file or directory. I am ABSOLUTELY sure that the
> file exists. When I chroot /data/workbench/mnt /bin/bash everything runs
> smoothly without errors. What's going on?
>
> BTW: I'm on armv7l

Just a guess but the file that doesn’t exist might be the ELF loader
aka interpreter. You can find out what it is by using the “ldd”, or
“readelf” commands:

$ readelf --segments /bin/bash
. . .
  INTERP         0x0000000000000238 0x0000000000400238 0x0000000000400238
                 0x000000000000001a 0x000000000000001a  R      1
      [Requesting program interpreter: /lib/ld-linux-x86-64.so.2]

It should vary depending on architecture and ABI. Then you might be
able to invoke it manually:

ROOT/lib/ld-linux-WHATEVER ROOT/bin/bash

Hope this helps, but it would probably only be practical for really
simple programs; you’ll probably have the same problem when Bash tries
to execute something.


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux