chroot error

Jeremy Utley jeremy at
Sun Mar 28 00:47:45 PST 2004

On Sat, 2004-03-27 at 23:45, Floyd Hagen wrote:
> I stepped away from building 5.0 for a while after I finished chapter 5.
> I'd like to finish it up, but I'm having problems with chroot.
> The sanity check seems to be ok:
> -bash-2.05b$ echo 'main(){}' > dummy.c
> -bash-2.05b$ gcc dummy.c
> -bash-2.05b$ readelf -l a.out | grep ': /tools'
>       [Requesting program interpreter: /tools/lib/]
> -bash-2.05b$ 
> but chroot fails:
> [root at desktop sources]# chroot $LFS /tools/bin/env -i \
>      HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
>      PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
>      /tools/bin/bash --login
> chroot: cannot run command `/tools/bin/env': No such file or directory
> [root at desktop sources]# 
> I saw the FAQ and tried this:
> [root at desktop bin]# readelf -l $LFS/tools/bin/env | grep interpreter
>       [Requesting program interpreter: /lib/]
> [root at desktop bin]# 
> Why is there a diffrence in the sanity check and the readelf?
> Thanks.

Most commonly, this comes about because the PATH variable for the lfs
user got changed somehow, making things stop linking against the new

I'd run the same sanity check on everything in /tools/bin, find out
which packages were linked improperly, and recompile them, making sure
that your path while your the lfs user has /tools/bin at the start.


More information about the lfs-support mailing list