QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1113|回复: 13

/tools/bin/env: /tools/bin/bas

[复制链接]
发表于 2005-7-23 23:29:46 | 显示全部楼层 |阅读模式
Hi folks,

LFS 6.1
FC3 Host

Following problem was encountered on building LFS 6.1

[root@localhost ~]# 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 +h[code:1]
/tools/bin/env: /tools/bin/bash: No such file or directory[/code:1]

[root@localhost ~]# find / -name bash[code:1]/root/bash
/root/Desktop/Trash/bash-3.0/bash
/mnt/lfs/sources/bash-3.0/bash
/mnt/lfs/tools/bin/bash
/bin/bash[/code:1]

[root@localhost ~]# find / -name env[code:1]
/usr/share/doc/db4-devel-4.2.52/ref/env
/usr/bin/env
/mnt/lfs/sources/coreutils-5.2.1/src/env
/mnt/lfs/tools/bin/env
/bin/env[/code:1]

[root@localhost ~]# ls -al /mnt/lfs/tools/bin/bash*[code:1]
-rwxr-xr-x  1 root root 1438193 Jul 23 10:18
/mnt/lfs/tools/bin/bash
-r-xr-xr-x  1 root root    6806 Jul 23 10:18
/mnt/lfs/tools/bin/bashbug[/code:1]

[root@localhost ~]# ls -al /mnt/lfs/tools/bin/env*[code:1]
-rwxr-xr-x  1 lfs lfs 12952 Jul 21 18:37
/mnt/lfs/tools/bin/env
-rwxr-xr-x  1 lfs lfs 10032 Jul 21 18:37
/mnt/lfs/tools/bin/envsubst[/code:1]

The files were there.  Please advise how to fix it.  TIA

B.R.
satimis
发表于 2005-7-24 20:18:16 | 显示全部楼层
what is your $PATH?
回复

使用道具 举报

 楼主| 发表于 2005-7-24 20:48:13 | 显示全部楼层
Hi linky_fan,

Tks for your advice.

what is your $PATH?
Sorry, I don't follow.  Please explain.  Or advise me the command to run for testing.

Whether you meant;
[root@localhost ~]# echo $PATH[code:1]
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin[/code:1]


What I discovered was;
[root@localhost ~]# ls -al /tools
lrwxrwxrwx  1 root root 15 Jun 28 17:06 /tools -> //mnt/lfs/tools

The FC3 host's /tools symbolic linked to //mnt/lfs/tools of LFS

It has 2 back slash "//" not 1 like "/mnt/lfs/tools"

B.R.
satimis
回复

使用道具 举报

发表于 2005-7-25 08:15:02 | 显示全部楼层
[quote:c97c30716a="satimis"]Hi linky_fan,

Tks for your advice.

what is your $PATH?
Sorry, I don't follow.  Please explain.  Or advise me the command to run for testing.

Whether you meant;
[root@localhost ~]# echo $PATH[code:1]
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin[/code:1]


What I discovered was;
[root@localhost ~]# ls -al /tools
lrwxrwxrwx  1 root root 15 Jun 28 17:06 /tools -> //mnt/lfs/tools

The FC3 host's /tools symbolic linked to //mnt/lfs/tools of LFS

It has 2 back slash "//" not 1 like "/mnt/lfs/tools"

B.R.
satimis[/quote]

"//mnt/lfs/tools" and "/mnt/lfs/tools" are no different
回复

使用道具 举报

 楼主| 发表于 2005-7-25 08:34:47 | 显示全部楼层
Hi applepie,

"//mnt/lfs/tools" and "/mnt/lfs/tools" are no different
Noted with thanks.

B.R.
satimis
回复

使用道具 举报

发表于 2005-7-25 14:53:00 | 显示全部楼层
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

Try give a "/tools/bin" at the end of the $PATH.
回复

使用道具 举报

 楼主| 发表于 2005-7-25 15:38:36 | 显示全部楼层
Hi linky_fan,

Try give a "/tools/bin" at the end of the $PATH.

[satimis@localhost ~]$ su - lfs
Password:
lfs:~$ cd /mnt/lfs/
lfs:/mnt/lfs$ ls[code:1]proc  sources  sys  tools[/code:1]
lfs:/mnt/lfs$ echo $PATH tools/bin/[code:1]/tools/bin:/bin:/usr/bin tools/bin/[/code:1]
B.R.
satimis
回复

使用道具 举报

发表于 2005-7-26 13:49:15 | 显示全部楼层
呵呵, PATH=$PATH:/tools/bin ; export PATH
回复

使用道具 举报

 楼主| 发表于 2005-7-26 14:12:39 | 显示全部楼层
Hi linky_fan,

PATH=$PATH:/tools/bin ; export PATH
Started PC

[satimis@localhost ~]$ su -
Password:
[root@localhost ~]# export LFS=/mnt/lfs
[root@localhost ~]# mount /dev/hda6 /mnt/lfs/
[root@localhost ~]# mkdir -p $LFS
[root@localhost ~]# echo $LFS[code:1]
/mnt/lfs[/code:1]
[root@localhost ~]# su - lfs
lfs:~$ PATH=$PATH:/tools/bin ; export PATH
No output

lfs:~$ cd /mnt/lfs/
lfs:/mnt/lfs$ PATH=$PATH:/tools/bin ; export PATH
No output

lfs:/mnt/lfs$ ls[code:1]
proc  sources  sys  tools[/code:1]
lfs:/mnt/lfs$ exit
exit

