LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
楼主: d00m3d

再探编译源码升级 glibc 的问题

[复制链接]
 楼主| 发表于 2007-12-13 07:17:50 | 显示全部楼层
莫非 glibc 的 developers 也知道 cp 会完蛋,用 mv 才行?

但是为什麽 mv 可以,cp 又不行呢?
回复 支持 反对

使用道具 举报

发表于 2007-12-15 21:27:52 | 显示全部楼层
slackware用了另一种方法,我试了,在slackware上可以,我拿到LFS上用就不行.
不过slackware的方法在slackware上似乎也有出错信息,只不过不显示
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-16 11:48:47 | 显示全部楼层
好奇心驱使,请 LanEast 兄说说 Slackware 的方法有啥不同吧
回复 支持 反对

使用道具 举报

发表于 2007-12-16 21:29:29 | 显示全部楼层
  1. if [ -r /proc/ksyms ]; then
  2.   echo "FATAL: you need to be running a 2.6.x kernel in order to upgrade"
  3.   echo "to this version of glibc."
  4.   echo
  5.   sleep 999
  6.   exit 1
  7. fi

  8. # Next, stop using the /lib/ntpl libraries.  These are now obsolete and
  9. # will break the installation if present:
  10. if [ -d lib/tls ]; then
  11.   mkdir -p lib/obsolete
  12.   mv lib/tls lib/obsolete
  13. fi
  14. if [ -x sbin/ldconfig ]; then
  15.   sbin/ldconfig -r .
  16. fi

  17. # Install NPTL glibc libraries:
  18. if [ -x /sbin/ldconfig -a -d lib/incoming ]; then # swap on the fly
  19.   # First create copies of the incoming libraries:
  20.   ( cd lib/incoming
  21.     for file in * ; do
  22.       if [ ! -r ../${file}.incoming ]; then
  23.         cp -a $file ../${file}.incoming
  24.       fi
  25.     done
  26.   )
  27.   # Then switch to them all at once:
  28.   /sbin/ldconfig -l lib/*.incoming 2> /dev/null
  29.   # Finally, rename them and clean up:
  30.   ( cd lib
  31.     for file in *.incoming ; do
  32.       rm -f `basename $file .incoming`
  33.       cp -a $file `basename $file .incoming`
  34.       /sbin/ldconfig -l `basename $file .incoming`
  35.       rm -f $file
  36.     done
  37.   )
  38. else # no ldconfig?  Good, it's safe to just jam it on home (and make links below):
  39.   ( cd lib/incoming
  40.     for file in * ; do
  41.       cp -a $file ..
  42.     done
  43.   )
  44. fi
  45. # Now, get rid of the temporary directory:
  46. rm -rf lib/incoming
  47. # Done installing NPTL glibc libraries.
复制代码

这个是slackware的glibc-solibs-2.5-i486-4.tgz的安装脚本中的关键部分
我直接把

  1. if [ -x /sbin/ldconfig -a -d lib/incoming ]; then # swap on the fly
  2.   # First create copies of the incoming libraries:
  3.   ( cd lib/incoming
  4.     for file in * ; do
  5.       if [ ! -r ../${file}.incoming ]; then
  6.         cp -a $file ../${file}.incoming
  7.       fi
  8.     done
  9.   )
  10.   # Then switch to them all at once:
  11.   /sbin/ldconfig -l lib/*.incoming 2> /dev/null
  12.   # Finally, rename them and clean up:
  13.   ( cd lib
  14.     for file in *.incoming ; do
  15.       rm -f `basename $file .incoming`
  16.       cp -a $file `basename $file .incoming`
  17.       /sbin/ldconfig -l `basename $file .incoming`
  18.       rm -f $file
  19.     done
  20.   )
  21. else # no ldconfig?  Good, it's safe to just jam it on home (and make links below):
  22.   ( cd lib/incoming
  23.     for file in * ; do
  24.       cp -a $file ..
  25.     done
  26.   )
  27. fi
复制代码

存成一个脚本使用,比直接cp要好一些,cp一用就挂,这个脚本用了至少shell不挂,但是其它的命令就用不了了
在slackware中使用,出现了segment fault的提示,但是没什么影响
回复 支持 反对

使用道具 举报

发表于 2007-12-17 18:23:18 | 显示全部楼层
看大家讨论得热烈,对这种重要问题,我也来凑个热闹吧。

1。关于 mv 和 cp的问题,我觉得还是有区别的:因为直觉上mv只是修改了目录结构,而cp需要完整的文件操作;或许在 glibc更新过程中进行文件操作会破坏系统的完整性;

2。最关键的问题是,在单纯升级 glic 后,是否会有比较核心的程序崩溃?是否需要立刻重新编译内核等等,这个不知道是否有现成的资料?我觉得如果解决了这个问题,对LFS的应用会更有意义。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-12-18 07:07:21 | 显示全部楼层
1. 不详

2. 这要看新旧旧版之间有哪些地方不同,多数情况下是向下兼容的,问题应该不大,但也有可能某些程序会有问题,这不奇怪。

内核虽然也是 C 程序,但出问题的机会并不大,否则 glibc 是不会 release 出来的

资料方面,源码包里的文档应该很详细了
回复 支持 反对

使用道具 举报

发表于 2007-12-18 22:04:47 | 显示全部楼层
Post by linux001;1796752
看大家讨论得热烈,对这种重要问题,我也来凑个热闹吧。

1。关于 mv 和 cp的问题,我觉得还是有区别的:因为直觉上mv只是修改了目录结构,而cp需要完整的文件操作;或许在 glibc更新过程中进行文件操作会破坏系统的完整性;

2。最关键的问题是,在单纯升级 glic 后,是否会有比较核心的程序崩溃?是否需要立刻重新编译内核等等,这个不知道是否有现成的资料?我觉得如果解决了这个问题,对LFS的应用会更有意义。


1.这个不太清楚,不过感觉有点像这个意思-_-U

2.升级过glibc,但是升级完了之后就很少用升级之后的系统,所以稳定性就不太清楚了.另外,内核应该不依赖glibc的吧?
回复 支持 反对

使用道具 举报

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

本版积分规则

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