chroot error

JazerNorth google at jaynorth.net
Sun Mar 28 05:34:57 PST 2004


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/ld-linux.so.2]
> -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/ld-linux.so.2]
> [root at desktop bin]# 
> 
> Why is there a diffrence in the sanity check and the readelf?
> 
> Thanks.
> 
> 
> 
I got that because I forgot to mount the new LFS system after I turned 
my computer on.  The book as you mount LFS manually, then link /tools to 
$LFS/tools.  So if your $LFS system is not mounted, /tools will link to 
nothing.

JN



More information about the lfs-support mailing list