-   Linux From Scratch (
-   -   why my bash doesn't work correctly? (

icoming 11-24-2004 03:32 AM

why my bash doesn't work correctly?
There should be no error when I compile Bash and other softwares.
After I finish the preparing part, I use the below command to change the root:
chroot $LFS /static/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/static/bin \
/static/bin/bash --login
However, to my surprise, there will be such an error like 'bash: cd: static/bin/ls: No such file or directory' when I input most of commands.
But when I type /static/bin/l , and type the key TAB, the bash shows the right files
ld ln locate logname ls ls_tmp

And I type /static/bin/ls, there is still the same error.
I have no name!:/# /static/bin/ls
bash: /static/bin/ls: No such file or directory

What is the matter? Is there something wrong with my Bash. I have compile it twice.
And the more surprising is that there is no error when I input the command such as 'chroot' and 'env'.
I really don't know what is the problem and what should I do.
Please help!
Thank you

rjlee 11-24-2004 07:24 AM

It could be that /static/bin/ls is generating this error, rather than BASH. Try running it, and check that all the ldd links (if any) are present and correct.

What is the value of $LFS? If it's /static then BASH is actually looking for /static/static/bin/ls because it's being chrooted to /static/

Andrew Benton 11-24-2004 09:10 AM

What's this directory /static? I've not seen that in the book. The book works. Try following the book.

320mb 11-27-2004 01:41 PM

sounds like $LFS is not in the $PATH


export LFS=/LFS

icoming 11-28-2004 08:59 AM

I know the problem now.
The program ls is compiled with dynamic link.
After I compile it with static link, everything is OK now.
Thank you for your help

All times are GMT -5. The time now is 02:30 PM.