entering the chroot environment ,ch6

Tom Scott telecomtom at vedatel.com
Thu Nov 13 04:08:24 PST 2003

On Tue Nov 11 14:09:46 MST 2003 Erik Postma wrote:
> On Tue, 11 Nov 2003 00:53:46 -0200, michael <michael8110 at terra.com.br>
> wrote:
>> thank you for your answers to my previous question about the sanity
>> check in sec 'locking in glibc',after i did su - lfs it worked/
>>  now i have another problem,the chroot $LFS  (with $LFS=/mnt/lfs)
>>  returns 
>> /bin/bash : no such file or directory,which is quite reasonable because
>> the command should have been chroot /mnt/lfs/tools since that's where  a
>> /bin/bash is to be seen ,but then i get /bin/bash permission denied 
>> (i'm as root) .Boy,is this tough!
> The book says:
> 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
> so in the /mnt/lfs chroot it refers to /tools/bin/bash. That is the file
> which you'd refer to from outside chroot as /mnt/lfs/tools/bin/bash. The
> permission denied message seems to indicate a more serious issue. Is your
> LFS-partition mounted noexec?

I have a related question. In section 6.3, "Entering the chroot environment",
the book says to "Become root and run the foloowing command". If I use the
su command without the - (login) option the LFS variable is still set and
the command "chroot $LFS /tool/bin/env -i" works. If I use the su command with
the login option the LFS var is no longer set and the chroot command fails.
Is it safe to assume then that "become root" means "become root without the
login option"?

-- TT

More information about the lfs-support mailing list