OpenWrt Forum Archive

Topic: chrooting ash works for only one command

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I use the gentoo's uclibc embedded stage3 and when chrooting to the new env, I get the following error :

root@OpenWrt:/# ls
bin   dev  home  mnt  proc  sbin                                   sys  usr
boot  etc  lib   opt  root  stage3-mipsel-uclibc-20041107.tar.bz2  tmp  var
Illegal instruction

Has anyone an idea why it does not work ? The stage3 is mounted via nfs and writeable/readable/executable.

Ah maybe it's a proc problem because I forgot to  mount proc to the new /mnt/proc. But actually, it is not that.

What's the nfs server saying on the remote end ?

--
Nico

When the command ends, the nfs server say nothing, so that I think it's an ash bug.

After you chroot, you're nolonger using any of the libraries or binaries provided by openwrt; you're using whatever files are in the new root filesystem. Perhaps there's some issue with your chroot filesystem?

Actually, I really don't know if the /bin/sh from openwrt requires libraries to work. I'll try to strace it in order to view if it requires something like this.

Maybe bash will be a better solution to do that as I can compile it statically. Thanks for your help, and I will tell you if this chrooted filesystem is working wether or not smile

The discussion might have continued from here.