我在看lnmp安装脚本的时候,有一段修改配置文件libc6-xen.conf的代码,不是特别理解。

WBOY
发布: 2023-03-02 07:36:02
原创
1621 人浏览过

lnmp.org V1.3版本

有一个方法Xen_Hwcap_Setting,我看把配置文件libc6-xen.confhwcap 1 nosegneg改为了hwcap 0 nosegneg,这样有什么作用吗?代码如下:

<code>Xen_Hwcap_Setting()
{
    if [ -s /etc/ld.so.conf.d/libc6-xen.conf ]; then
        sed -i 's/hwcap 1 nosegneg/hwcap 0 nosegneg/g' /etc/ld.so.conf.d/libc6-xen.conf
    fi
}</code>
登录后复制
登录后复制

到网上搜了一下,但不是特别明白,期待大家能给我解答,谢谢

============== 补充下 ===========

可能我问题提的有点问题,我更想知道的是,这个配置hwcap 1 nosegneg起什么作用?为什么要修改这个配置为hwcap 0 nosegneg

来自apt-browse的一段话.

# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 1 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg

回复内容:

lnmp.org V1.3版本

有一个方法Xen_Hwcap_Setting,我看把配置文件libc6-xen.confhwcap 1 nosegneg改为了hwcap 0 nosegneg,这样有什么作用吗?代码如下:

<code>Xen_Hwcap_Setting()
{
    if [ -s /etc/ld.so.conf.d/libc6-xen.conf ]; then
        sed -i 's/hwcap 1 nosegneg/hwcap 0 nosegneg/g' /etc/ld.so.conf.d/libc6-xen.conf
    fi
}</code>
登录后复制
登录后复制

到网上搜了一下,但不是特别明白,期待大家能给我解答,谢谢

============== 补充下 ===========

可能我问题提的有点问题,我更想知道的是,这个配置hwcap 1 nosegneg起什么作用?为什么要修改这个配置为hwcap 0 nosegneg

来自apt-browse的一段话.

# This directive teaches ldconfig to search in nosegneg subdirectories
# and cache the DSOs there with extra bit 1 set in their hwcap match
# fields. In Xen guest kernels, the vDSO tells the dynamic linker to
# search in nosegneg subdirectories and to match this extra hwcap bit
# in the ld.so.cache file.
hwcap 1 nosegneg

-s在shell文件判断中的意思是文件是否有内容,如果没有内容,就执行下面的sed
至于最开始的

<code>test_name()
{

}</code>
登录后复制

其实就是一个函数!

sed使用参数

<code>
-i :直接修改读取的文件内容,而不是输出到终端

   </code>
登录后复制

数据的搜寻并替换
除了整行的处理模式之外, sed 还可以用行为单位进行部分数据的搜寻并取代。基本上 sed 的搜寻与替代的与 vi 相当的类似!他有点像这样:

<code>
sed 's/要被取代的字串/新的字串/g'

</code>
登录后复制

所以你这句代码的意思是

<code>全局把hwcap 1 nosegneg替换成hwcap 0 nosegneg</code>
登录后复制
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!