[root@localhost ~]# PATH=$PATH:/tools/bin ; export PATH
No output

[root@localhost ~]# mkdir -p $LFS/{proc,sys}
[root@localhost ~]# mount -t proc proc $LFS/proc
[root@localhost ~]# mount -t sysfs sysfs $LFS/sys
[root@localhost ~]# mount -f -t tmpfs tmpfs $LFS/dev
[root@localhost ~]# mount -f -t tmpfs tmpfs $LFS/dev/shm
[root@localhost ~]# mount -f -t devpts -o gid=4,mode=620 devpts LFS/dev/pts
[root@localhost ~]# PATH=$PATH:/tools/bin ; export PATH
All no output

B.R.
satimis
回复

使用道具 举报

发表于 2005-7-26 22:45:06 | 显示全部楼层
[code:1]
PATH=$PATH:/tools/bin/
export PATH
[/code:1]
Add these two lines in your /home/lfs/.bash_profile, if you havn't it , vim a new.
Then use the user"lfs" login (not su -), do "echo $PATH" and take a look at it.
If you can see the /tools/bin/ appears at the end of $PATH, try the steps upstairs.
回复

使用道具 举报

 楼主| 发表于 2005-7-26 23:15:08 | 显示全部楼层
Hi linky_fan,

[code:1]PATH=$PATH:/tools/bin/
export PATH[/code:1]
Add these two lines in your /home/lfs/.bash_profile
Then use the user"lfs" login (not su -), do "echo $PATH" and take a look at it.
If you can see the /tools/bin/ appears at the end of $PATH, try the steps upstairs.
[satimis@localhost ~]$ su -
Password:
[root@localhost ~]# ls /home[code:1]lfs  lost+found  newuser  satimis[/code:1]
[root@localhost ~]# ls -al /home/lfs[code:1]total 72
drwx------  2 lfs  lfs   4096 Jul 26 10:18 .
drwxr-xr-x  6 root root  4096 Jun 28 17:13 ..
-rwxr-xr-x  1 lfs  lfs   4482 Jul 26 10:18 a.out
-rw-------  1 lfs  lfs  11664 Jul 26 18:19 .bash_history
-rw-r--r--  1 lfs  lfs     59 Jul 18 19:07 .bash_profile
-rw-r--r--  1 lfs  lfs     96 Jul 18 19:09 .bashrc
-rw-r--r--  1 lfs  lfs      9 Jul 26 10:18 dummy.c
-rw-r--r--  1 lfs  lfs     51 Jul 26 09:44 output.txt[/code:1]]
[root@localhost ~]# nano /home/lfs/.bash_profile[code:1]exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash
PATH=$PATH:/tools/bin/
export PATH[/code:1]
(Remark: the file only has one line
-i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash)

[root@localhost ~]# export LFS=/mnt/lfs
[root@localhost ~]# mount /dev/hda6 /mnt/lfs
[root@localhost ~]# echo $LFS[code:1]/mnt/lfs[/code:1]
[root@localhost ~]# su - lfs
lfs:~$ echo $PATH[code:1]/tools/bin:/bin:/usr/bin[/code:1]
"/tools/bin" at the beginning

lfs:~$ ls -al[code:1]total 72
drwx------  2 lfs  lfs   4096 Jul 26 02:18 .
drwxr-xr-x  6 root root  4096 Jun 28 09:13 ..
-rw-------  1 lfs  lfs  11664 Jul 26 10:19 .bash_history
-rw-r--r--  1 lfs  lfs     94 Jul 26 14:56 .bash_profile
-rw-r--r--  1 lfs  lfs     96 Jul 18 11:09 .bashrc
-rwxr-xr-x  1 lfs  lfs   4482 Jul 26 02:18 a.out
-rw-r--r--  1 lfs  lfs      9 Jul 26 02:18 dummy.c
-rw-r--r--  1 lfs  lfs     51 Jul 26 01:44 output.txt[/code:1]]lfs:~$ echo /mnt/lfs/$PATH[code:1]/mnt/lfs//tools/bin:/bin:/usr/bin[/code:1]
lfs:~$

B.R.
satimis
回复

使用道具 举报

发表于 2005-7-28 15:04:51 | 显示全部楼层
lfs:~$ echo $PATH
代码:
/tools/bin:/bin:/usr/bin

"/tools/bin" at the beginning

it is unreasonable-_-.

Try ln -sf /tools/bin/bash /tools/bin/sh and do a "chroot" again.

Good luck
回复

使用道具 举报

 楼主| 发表于 2005-7-28 16:01:07 | 显示全部楼层
Hi linky_fan,

LFS 6.1
=======
Tks for your advice.

Finally I got chroot done.

[root@localhost satimis]# /usr/sbin/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 +h[code:1]I have no name!:/#[/code:1]

The solution was removing basb-3.0 and to reinstall it from its tarball.  Make sure;

/tools/bin/gcc
[Requesting program interpreter: /tools/lib/ld-linux.so.2]
/tools/bin/g++
[Requesting program interpreter: /tools/lib/ld-linux.so.2]
/mnt/lfs/tools/bin/bash
[Requesting program interpreter: /tools/lib/ld-linux.so.2]   

and
echo $PATH
[code:1]/tools/bin:/bin:/usr/bin[/code:1]

"/tools/bin" befor "/usr/bin"

I'm now moving on to following sections.

B.R.
satimis
回复

使用道具 举报

发表于 2005-7-31 20:31:25 | 显示全部楼层
Good Luck  
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-10-4 23:20 , Processed in 0.094675 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表