LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1373|回复: 7

/tools/bin/env: /tools/bin/bash: No such file or directory

[复制链接]
发表于 2005-7-23 23:29:27 | 显示全部楼层 |阅读模式
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

  1. /tools/bin/env: /tools/bin/bash: No such file or directory
复制代码


[root@localhost ~]# find / -name bash
  1. /root/bash
  2. /root/Desktop/Trash/bash-3.0/bash
  3. /mnt/lfs/sources/bash-3.0/bash
  4. /mnt/lfs/tools/bin/bash
  5. /bin/bash
复制代码


[root@localhost ~]# find / -name env

  1. /usr/share/doc/db4-devel-4.2.52/ref/env
  2. /usr/bin/env
  3. /mnt/lfs/sources/coreutils-5.2.1/src/env
  4. /mnt/lfs/tools/bin/env
  5. /bin/env
复制代码


[root@localhost ~]# ls -al /mnt/lfs/tools/bin/bash*

  1. -rwxr-xr-x  1 root root 1438193 Jul 23 10:18
  2. /mnt/lfs/tools/bin/bash
  3. -r-xr-xr-x  1 root root    6806 Jul 23 10:18
  4. /mnt/lfs/tools/bin/bashbug
复制代码


[root@localhost ~]# ls -al /mnt/lfs/tools/bin/env*

  1. -rwxr-xr-x  1 lfs lfs 12952 Jul 21 18:37
  2. /mnt/lfs/tools/bin/env
  3. -rwxr-xr-x  1 lfs lfs 10032 Jul 21 18:37
  4. /mnt/lfs/tools/bin/envsubst
复制代码


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

B.R.
satimis
发表于 2005-7-24 09:31:19 | 显示全部楼层
好像是第一次调整工具链时出了问题
回复 支持 反对

使用道具 举报

发表于 2005-7-24 21:20:33 | 显示全部楼层
ldd /tools/bin/bash
ldd /mnt/lfs/tools/bin/bash
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-26 17:21:20 | 显示全部楼层
[Hi 黯然销魂,

ldd /tools/bin/bash
ldd /mnt/lfs/tools/bin/bash
I made following tests

lfs:/mnt/lfs$ ls -al
  1. total 44
  2. drwxr-xr-x   6 root root 4096 Jul 21 14:23 .
  3. drwxr-xr-x   7 root root 4096 Jun 27 06:19 ..
  4. drwxr-xr-x   2 root root 4096 Jul 21 14:23 proc
  5. drwxrwxrwt  30 lfs  root 4096 Jul 25 09:10 sources
  6. drwxr-xr-x   2 root root 4096 Jul 21 14:23 sys
  7. drwxr-xr-x  13 lfs  root 4096 Jul 25 14:56 tools
复制代码

1)
lfs:/mnt/lfs$ ldd /tools/bin/bash
  1.         linux-gate.so.1 =>  (0x00482000)
  2.         libtermcap.so.2 => /lib/libtermcap.so.2 (0x00ac4000)
  3.         libdl.so.2 => /lib/libdl.so.2 (0x009d3000)
  4.         libc.so.6 => /lib/tls/libc.so.6 (0x00882000)
  5.         /lib/ld-linux.so.2 (0x00868000)
复制代码

2)
lfs:/mnt/lfs$ ldd tools/bin/bash
  1.         linux-gate.so.1 =>  (0x006a1000)
  2.         libtermcap.so.2 => /lib/libtermcap.so.2 (0x00ac4000)
  3.         libdl.so.2 => /lib/libdl.so.2 (0x009d3000)
  4.         libc.so.6 => /lib/tls/libc.so.6 (0x00882000)
  5.         /lib/ld-linux.so.2 (0x00868000)
复制代码

3)
lfs:/mnt/lfs$ ldd /mnt/lfs/tools/bin/bash
  1.         linux-gate.so.1 =>  (0x00fff000)
  2.         libtermcap.so.2 => /lib/libtermcap.so.2 (0x00ac4000)
  3.         libdl.so.2 => /lib/libdl.so.2 (0x009d3000)
  4.         libc.so.6 => /lib/tls/libc.so.6 (0x00882000)
  5.         /lib/ld-linux.so.2 (0x00868000
复制代码

"linux-gate.so.1 linked to a file with no name.

lfs:/mnt/lfs$ exit
exit

4)
[root@localhost ~]# ldd /tools/bin/bash
  1.         linux-gate.so.1 =>  (0x0038f000)
  2.         libtermcap.so.2 => /lib/libtermcap.so.2 (0x00ac4000)
  3.         libdl.so.2 => /lib/libdl.so.2 (0x009d3000)
  4.         libc.so.6 => /lib/tls/libc.so.6 (0x00882000)
  5.         /lib/ld-linux.so.2 (0x00868000)
复制代码

5)
[root@localhost ~]# ldd /mnt/lfs/tools/bin/bash
  1.         linux-gate.so.1 =>  (0x00f9b000)
  2.         libtermcap.so.2 => /lib/libtermcap.so.2 (0x00ac4000)
  3.         libdl.so.2 => /lib/libdl.so.2 (0x009d3000)
  4.         libc.so.6 => /lib/tls/libc.so.6 (0x00882000)
  5.         /lib/ld-linux.so.2 (0x00868000)
复制代码


B.R.
satimis
回复 支持 反对

使用道具 举报

发表于 2005-7-26 22:37:48 | 显示全部楼层
。。奇怪,,是不是你的toolchain adjust的时候不对?。。

我记得应该是 /tools/lib/ld-linux.so.2 的啊。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-26 23:40:59 | 显示全部楼层
Hi 黯然销魂,

。。奇怪,,是不是你的toolchain adjust的时候不对?。。

我记得应该是 /tools/lib/ld-linux.so.2 的啊。
I
I did Section  5.7. Adjusting the Toolchaintwice
http://www.linuxfromscratch.org/ ... er05/adjusting.html

I'm maintaining a thorough Notes taking down all steps performed during building LFS 6.1 as well as LFS 6.0 previously.  I re-cheked the Notes against LFS 6.1 book and found no step missing.

Now I re-ran Sanity Check
lfs:~$ echo 'main(){}' > dummy.c
lfs:~$ cc dummy.c
lfs:~$ readelf -l a.out | grep ': /tools'
      [Requesting program interpreter: /tools/lib/ld-linux.so.2]

It is OK

B.R.
satimis
回复 支持 反对

使用道具 举报

发表于 2005-7-27 12:22:21 | 显示全部楼层
你再build一下bash,看看其ldd是怎么的?

不用make install,就看看就可以了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-7-27 22:16:01 | 显示全部楼层

Problem solved

Hi 黯然销魂,

LFS 6.1

Problem solved.  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
  1. I have no name!:/#
复制代码


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
  1. /tools/bin:/bin:/usr/bin
复制代码

"/tools/bin" before "/usr/bin"

I'm now moving on to following sections.

Anyway lot of thanks for your advice.

B.R.
satimis
回复 支持 反对

使用道具 举报

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

本版积分规则

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