LinuxSir.cn,穿越时空的Linuxsir!

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

请教。第六章开始部分,chroot时出现错误

[复制链接]
发表于 2004-2-18 11:33:08 | 显示全部楼层 |阅读模式
第五章编译时,没有报错,4小时完成。
第六章,第一步出现错误:
#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

出现的错误是:
/static/bin/env: --login
No such file or directory
发表于 2004-2-18 12:07:49 | 显示全部楼层
可能是你不够仔细,LFS4.0才是这样的。LFS5.0是
#chroot $LFS /tools/bin/env......。LFS4.0创建工具的目录是$LFS/static...

估计你看错链接了。
发表于 2004-2-18 12:49:23 | 显示全部楼层
最初由 阿罗 发表
可能是你不够仔细,LFS4.0才是这样的。LFS5.0是
#chroot $LFS /tools/bin/env......。LFS4.0创建工具的目录是$LFS/static...

估计你看错链接了。

这里要修正一下,既然是chroot,那么就不应该用宿主系统的路径,而是新的root文件系统的路径。那个env命令是新root的程序,所以/static就对了,而非$LFS/static。
另外,动态程序以及静态程序的chroot有所不同。
man chroot

  1.    Here are a few tips to help avoid common problems in using chroot.
  2. To start with a simple example, make COMMAND refer to a statically
  3. linked binary.  If you were to use a dynamically linked executable, then
  4. you'd have to arrange to have the shared libraries in the right place
  5. under your new root directory.
复制代码
 楼主| 发表于 2004-2-18 22:27:05 | 显示全部楼层

我用的是lfs4.0,两位说的我都试了。还是不行,不过报错不一样。

错误为:
不能改变root目录到 /static/bin/env   和/mnt/lfs/static/bin/env两种错误

会不会是我写的chroot这行命令有错误。
发表于 2004-2-18 22:36:30 | 显示全部楼层

回复: 我用的是lfs4.0,两位说的我都试了。还是不行,不过报错不一样。

最初由 jiaxy 发表
错误为:
不能改变root目录到 /static/bin/env   和/mnt/lfs/static/bin/env两种错误

会不会是我写的chroot这行命令有错误。

http://www.linuxsir.cn/forum.php ... 8&highlight=env
 楼主| 发表于 2004-2-19 08:11:20 | 显示全部楼层

谢谢home_king,我犯的错误和他一样。

他文中说,root开着。我编译时是以root登陆su成lfs。我在试试。谢谢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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