LFS编译binutils-2.17.tar.bz2 总是出错,求解

34 views
Skip to first unread message

pt zero

unread,
May 10, 2012, 6:05:40 AM5/10/12
to sh...@googlegroups.com
完全按照冲天飞豹 的那个LFS 手册2008修正版做的 同时参考LFS-BOOK-6.3-HTML 编译binutils-2.17.tar.bz2 一直提示
make[4]: Leaving directory `/mnt/lfs/sources/binbd/ld'
make[3]: Leaving directory `/mnt/lfs/sources/binbd/ld'
make[2]: Leaving directory `/mnt/lfs/sources/binbd/ld'
make[1]: Nothing to be done for `all-target'.
make[1]: Leaving directory `/mnt/lfs/sources/binbd'





虚拟机vm5.6x
虚拟机配置 linxu : otherlinux kernel 2.6 .x
cpuinfo :
model name : Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz
lfs-live-cd : x86-6.3-r2145.iso

环境配置: su - lfs export
declare -x HOME="/home/lfs"
declare -x LC_ALL="POSIX"
declare -x LFS="/mnt/lfs"
declare -x OLDPWD="/mnt/lfs/sources/binbb"
declare -x PATH="/tools/bin:/bin:/usr/bin/"
declare -x PS1="\\u:\\w\\\$ "
declare -x PWD="/mnt/lfs/sources"
declare -x SHLVL="1"
declare -x TERM="xterm"

md5sub
e26e2e06b6e4bf3acf1dc8688a94c0d1 binutils-2.17.tar.bz2

make | tee 1.log 附件如下

其他的信息:
Linux version 2.6.22.5 gcc version 4.1.2)

pt zero

unread,
May 10, 2012, 9:11:19 PM5/10/12
to sh...@googlegroups.com
帮帮忙啊,玩过LFS的,这块的确找不到原因 ,G+百度都过了几遍了,FAQ上也没有详解。等搞懂这个问题总结一个tips 
方便以后其他人查阅

2012/5/10 pt zero <fg1...@gmail.com>
Message has been deleted

pt zero

unread,
May 10, 2012, 10:22:05 PM5/10/12
to sh...@googlegroups.com
抱歉没有上传附件,现在补上。
------------------
btw : shlug 里面有LFS 主题内容么?

2012/5/11, Hugh <boxx...@gmail.com>:
> 日志附件在哪呢?
> 就给那么短短五行output,也没看到个错误提示,咋帮你?

> --
> Hugh
>

1.log
Message has been deleted

ning zhou

unread,
May 10, 2012, 10:58:45 PM5/10/12
to sh...@googlegroups.com
你是怎么判断出错了的?

在 2012年5月11日 上午10:52,Hugh <boxx...@gmail.com>写道:


2012/5/11 pt zero <fg1...@gmail.com>

抱歉没有上传附件,现在补上。
------------------
btw : shlug 里面有LFS 主题内容么?

Sigh~ 这是你编译的第一个包对不?就是5.3的第一个?根本就没错。把你的log和下面这个对比一下。



--
Hugh



--
Best Regards.
Zhou Ning 周宁

pt zero

unread,
May 10, 2012, 11:35:02 PM5/10/12
to sh...@googlegroups.com
学习了 !嗯,是第一次编译的,现在对比文件如下 diff -b 1.log 2.log >> diff.log


在 2012年5月11日 上午10:52,Hugh <boxx...@gmail.com>写道:
>
>
>
> 2012/5/11 pt zero <fg1...@gmail.com>
>>

>> 抱歉没有上传附件,现在补上。
>> ------------------
>> btw : shlug 里面有LFS 主题内容么?
>
>

diff.log

pt zero

unread,
May 10, 2012, 11:37:15 PM5/10/12
to sh...@googlegroups.com
make install error:
lfs:/mnt/lfs/sources/binbd$ make install
make[1]: Entering directory `/mnt/lfs/sources/binbd'
/bin/sh ../binutils-2.17/mkinstalldirs /tools /tools
mkdir -p -- /tools /tools
mkdir: cannot create directory `/tools': Permission denied
mkdir: cannot create directory `/tools': Permission denied
make[1]: *** [installdirs] Error 1
make[1]: Leaving directory `/mnt/lfs/sources/binbd'
make: *** [install] Error 2

lfs:/mnt/lfs/sources/binbd$ ls -al $LFS
total 32
drwxr-xr-x 5 root root 4096 May 10 03:18 .
drwxr-xr-x 3 root root 4096 May 10 05:43 ..
drwx------ 2 root root 16384 May 10 01:15 lost+found
drwxrwxrwt 4 lfs root 4096 May 10 09:12 sources
drwxr-xr-x 2 lfs root 4096 May 10 03:18 tools


在 12-5-11,ning zhou<nath...@gmail.com> 写道:

ning zhou

unread,
May 10, 2012, 11:51:01 PM5/10/12
to sh...@googlegroups.com
For below:
mkdir: cannot create directory `/tools': Permission denied
mkdir: cannot create directory `/tools': Permission denied 

你是不是用 ubuntu? 用sudo 试试看,一般来说不用sudo的? 不过怀疑你 用户权限除了问题。 你看看前几天的帖子。

2012/5/11 pt zero <fg1...@gmail.com>

步天歌

unread,
May 10, 2012, 11:53:24 PM5/10/12
to sh...@googlegroups.com
明显是 drwxr-xr-x 2 lfs  root  4096 May 10 03:18 tools 组权限不够啊

pt zero

unread,
May 10, 2012, 11:58:29 PM5/10/12
to sh...@googlegroups.com

之前也改过 tools 的权限改成a+wt 都还是一样的错误

ning zhou

unread,
May 11, 2012, 12:01:32 AM5/11/12
to sh...@googlegroups.com
我刚才还在跑这一步,没有 用到sudo,不过 建议你用一下。

步天歌

unread,
May 11, 2012, 12:33:44 AM5/11/12
to sh...@googlegroups.com
明显是 drwxr-xr-x 2 lfs  root  4096 May 10 03:18 tools 组“权限不够啊

组权限 r-x 没有w ,不能在文件夹创建,删除文件

ning zhou

unread,
May 11, 2012, 1:03:06 AM5/11/12
to sh...@googlegroups.com
是的,他说的对,我的文件夹权限和你的一样,之所以没有sudo,估计是因为之前其他的命令sudo了。反正不是什么大问题,你可以把 所有组 root 改成 lfs,省却很多麻烦啦。


在 2012年5月11日 下午12:33,步天歌 <buti...@gmail.com>写道:
明显是 drwxr-xr-x 2 lfs  root  4096 May 10 03:18 tools 组“权限不够啊

组权限 r-x 没有w ,不能在文件夹创建,删除文件



pt zero

unread,
May 11, 2012, 1:50:11 AM5/11/12
to sh...@googlegroups.com
sudo 测试成功 但是不应该是权限的问题啊

ning zhou

unread,
May 11, 2012, 1:57:26 AM5/11/12
to sh...@googlegroups.com
permission denied了,当然是权限问题,你自己再看看吧。

Ray Wang

unread,
May 11, 2012, 5:15:30 AM5/11/12
to sh...@googlegroups.com
不能用sudo的,我编译LFS就是错在这里,一定要在命令行下以lfs的身份解压,否则到时候会有权限错误。
--
=====================================


嘿曦

unread,
May 11, 2012, 5:19:45 AM5/11/12
to sh...@googlegroups.com
>不能用sudo的,我编译LFS就是错在这里,一定要在命令行下以lfs的身份解压,否则到时候会有权限错误。
应该用 sudo su lfs ?

ning zhou

unread,
May 11, 2012, 5:23:35 AM5/11/12
to sh...@googlegroups.com
他的问题是 tools的权限。不是解压目录的权限。

在 2012年5月11日 下午5:15,Ray Wang <wangru...@gmail.com>写道:

Ray Wang

unread,
May 11, 2012, 5:27:38 AM5/11/12
to sh...@googlegroups.com
如果在安装软件包的时候用了sudo的话,那么tools工具链权限也会错误的。

ning zhou

unread,
May 11, 2012, 5:32:38 AM5/11/12
to sh...@googlegroups.com
那要看看他的权限问题是不是这个问题导致的了。

@Ray, Wang, 你是不是用 ubuntu编的,你有没有把/bin/sh 指向 /bin/bash?如果没有的话,可能接下来会碰到问题哦。

ybzhao

unread,
May 12, 2012, 10:02:02 PM5/12/12
to sh...@googlegroups.com
你是忘了在/下面给/mnt/lfs/tools建符号链接了,就算你现在sudo成功了,后面chroot到/mnt/lfs还是会出错,最后你还得把/tools目录拷到lfs里

2012/5/11, pt zero <fg1...@gmail.com>:

--
从我的移动设备发送

z7z8th

ning zhou

unread,
May 13, 2012, 12:40:45 AM5/13/12
to sh...@googlegroups.com
不会吧,那让他 ls -l tools 看看有没有链接到/mnt/lfs/tools。我觉得他不会连这个都忘了。

2012/5/13 ybzhao <ybzha...@gmail.com>

z7z8th

unread,
May 13, 2012, 4:31:21 AM5/13/12
to sh...@googlegroups.com
make | tee 1.log 是不会将错误信息输出到1.log的,1.log里只有正常的信息。
需要make 2>&1 |tee 1.log


在 2012年5月10日星期四UTC+8下午6时05分40秒,zeropoint写道:

pt zero

unread,
May 13, 2012, 9:08:20 PM5/13/12
to sh...@googlegroups.com
不好意思,之前没时间上, 
 MARK  make | tee 1.log 是不会将错误信息输出到1.log的,1.log里只有正常的信息。

tools 的权限在之前就看过的啊,ln -sv $LFS    ls -al $LFS  
 显示成功的啊,话说 sudo 后第一遍成功后面继续还是失败,是工具链错误?

需要make 2>&1 |tee 1.log 

2012/5/13 z7z8th <ybzha...@gmail.com>

ning zhou

unread,
May 13, 2012, 9:21:51 PM5/13/12
to sh...@googlegroups.com
你先看看前面的帖子吧。另外,兄弟,log都没有么。

Ray Wang

unread,
May 14, 2012, 5:49:40 AM5/14/12
to sh...@googlegroups.com
我开始用的是Ubuntu,但是发现问题很多问题,就换了debian,debian的库相对标准一些。那个符号链接我创建了。

ybzhao

unread,
May 14, 2012, 9:57:07 AM5/14/12
to sh...@googlegroups.com
说的是,ubuntu里sysv-init和upstart同时存在,当时关sshd的时候搞了我半天。
--
z7z8th

pt zero

unread,
May 15, 2012, 8:01:34 PM5/15/12
to sh...@googlegroups.com

找出了错误原因,的确是权限的问题,之前没有设置好环境LFS的/tools  和/sources 组应该exprot LFs=/mnt/lfs 之后以LFS组开创建前两个目录,至于之前讨论过的宿主机的问题也是同样,最好先创建一个干净的环境,这样以后编译的时候就完全和宿主脱离关系也不会调用宿主的库,最后很感谢各位热心帮忙:),我会将以上整理好发布出来:),帮助同样想要了解和喜欢Linux的朋友

Reply all
Reply to author
Forward
0 new messages