<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>编译点滴 &#187; ebuild</title>
	<atom:link href="http://www.lingcc.com/tag/ebuild/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lingcc.com</link>
	<description>编译器、虚拟机、程序设计语言、体系结构、软件调试、操作系统等等</description>
	<lastBuildDate>Sat, 04 Feb 2012 06:56:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Gentoo上安装Texlive2009</title>
		<link>http://www.lingcc.com/2010/04/09/10732/</link>
		<comments>http://www.lingcc.com/2010/04/09/10732/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 14:33:38 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[编译技术]]></category>
		<category><![CDATA[ctex]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[latex 中文]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[spec]]></category>
		<category><![CDATA[texlive]]></category>
		<category><![CDATA[USE]]></category>
		<category><![CDATA[x86]]></category>
		<category><![CDATA[写论文]]></category>
		<category><![CDATA[字体]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10732</guid>
		<description><![CDATA[最近想折腾用texlive写点东西，而且要支持中文。就冲着texlive-2009了。大学毕业论文就是用latex写的，不过那是在Windoews下，用CTEX包，很是方便，Gentoo就有点不一样了。虽然texlive有自己的iso镜像，有自己的安装工具和包管理工具，但Gentoo还是将它拆分成了很多的packge来装。这样也好，比较灵活。 下面就开始吧。 首先是keywords和use，因为现在2009还不稳定，而我用的是x86就要增加一堆的keyword，如下： app-text/texlive ~x86 app-text/texlive-core ~x86 dev-texlive/texlive-documentation-english ~x86 dev-texlive/texlive-documentation-base ~x86 dev-texlive/texlive-basic ~x86 dev-texlive/texlive-bibtexextra ~x86 dev-texlive/texlive-context ~x86 dev-texlive/texlive-xetex ~x86 dev-texlive/texlive-genericrecommended ~x86 dev-texlive/texlive-genericextra ~x86 dev-texlive/texlive-htmlxml ~x86 media-libs/silgraphite ~x86 app-text/teckit ~x86 dev-texlive/texlive-latexrecommended ~x86 dev-texlive/texlive-latex ~x86 app-text/ptex ~x86 dev-texlive/texlive-texinfo ~x86 dev-texlive/texlive-formatsextra ~x86 dev-texlive/texlive-metapost ~x86 dev-texlive/texlive-mathextra ~x86 dev-texlive/texlive-fontsextra ~x86 dev-texlive/texlive-langcjk ~x86 dev-texlive/texlive-fontsrecommended ~x86 dev-texlive/texlive-fontutils ~x86 app-text/xdvik ~x86 dev-texlive/texlive-music ~x86 <a href='http://www.lingcc.com/2010/04/09/10732/'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ebuild and emerge</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/04/21/10761/' rel='bookmark' title='Gentoo安装texlive2009&#8211;字体'>Gentoo安装texlive2009&#8211;字体</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2010/04/16/10746/' rel='bookmark' title='来仔细看看GCC 4.5.0'>来仔细看看GCC 4.5.0</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>最近想折腾用texlive写点东西，而且要支持中文。就冲着texlive-2009了。大学毕业论文就是用latex写的，不过那是在Windoews下，用CTEX包，很是方便，Gentoo就有点不一样了。虽然texlive有自己的iso镜像，有自己的安装工具和包管理工具，但Gentoo还是将它拆分成了很多的packge来装。这样也好，比较灵活。</p>
<p>下面就开始吧。</p>
<p>首先是keywords和use，因为现在2009还不稳定，而我用的是x86就要增加一堆的keyword，如下：</p>
<div id="_mcePaste">app-text/texlive ~x86</div>
<div id="_mcePaste">app-text/texlive-core ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-documentation-english ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-documentation-base ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-basic ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-bibtexextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-context ~x86<span id="more-10732"></span></div>
<div id="_mcePaste">dev-texlive/texlive-xetex ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-genericrecommended ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-genericextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-htmlxml ~x86</div>
<div id="_mcePaste">media-libs/silgraphite ~x86</div>
<div id="_mcePaste">app-text/teckit ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-latexrecommended ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-latex ~x86</div>
<div id="_mcePaste">app-text/ptex ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-texinfo ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-formatsextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-metapost ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-mathextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-fontsextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-langcjk ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-fontsrecommended ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-fontutils ~x86</div>
<div id="_mcePaste">app-text/xdvik ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-music ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-omega ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-games ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-publishers ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-humanities ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-science ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-latexextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-latexextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-langcyrillic ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-plainextra ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-documentation-chinese ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-pstricks ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-pictures ~x86</div>
<div id="_mcePaste">dev-texlive/texlive-luatex ~x86</div>
<div id="_mcePaste">dev-lisp/clisp ~x86</div>
<div>至于use，别忘了cjk就行。</div>
<div>然后就能emerge -av  texlive 开始安装了。安装过程中出了几个小问题，有的可能解决方法比较笨，呵呵。如下：</div>
<div>
<ul>
<li>(&#8216;ebuild&#8217;, &#8216;/&#8217;,  &#8216;app-text/texlive-core-2009-r1&#8242;, &#8216;merge&#8217;) pulled in by app-text/texlive-core required by (&#8216;installed&#8217;, &#8216;/&#8217;,  &#8216;virtual/tex-base-0&#8242;, &#8216;nomerge&#8217;) (&#8216;ebuild&#8217;, &#8216;/&#8217;,  &#8216;app-text/ptex-3.1.10_p20090610-r1&#8242;, &#8216;merge&#8217;) pulled in by app-text/ptex required by (&#8216;installed&#8217;, &#8216;/&#8217;, &#8216;virtual/latex-base-1.0&#8242;,  &#8216;nomerge&#8217;)  just emerge -c  all texlive package /卸载所有texlive相关的包</li>
<li> ptex and   dev-texlive/texlive-fontutils Detected file collision(s)   /usr/bin/epstopdf， emerge -C  app-text/ptex</li>
<li>xindy-2.3 build fail. <a class="externalLink" title="External link to http://bugs.gentoo.org/show_bug.cgi?id=281271" href="http://bugs.gentoo.org/show_bug.cgi?id=281271" target="_blank">http://bugs.gentoo.org/show_bug.cgi?id=281271</a>.  add the patch. make pass</li>
</ul>
</div>
<p>如果一切顺利的话，接下来就能用了。别忘了看看自己系统支持的中文字体，使用这个命令<br />
$ fc-list :lang=zh-cn<br />
本博用来测试各个字体的test-fonts.tex文件，其他问题日后遇到了再详谈，enjoy it :)<br />
<code><br />
\documentclass[12pt,a4paper]{article}<br />
\usepackage{fontspec}<br />
\setromanfont{AR PL UMing CN}<br />
\begin{document}<br />
{\setromanfont{WenQuanYi Micro Hei Mono}<br />
不需要安装字体，文泉驿等宽微米黑,文泉驛等寬微米黑,WenQuanYi Micro Hei Mono  \\}<br />
{\setromanfont{WenQuanYi Zen Hei}<br />
不需要安装字体，文泉驿 正黑 \\}<br />
{\setromanfont{WenQuanYi Zen Hei Mono}<br />
不需要安装字体，文泉驿 正黑 Mono \\}<br />
{\setromanfont{WenQuanYi Zen Hei Sharp}<br />
不需要安装字体，文泉驿 正黑 Sharp \\}<br />
{\setromanfont{AR PL UMing TW}<br />
不需要安装字体, AR PL UMing TW \\}<br />
{\setromanfont{AR PL UMing TW MBE}<br />
不需要安装字体, UMing TW MBE \\}<br />
{\setromanfont{AR PL UMing HK}<br />
不需要安装字体, AR PL UMing HK \\}<br />
{\setromanfont{AR PL UMing CN}<br />
不需要安装字体, UMing CN\\}<br />
{\setromanfont{AR PL UKai CN}<br />
不需要安装字体, UKai CN \\}<br />
{\setromanfont{AR PL UKai HK}<br />
不需要安装字体, UKai HK \\}<br />
{\setromanfont{AR PL UKai TW}<br />
不需要安装字体, UKai TW \\}<br />
{\setromanfont{AR PL UKai TW MBE}<br />
不需要安装字体, UKai TW MBE \\}<br />
{\setromanfont{AR PL KaitiM GB}<br />
不需要安装字体, AR PL KaitiM GB \\}<br />
\end{document}</code></p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ebuild and emerge</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/04/21/10761/' rel='bookmark' title='Gentoo安装texlive2009&#8211;字体'>Gentoo安装texlive2009&#8211;字体</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2010/04/16/10746/' rel='bookmark' title='来仔细看看GCC 4.5.0'>来仔细看看GCC 4.5.0</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/04/09/10732/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gentoo 沙盘简介</title>
		<link>http://www.lingcc.com/2010/03/07/10707/</link>
		<comments>http://www.lingcc.com/2010/03/07/10707/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 11:06:11 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[Linux系统]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[MPI]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[sandbox]]></category>
		<category><![CDATA[操作系统 Operating system]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10707</guid>
		<description><![CDATA[emerge一个软件包时Portage的工作方式: 1,Portage下载源码tar包和补丁(如果需要的话) 2,Portage解压缩tar包到指定位置,所有的编译将在该目录展开,Portage默认使用/var/tmp/portage/packagename/work 3,解压和打补丁(如果需要的话)后(ebuild中的src_unpack()函数),Portage开始编译,一般情况下在特定目录(ebuild使用${WORKDIR}变量指定目录)下执行configure和make命令. 4,编译完成后,portage将所有指定目录下的文件合并到正在运行的系统中.(通常为/,但通过合并时设置ROOT=”/路径”可以修改),为了避免非法或不正确的ebuild对整个文件系统造成不可逆的破坏,我们需要严格限制文件系统的哪个区域允许portage在解压和编译时修改,这就是沙盘工作的路径,默认时,沙盘启动,并限定ebuild(和它执行过程中的明林)都在指定的区域内写磁盘.若ebuild越过沙盘保护的环境,试图在外部区域写磁盘,就构成了沙盘越界. 沙盘的用途: 沙盘是portage用来协助调试ebuild的机制.主要目的是提供一个安全的受保护的环境系统来运行功能未知的程序.实质上,它提供了一个可以用于编译源码包但不会干扰操作系统其他部分运行的环境. 在ebuild的src_unpack,src_compile,src_test和src_install阶段,ebuild.sh都在沙盘内操作. http://bugday.gentoo.org/sandbox.html http://devmanual.gentoo.org/general-concepts/sandbox/index.html 相关文章： 使用crossdev安装龙芯的O32 gnu交叉工具链 Ebuild and emerge gentoo的相关配置-make.conf Gentoo中的交叉编译利器&#8211;crossdev gentoo如何处理被屏蔽(masked)的包 by 杨珂 转自linuxsir 用crossdev装龙芯的n32 gnu交叉工具链<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ebuild and emerge</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">走进Debian和Gentoo中的系统初始化过程</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2008/02/27/9904/' rel='bookmark' title='gentoo的相关配置-make.conf'>gentoo的相关配置-make.conf</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>emerge一个软件包时Portage的工作方式:<br />
1,Portage下载源码tar包和补丁(如果需要的话)<br />
2,Portage解压缩tar包到指定位置,所有的编译将在该目录展开,Portage默认使用/var/tmp/portage/packagename/work<br />
3,解压和打补丁(如果需要的话)后(ebuild中的src_unpack()函数),Portage开始编译,一般情况下在特定目录(ebuild使用${WORKDIR}变量指定目录)下执行configure和make命令.<br />
4,编译完成后,portage将所有指定目录下的文件合并到正在运行的系统中.(通常为/,但通过合并时设置ROOT=”/路径”可以修改),为了避免非法或不正确的ebuild对整个文件系统造成不可逆的破坏,我们需要严格限制文件系统的哪个区域允许portage在解压和编译时修改,这就是沙盘工作的路径,默认时,沙盘启动,并限定ebuild(和它执行过程中的明林)都在指定的区域内写磁盘.若ebuild越过沙盘保护的环境,试图在外部区域写磁盘,就构成了沙盘越界.<br />
<span id="more-10707"></span><br />
沙盘的用途:<br />
沙盘是portage用来协助调试ebuild的机制.主要目的是提供一个安全的受保护的环境系统来运行功能未知的程序.实质上,它提供了一个可以用于编译源码包但不会干扰操作系统其他部分运行的环境.</p>
<p>在ebuild的src_unpack,src_compile,src_test和src_install阶段,ebuild.sh都在沙盘内操作.</p>
<p>http://bugday.gentoo.org/sandbox.html</p>
<p>http://devmanual.gentoo.org/general-concepts/sandbox/index.html</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ebuild and emerge</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F05%2F19%2F10892%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">走进Debian和Gentoo中的系统初始化过程</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2008/02/27/9904/' rel='bookmark' title='gentoo的相关配置-make.conf'>gentoo的相关配置-make.conf</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/03/07/10707/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>使用crossdev安装龙芯的O32 gnu交叉工具链</title>
		<link>http://www.lingcc.com/2010/01/07/10594/</link>
		<comments>http://www.lingcc.com/2010/01/07/10594/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 21:30:43 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[Linux系统]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[crossdev]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[glibc]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[make.conf]]></category>
		<category><![CDATA[MIPS]]></category>
		<category><![CDATA[MPI]]></category>
		<category><![CDATA[N32]]></category>
		<category><![CDATA[O32]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[x86]]></category>
		<category><![CDATA[交叉编译 cross compile]]></category>
		<category><![CDATA[工具链]]></category>
		<category><![CDATA[编译器]]></category>
		<category><![CDATA[龙芯]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10594</guid>
		<description><![CDATA[先来介绍一下n32和O32是啥，N32和O32就是MIPS系统上不同的ABI，即Application Binary Interface。MIPS体系结构最早只有o32的系统，但后来改进了寄存器的功能和分配方式，于是就又有了N32，相对于O32，N32的速度更快些。但二者目前在龙芯系统上还无法兼容。因为龙芯目前官方只支持O32，而N32有只有zhllg的overlay中有，所以使用gentoo来安装O32的工具链需要额外解决些问题，所以才有了这篇文章，之所以之前又写了N32的安装方法，是因为有zhllg大牛的技术支持，使得能直接安装N32的工具链。 言归正转，开始安装我们的O32工具链，因为使用crossdev(如果你还不知道什么是crossdev，请参考Gentoo中的交叉编译利器–crossdev)，我们仍旧需要配置龙芯的overlay。详细的配置过程参见用crossdev装龙芯的n32 gnu交叉工具链，我这里只简单列出命令： cd /root git clone git://www.gentoo-cn.org/var/git/loongson.git cd /usr/local/portage/ mkdir loongson cd loongson ln -s /root/loongson-overlay/sys-libs/ sys-libs ##glibc指向overlay中的glibc ln -s /root/loongson-overlay/sys-devel/ sys-devel ##将gcc指向overlay中的gcc 接下来修改make.conf，确保/usr/local/portage/loongson在你所有overlay查找的最前面： PORTDIR_OVERLAY="/usr/local/portage/loongson $PORTDIR_OVERLAY" 这样做是为了确保使用龙芯overlay中的gcc和binutils。 下面还不能直接执行 crossdev -t mipsel-unknown-linux-gnu 因为现在overlay还不支持O32的工具链，需要我们做些修改，这些修改是我安装的时候google并参考zhllg在n32工具链的bugfix做的，目前能正常安装并能编译运行helloworld，应该没有任何问题:) 在目录/usr/local/portage/loongson/sys-libs/glibc下，做如下修改 files/eblits/src_compile.eblit 160a161,167 + if [[ ${CTARGET} == "mipsel-unknown-linux-gnu" ]] ; then + # remove "-32" gcc switch, since gcc <a href='http://www.lingcc.com/2010/01/07/10594/'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F08%2F15%2F11127%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于龙芯公司的小道消息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F06%2F28%2F10983%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">龙芯N32系统上的Squirrelfish性能</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F07%2F10%2F11060%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">webkit-龙小组成立</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F05%2F10588%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">用crossdev装龙芯的n32 gnu交叉工具链</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F17%2F9957%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">胡伟武：龙芯5年内改变全球CPU格局</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/01/21/10663/' rel='bookmark' title='小例子&#8211;回眸一笑百媚生'>小例子&#8211;回眸一笑百媚生</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>先来介绍一下n32和O32是啥，N32和O32就是MIPS系统上不同的ABI，即Application Binary Interface。MIPS体系结构最早只有o32的系统，但后来改进了寄存器的功能和分配方式，于是就又有了N32，相对于O32，N32的速度更快些。但二者目前在龙芯系统上还无法兼容。因为龙芯目前官方只支持O32，而N32有只有zhllg的overlay中有，所以使用gentoo来安装O32的工具链需要额外解决些问题，所以才有了这篇文章，之所以之前又写了<a href="../../../../2010/01/05/10588/">N32的安装方法</a>，是因为有zhllg大牛的技术支持，使得能直接安装N32的工具链。<span id="more-10594"></span></p>
<p>言归正转，开始安装我们的O32工具链，因为使用crossdev(如果你还不知道什么是crossdev，请参考<a href="../../../../2009/12/31/10534/">Gentoo中的交叉编译利器–crossdev</a>)，我们仍旧需要配置龙芯的overlay。详细的配置过程参见<a href="../../../../2010/01/05/10588/">用crossdev装龙芯的n32 gnu交叉工具链</a>，我这里只简单列出命令：<code><br />
cd /root<br />
git clone git://www.gentoo-cn.org/var/git/loongson.git<br />
cd /usr/local/portage/<br />
mkdir loongson<br />
cd loongson<br />
ln -s /root/loongson-overlay/sys-libs/  sys-libs    ##glibc指向overlay中的glibc<br />
ln -s /root/loongson-overlay/sys-devel/  sys-devel  ##将gcc指向overlay中的gcc<br />
</code><br />
接下来修改make.conf，确保/usr/local/portage/loongson在你所有overlay查找的最前面：<code><br />
PORTDIR_OVERLAY="/usr/local/portage/loongson $PORTDIR_OVERLAY"</code><br />
这样做是为了确保使用龙芯overlay中的gcc和binutils。</p>
<p>下面还不能直接执行<br />
<code>crossdev -t mipsel-unknown-linux-gnu</code><br />
因为现在overlay还不支持O32的工具链，需要我们做些修改，这些修改是我安装的时候google并参考zhllg在n32工具链的bugfix做的，目前能正常安装并能编译运行helloworld，应该没有任何问题:)</p>
<p>在目录/usr/local/portage/loongson/sys-libs/glibc下，做如下修改<br />
<code>files/eblits/src_compile.eblit<br />
160a161,167<br />
+     if [[ ${CTARGET} == "mipsel-unknown-linux-gnu" ]] ; then<br />
+         # remove "-32" gcc switch, since gcc for other arch don't have this<br />
+         sed -i '2 s/-mabi=32//g' "${S}"/ports/sysdeps/mips/mips32/Makefile<br />
+         # fix stdio_lim.h missing problem<br />
+         sed -i 's/_MIPS_SZPTR/32/' "${S}"/ports/sysdeps/mips/bits/wordsize.h<br />
+<br />
+     fi<br />
files/eblits/src_install.eblit<br />
203a204,207<br />
+     if [[ ${CTARGET} == "mipsel-unknown-linux-gnu" ]] ; then<br />
+         sed -i 's/\(__WORDSIZE.\+\)\(32\|64\)$/\1_MIPS_SZPTR/' \<br />
+             "${D}"/$(alt_headers)/bits/wordsize.h || die "restore wordsize.h failed"<br />
+     fi</code><br />
上面修改共三处，第一处解决emerge glibc-header时报的 gcc doesn&#8217;t support -mabi=32 错。修改方式是直接删除此选项，因为我们使用x86上的gcc而这个选项是支持O32的gcc才能接受的选项。<br />
第二，三处修改解决同一个问题，Emerging cross-gcc-stage1时出错/usr/mipsel-unknown-linux-gnu/sys-include/stdio.h  error: bits/stdio_lim.h: No such file or directory。 对于这个错误，你有两种修改方式，可以直接touch stdio_lim.h这个文件，这是很多手工编译工具链时给的建议。这里我们使用另一种方法，阻止该文件被include到stdio.h中，这是zhllg在N32工具链中使用的方式。</p>
<p>修改完了之后别忘了重新生成ebuild校验。<br />
<code>ebuild glibc-2.10.1.ebuild manifest<br />
ebuild glibc-2.9_p20081201-r2.ebuild manifest</code></p>
<p>bug修改完成，接下来，你就可以直接使用crossdev安装了。<br />
<code>crossdev -t mipsel-unknown-linux-gnu</code></p>
<p>Enjoy it！</p>
<p>PS：</p>
<ol>
<li>这是自己第一次修改ebuild，呵呵其实很简单，但自己一直都把自己当成用户，没有做过这种事，不敢做，所以浪费了很多时间，看着自己改出来的bug，心情很不一样哈。</li>
<li>我已经将上面的修改提交给了zhllg，等他做了相应的修改，就可以直接crossdev安装了。请关注此文。</li>
</ol>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F08%2F15%2F11127%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">关于龙芯公司的小道消息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F06%2F28%2F10983%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">龙芯N32系统上的Squirrelfish性能</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F07%2F10%2F11060%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">webkit-龙小组成立</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F05%2F10588%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">用crossdev装龙芯的n32 gnu交叉工具链</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F17%2F9957%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F07%2F10594%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">胡伟武：龙芯5年内改变全球CPU格局</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/01/21/10663/' rel='bookmark' title='小例子&#8211;回眸一笑百媚生'>小例子&#8211;回眸一笑百媚生</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/01/07/10594/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ebuild and emerge</title>
		<link>http://www.lingcc.com/2010/01/02/10570/</link>
		<comments>http://www.lingcc.com/2010/01/02/10570/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 13:22:14 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[Linux系统]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[IT生活]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MIPS]]></category>
		<category><![CDATA[MPI]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[spec]]></category>
		<category><![CDATA[USE]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10570</guid>
		<description><![CDATA[记录自己学习ebuild的一点东西。但是还不完整。<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F08%2F27%2F9982%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">zz Linux下的段错误的原因及调试</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/05/03/10884/' rel='bookmark' title='安装LLVM2.7 step by step'>安装LLVM2.7 step by step</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>折腾了半天的ebuild,将记录张贴如下：</p>
<li>ebuild 包含下载，解压，编译安装包的全部信息，还有卸载和配置内容。大多数ebuild用bash脚本编写。简单来说就是一个Portage系统的底层z直接接 口,它可以通过命令执行ebuild文件中提供的子功能。包括下载源码包(fetch),解压(unpack),配置(configure),编译 (make),安装目标文件(install)甚至包括重新打包为二进制压缩包(package)</li>
<li>例如，以我现在正在安装的cross-mips64el-unknown-linux-gnu/gcc为例，需要使用gcc-4.4.2.ebuild。运行 ebuild gcc-4.4.2.ebuild help 会得到能执行的命令，如下<span id="more-10570"></span></li>
<p><code>ebuild /usr/local/portage/loongson/cross-mips64el-unknown-linux-gnu/gcc/gcc-4.4.2.ebuild  help</code><br />
你就可以看到ebuild能执行的命令了，这里列举几个和安装有关的。<br />
help        : show this help screen,帮助信息<br />
setup       : execute package specific setup actions，执行设置命令，检测系统环境和系统变量设置以及设置必要的环境变量<br />
fetch       : download source archive(s) and patches，在指定的URL下载源码包<br />
unpack      : unpack sources (auto-dependencies if needed) 解压源码包<br />
prepare     : prepare sources (auto-dependencies if needed)<br />
configure   : configure sources (auto-fetch/unpack if needed) 执行configure脚本得到makefile，在gcc的ebuild里，configure和make一起完成了。<br />
compile     : compile sources (auto-fetch/unpack/configure if needed) 执行make命令<br />
test        : test package (auto-fetch/unpack/configure/compile if needed)  执行make test<br />
install     : install the package to the temporary install directory  执行make install，安装到/var下的指定目录<br />
qmerge      : merge image into live filesystem, recording files in db  将make install得到的镜像安装到系统中，并升级db<br />
merge       : do fetch, unpack, compile, install and qmerge  <em>将上面几步一起完成<br />
unmerge     : remove package from live filesystem </em>相当于emerge -C<br />
config      : execute package specific configuration actions<br />
package     : create a tarball package in /usr/portage/packages/All  <em>将编译出的二进制文件打包<br />
rpm         : build a <a title="The tiddler 'RedHat' doesn't yet exist" href="javascript:;">RedHat</a> RPM package </em>生成rpm包<br />
clean       : clean up all source and temporary files  删除/var/tmp/portage/下编译使用的所有临时文件。<br />
可 见基本上emerge是ebuild分解动作的连续执行，但是有个疑问，ebuild是在何时根据use的配置configure。根据上面的这些命令， 应该是在setup时。在setup的过程中，ebuild会根据当前的系统设置和USE设置，检测系统，并export很多的系统变量。并保存到文件 environment中</p>
<li>ebuild的命名：pkg-ver{_suf{#}}}{-r#}.ebuild</li>
<li>ebuild 的内容，头部，变量，函数和帮助函数四部分。其中，变量包括:包和版本相关变量(P,PN,PV,PR,PVR,PF,CATEGORY,A),目录 (WORKDIR,FILESDIR,S,T,D)。几个关键函数:pkg_setup(),pkg_nofetch,src_unpack(解压到 WORKDIR),src_prepare(准备源码，包括打补丁),src_configure(configure在这部分完 成),src_compile(编译过程),src_test(运行包里面的测试集测试),src_install(包含所有安装目标文件夹信 息),pkg_config(安装之后的配置)</li>
<li>portage相关</li>
<li>portage使用python和bash编写，基于ebuild。</li>
<li>emerge &#8211;sync emerge-webrsync同步portage树</li>
<li>emerge search pdf ,emerge searchdesc pdf 前者搜索包名称中有pdf的，后者搜索包介绍中有pdf的。</li>
<li>emerge 命令是比较基本的软件包管理工具，它会自动的完成下载源码包，解压，configure,make,make install的功能，其中下载源码包默认就在/usr/portage/distfiles/文件夹下。解压，configure,make 都在/var/tmp/portage/下。</li>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F08%2F27%2F9982%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">zz Linux下的段错误的原因及调试</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/05/03/10884/' rel='bookmark' title='安装LLVM2.7 step by step'>安装LLVM2.7 step by step</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2010/01/02/10570/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gentoo中的交叉编译利器&#8211;crossdev</title>
		<link>http://www.lingcc.com/2009/12/31/10534/</link>
		<comments>http://www.lingcc.com/2009/12/31/10534/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 14:03:21 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[Linux系统]]></category>
		<category><![CDATA[amd]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[crossdev]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[elf]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[glibc]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[make.conf]]></category>
		<category><![CDATA[MIPS]]></category>
		<category><![CDATA[MPI]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[spec]]></category>
		<category><![CDATA[USE]]></category>
		<category><![CDATA[x86]]></category>
		<category><![CDATA[交叉编译 cross compile]]></category>
		<category><![CDATA[工具链]]></category>
		<category><![CDATA[编译器]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://www.lingcc.com/?p=10534</guid>
		<description><![CDATA[本文介绍使用gentoo 上的crossdev 交叉编译环境构建工具便捷高效构建交叉编译器的过程<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Debian和Gentoo系统中Emacs 23不能使用ibus解决方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/03/08/10709/' rel='bookmark' title='GNU工具链学习笔记'>GNU工具链学习笔记</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<li>什么是Crossdev[I]</li>
<p><code>sys-devel/crossdev<br />
Available versions:  0.9.18-r10 ~0.9.19 **99999999<br />
Installed versions:  0.9.18-r10(03:44:50 PM 11/29/2009)<br />
Homepage:            http://www.gentoo.org/<br />
Description:         Gentoo Cross-toolchain generator</code><br />
交叉编译时很多嵌入式开发必须的工具，因为资料太少，遇到的问题又很难解决，所以交叉的开发环境一直让很多程序员头疼。我们就来了解一下gentoo下如何构建交叉编译环境。<br />
先说说工具链，工具链是用来组建一个系统的工具包集合，因为它们使用输入和输出连接在一起，所以称为链。通常工具链包括以下几部分：<span id="more-10534"></span></p>
<ul> binutils&#8211;用来生成二进制的基本工具(包括汇编器和连接起)</ul>
<ul> gcc&#8211;GNU编译器集(C和C++编译器)</ul>
<ul> glibc/uclibc/newlib&#8211;系统C语言库</ul>
<ul> linux-headers&#8211;系统文件库需要的内核头文件</ul>
<ul> gdb&#8211;GNU调试工具</ul>
<p>一般的Gentoo系统都将工具链作为基础系统的一部分，并且将工具链配置为能生成本机的二进制文件。为了能编译其他平台上的二进制文件，就需要交叉工具链，Gentoo提供了一个简单但很强大的工具CrossDev来管理工具链，它可以编译安装任意GCC支持的交叉工具链，因为Gentoo将工具链的文件安装在平台特定的目录下，所以Crossdev得到的交叉工具链不会干扰到本地的工具链。手工编造一个交叉工具链太痛苦了。。。。<!--more--></p>
<li>工具链使用的环境变量</li>
<p>工具链的环境变量总是让人很头疼，下面我们做个详细的介绍<br />
变量名&#8212;生成交叉工具链时的含义&#8212;生成目标平台二进制文件时的含义<br />
CBUILD&#8211;编译交叉工具链的平台&#8212;编译程序的平台<br />
CHOST&#8211;交叉工具链运行的平台&#8212;使用交叉工具链生成的二进制文件将运行的平台<br />
CTARGET&#8211;使用交叉工具链生成的二进制文件将运行的平台&#8211;使用交叉工具链生成的二进制文件将运行的平台(内容虽然重复，但设置它没有坏处，有些二进制包需要它)<br />
ROOT&#8211;将要安装的虚/路径<br />
PORTAGE_CONFIGROOT&#8211;portage能找到配置文件的虚/路径(如/etc/make.conf)<br />
若我们有个AMD64的gentoo机器，和一个想要开发程序的ARM PDA。那上面的变量可以设置如下：<br />
CBUILD&#8211;x86_64-pc-linux-gnu&#8211;x86_64-pc-linux-gnu<br />
CHOST&#8211;x86_64-pc-linux-gnu&#8211;arm-unknown-linux-gnu<br />
CTARGET&#8211;arm-unknown-linux-gnu&#8211;not set<br />
ROOT&#8212;[not set -- defaults to /]&#8212;[/path/where/you/install]<br />
PORTAGE_CONFIGROOT&#8212;[not set -- defaults to /]&#8212;-[/path/where/your/portage/env/for/arm/pda/is]</p>
<li>一些术语</li>
<p>cross-compiler	CHOST！=CTARGET的工具链<br />
canadian cross	加拿大式交叉编译CBUILD != CHOST &amp;&amp; CHOST != CTARGET的工具链<br />
CBUILD	build system 编译二进制文件所使用平台<br />
CHOST	host system 运行二进制文件所使用平台<br />
CTARGET	target system 编译得到的二进制文件将要运行的平台<br />
sysroot	system root 编译器用来查找它的标准头文件和库的根目录<br />
hardfloat	系统用来处理浮点数学运算的硬件浮点单元(FPU)<br />
softfloat	若系统没有硬件FPU,就需要所有的浮点数使用定点数学运算近似<br />
PIE		位置无关的执行(-fPIE -pie)<br />
PIC		位置无关代码(-fPIC)<br />
CRT		C语言运行时</p>
<li>系统元组</li>
<p>系统元组标记整个系统的特征，具体的内容由GNU config项目规定。具体的模式是机器(machine)-类型(vendor)-内核(kernel)-操作系统(operating system)。比如，博主我的电脑上就是i686-pc-linux-gnu.下表是一些比较常见的配置</p>
<table style="height: 258px;" width="513">
<tbody>
<tr>
<td><strong>机器</strong></td>
<td>类型</td>
<td><strong>内核</strong></td>
<td>操作系统</td>
</tr>
<tr>
<td>alpha<br />
arm / armeb<br />
avr / avr32<br />
bfin<br />
cris<br />
hppa / hppa1.1 / hppa2.0 / hppa64<br />
ia64<br />
i386 / i486 / i586 / i686<br />
m68k<br />
mips / mipsel / mips64 / mips64el<br />
nios / nios2<br />
powerpc / powerpc64<br />
sparc / sparcv8 / sparcv9 / sparc64<br />
s390 / s390x<br />
sh / sh3 / sh4 / sheb / sh3eb / sh4eb / sh64<br />
vax<br />
x86_64</td>
<td>gentoo<br />
pc<br />
softfloat [1]<br />
unknown</td>
<td>elf [2]<br />
freebsd6.2<br />
linux<br />
mingw32 / mingw64<br />
uclinux [3]</td>
<td>gnu [4]<br />
gnueabi [5]<br />
uclibc [6]<br />
uclibceabi</td>
</tr>
</tbody>
</table>
<p>来说说这其中几个比较有趣的：</p>
<ul> 类型那部分几乎可以随便设置，</ul>
<ul> 当操作系统指定为elf时，你就可以不用操作系统，而是直接把编译出的代码放到硬件上运行。</ul>
<ul>uclinux编译出的FLAT二进制文件，能在MMU不可用的Linux上运行</ul>
<ul> 操作系统中指定gnu表明系统库为libc</ul>
<li>言归正传，装我们的交叉编译器</li>
<p>我们的第一步当然是<code><br />
emerge -av crossdev</code><br />
这个命令会安装所有交叉编译相关的包。在博主的电脑上，就需要安装以下包<code><br />
emerge -pv crossdev</code></p>
<p>These are the packages that would be merged, in order:</p>
<p>Calculating dependencies&#8230; done!<br />
[ebuild  N    ] dev-util/unifdef-1.20  65 kB<br />
[ebuild  N    ] sys-devel/crossdev-0.9.18-r10  0 kB</p>
<p>Total: 2 packages (2 new), Size of downloads: 65 kB</p>
<p>注意，crossdev只是一个工具，我们的最终目的是使用crossdev编译一个交叉工具链出来，有必要先看看帮助，直接运行crossdev命令<br />
<code><br />
# crossdev<br />
Usage: crossdev [options] --target TARGET<br />
Options:<br />
--b, --binutils ver   Specify version of binutils to use<br />
--g, --gcc ver        Specify version of gcc to use<br />
--k, --kernel ver     Specify version of kernel headers to use<br />
--l, --libc ver       Specify version of libc to use<br />
-S, --stable          Use latest stable versions as default<br />
-C, --clean target    Uninstall specified target<br />
-P, --portage opts    Options to pass to emerge (see emerge(1))<br />
--with[out]-headers   Build C library headers before C compiler?<br />
Stage Options:<br />
-s0, --stage0         Build just binutils<br />
-s1, --stage1         Also build a C compiler (no libc/C++)<br />
-s2, --stage2         Also build kernel headers<br />
-s3, --stage3         Also build the C library (no C++)<br />
-s4, --stage4         Also build a C++ compiler [default]<br />
Extra Fun (must be run after above stages):<br />
--ex-only             Skip the stage steps above<br />
--ex-gcc              Build extra gcc targets (gcj/ada/etc...)<br />
--ex-gdb              Build a cross gdb<br />
--ex-insight          Build a cross insight<br />
Target (-t) takes a tuple ARCH-VENDOR-OS-LIBC; see 'crossdev -t help'</code><br />
上面可以看到，我们能用crossdev指定binutils gcc kernel和libc的版本，还有不同的编译stage来指定不同规模的工具链。甚至在Extra Fun中包含了gdb，扩展的gcc等支持，insight是gdb的图形化接口，博主没有用过，所以不知道。<br />
再来看看crossdev支持的系统元组们<br />
<code><br />
# crossdev -t help<br />
Supported Architectures:<br />
- alpha                                     - arm / armeb<br />
- hppa (parisc)                             - ia64<br />
- i386 / i486 / i586 / i686 (x86)           - m68k<br />
- mips / mipsel / mips64 / mips64el<br />
- powerpc (ppc) / powerpc64 (ppc64)<br />
- sparc / sparc64                           - s390 / s390x<br />
- sh / sh[1-5] / sh64                       - x86_64 (amd64)<br />
Supported C Libraries:<br />
- glibc (gnu)<br />
- klibc       [prob wont work]<br />
- newlib      [bare metal/no operating system]<br />
- uclibc      [not all arches are ported]<br />
Special Targets:<br />
- avr      http://www.nongnu.org/avr-libc/<br />
- bfin     http://blackfin.uclinux.org/<br />
- h8300    http://h8300-hms.sourceforge.net/<br />
- mingw32  http://www.mingw.org/<br />
- msp430   http://mspgcc.sourceforge.net/<br />
- nios2    http://www.altera.com/products/ip/processors/nios2/ni2-index.html<br />
- xc16x    http://www.infineon.com/<br />
- ee / iop / dvp (ps2) [Playstation 2 targets]<br />
- ppu / spu (cell) [Cell/Playstation 3 targets]<br />
Softfloat toolchains:<br />
Include 'softfloat' in the 'vendor' field<br />
e.g. armeb-softfloat-linux-uclibc  powerpc-booya_softfloat-linux-gnu<br />
</code><br />
不懂的话您就看看上面关于系统元组的介绍，具体我就不解释了，好了，现在看是安装。开动拉。。。。。因为博主要安装mips64el-unknown-linux-gnu的编译器，就直接运行了<br />
<code><br />
# crossdev --target mips64el-st-linux-gnu<br />
-------------------------------------------------------------------------------------------------------------------------------------------------------------<br />
* Host Portage ARCH:     x86<br />
* Target Portage ARCH:   mips<br />
* Target System:         mips64el-st-linux-gnu<br />
* Stage:                 4 (C/C++ compiler)</code></p>
<p>* binutils:              binutils-[latest]<br />
* gcc:                   gcc-[latest]<br />
* headers:               linux-headers-[latest]<br />
* libc:                  glibc-[latest]</p>
<p>* PORTDIR_OVERLAY:       /usr/local/portage/layman/gentoo-china<br />
* PORT_LOGDIR:           /var/log/portage<br />
* PKGDIR:                /usr/portage/packages/cross/mips64el-st-linux-gnu<br />
* PORTAGE_TMPDIR:        /var/tmp/cross/mips64el-st-linux-gnu<br />
_  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  &#8211;  _  &#8211;  ~  -<br />
* Forcing the latest versions of {binutils,gcc}-config/gnuconfig &#8230;                                                                                  [ ok ]<br />
* Log: /var/log/portage/cross-mips64el-st-linux-gnu-binutils.log<br />
* Emerging cross-binutils &#8230;<br />
这是个非常漫长的过程。。。。。。。。。因为是mips64el的，遇到了glibc checkfail的问题。这个问题正在解决中，以后再汇报。<br />
下面假设你安装的是arm的<br />
＃crossdev -t arm-unknown-linux-gnu</p>
<p>最后，再说说<br />
mips64el-unknown-linux-gnu 和mips64el-st-linux-gnu。其实没有区别，你可以简单的理解为是谁制作了这个工具链，比如st就代表这个工具链是ST作的，比如，我曾经使用的一个mips64el-st-linux-gnu就是曾经从意法半导体的网站上下载的，不过现在好像链接已经没有了。而mips64el-unknown-linux-gnu是上面crossdev自己编译出来的，在gentoo的overlay中，使用的就是unknown，所以就沿用了unknown</p>
<p>你可以参考下面几个链接<br />
<a href="http://www.gentoo.org/proj/en/base/embedded/handbook">http://www.gentoo.org/proj/en/base/embedded/handbook</a></p>
<p>http://psas.pdx.edu/GentooCrossCompilerHowto/</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2011%2F06%2F21%2F11673%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Debian和Gentoo系统中Emacs 23不能使用ibus解决方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F21%2F10761%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo安装texlive2009–字体</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2009%2F12%2F31%2F10534%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2009/12/29/10503/' rel='bookmark' title='GCC初窥'>GCC初窥</a></li>
<li><a href='http://www.lingcc.com/2008/03/28/9963/' rel='bookmark' title='gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir'>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</a></li>
<li><a href='http://www.lingcc.com/2010/03/08/10709/' rel='bookmark' title='GNU工具链学习笔记'>GNU工具链学习笔记</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2009/12/31/10534/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>gentoo如何处理被屏蔽(masked)的包   by 杨珂 转自linuxsir</title>
		<link>http://www.lingcc.com/2008/03/28/9963/</link>
		<comments>http://www.lingcc.com/2008/03/28/9963/#comments</comments>
		<pubDate>Mon, 29 Nov 1999 16:00:00 +0000</pubDate>
		<dc:creator>erlv</dc:creator>
				<category><![CDATA[Linux系统]]></category>
		<category><![CDATA[amd]]></category>
		<category><![CDATA[crossdev]]></category>
		<category><![CDATA[ebuild]]></category>
		<category><![CDATA[elf]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[ld]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[spec]]></category>
		<category><![CDATA[USE]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">http://lingcc.net/blog/?p=9963</guid>
		<description><![CDATA[原文是英文wiki里Dealing with masked packages那篇 http://gentoo-wiki.com/TIP_Dealing_with_masked_packages 感觉这篇很重要，在wiki里做为TIP类，自然表示可以带来很多方便，特别是后面那几个脚本 早就想翻译这篇了， 一直没动手，眼看下周就要开学了，要忙开学的事情。 所以今天赶紧把它译了出来 里面有一些专有词汇 如有问题请大家指正 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; 相关连的那篇也翻译了: Package.keywords的小技巧 原文 http://gentoo-wiki.com/TIP_package.keywords 同步的中文wiki http://zh.gentoo-wiki.com/Package.ke&#8230;8A%80%E5%B7%A7 wiki里这两篇文章的相关联系已经更新 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; 其他更新 HOWTO 用Cedega运行极品飞车9 http://zh.gentoo-wiki.com/HOWTO_%E7%&#8230;3%9E%E8%BD%A69 原文： http://gentoo-wiki.com/HOWTO_RUN_Nee&#8230;ed_with_Cedega &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; 处理被屏蔽(masked)的包 本文内容： 介绍 被关键字(keyword)屏蔽(masked)的包 被不明的关键字屏蔽 被严格屏蔽(Hard masked)的包 手动进行严格屏蔽 编辑/etc/portage/package.keywords文件的简便方法 开放一大群有联系的包 介绍 首先，被关键字(keyword)屏蔽(masked)的包都是测试中的或者不稳定的包： 注意： &#34;(masked by: ~keyword)&#34; Masked By ~keyword Package Example 代码: # emerge gnome-extra/gdesklets-core '''Calculating dependencies''' !!! <a href='http://www.lingcc.com/2008/03/28/9963/'>[...]</a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ebuild and emerge</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F04%2F10582%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Strace命令介绍</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>
<h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2008/02/27/9904/' rel='bookmark' title='gentoo的相关配置-make.conf'>gentoo的相关配置-make.conf</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/04/09/10732/' rel='bookmark' title='Gentoo上安装Texlive2009'>Gentoo上安装Texlive2009</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<p>原文是英文wiki里Dealing with masked packages那篇<br />
http://gentoo-wiki.com/TIP_Dealing_with_masked_packages<br />
感觉这篇很重要，在wiki里做为TIP类，自然表示可以带来很多方便，特别是后面那几个脚本<br />
早就想翻译这篇了， 一直没动手，眼看下周就要开学了，要忙开学的事情。<br />
所以今天赶紧把它译了出来 里面有一些专有词汇 如有问题请大家指正 </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<em>相关连的那篇也翻译了: Package.keywords的小技巧<br />
原文 http://gentoo-wiki.com/TIP_package.keywords</p>
<p>同步的中文wiki http://zh.gentoo-wiki.com/Package.ke&#8230;8A%80%E5%B7%A7<br />
</em><br />
wiki里这两篇文章的相关联系已经更新<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
其他更新<br />
HOWTO 用Cedega运行极品飞车9 http://zh.gentoo-wiki.com/HOWTO_%E7%&#8230;3%9E%E8%BD%A69<br />
原文： http://gentoo-wiki.com/HOWTO_RUN_Nee&#8230;ed_with_Cedega</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>
<font size="+1"><strong>处理被屏蔽(masked)的包</strong></font></p>
<p>本文内容：<br />
介绍<br />
被关键字(keyword)屏蔽(masked)的包<br />
被不明的关键字屏蔽<br />
被严格屏蔽(Hard masked)的包<br />
手动进行严格屏蔽<br />
编辑/etc/portage/package.keywords文件的简便方法<br />
开放一大群有联系的包</p>
<p><font size="+1"><strong>介绍</strong></font><br />
首先，被关键字(keyword)屏蔽(masked)的包都是测试中的或者不稳定的包：<br />
注意： &quot;(masked by: ~keyword)&quot;<br />
Masked By ~keyword Package Example</p>
<div style="margin: 5px 20px 20px 0px;">
<div style="margin-bottom: 2px;" class="smallfont">代码:</div>
<pre style="border: 1px solid rgb(198, 198, 198); margin: 0px; padding: 4px; overflow: auto; width: 640px; height: 146px;" class="alt2">
<div style="text-align: left;" dir="ltr"># emerge gnome-extra/gdesklets-core

  '''Calculating dependencies'''     !!! all ebuilds that could satisfy &quot;gnome-extra/gdesklets-core&quot; have been masked.  !!! possible candidates are:  - gnome-extra/gdesklets-core-0.26 (masked by: ~keyword)  - gnome-extra/gdesklets-core-0.26.1 (masked by: ~keyword)  !!! Error calculating dependencies. Please correct.</div>
</pre>
</div>
<p>其次，被严格屏蔽(Hard masked)的包:<br />
注意: &quot;(masked by: package.mask)&quot;<br />
Hard Masked Package Example</p>
<div style="margin: 5px 20px 20px 0px;">
<div style="margin-bottom: 2px;" class="smallfont">代码:</div>
<pre style="border: 1px solid rgb(198, 198, 198); margin: 0px; padding: 4px; overflow: auto; width: 640px; height: 178px;" class="alt2">
<div style="text-align: left;" dir="ltr"># emerge -pv filewatcher

These are the packages that I would merge, in order:

Calculating dependencies   !!! All ebuilds that could satisfy &quot;filewatcher&quot; have been masked.!!! One of the following masked packages is required to complete your request:- app-admin/filewatcher-2.4.0 (masked by: package.mask)# Elfyn McBratney &lt;beu@gentoo.org&gt; (28 Apr 2005)# Masked for testing.</div>
</pre>
</div>
<p><font size="+1"><strong>如果你仍然想安装这些包，那该怎么办呢&#8230;&#8230; </strong></font></p>
<p><font size="+1"><strong>被关键字(keyword)屏蔽(masked)的包</strong></font></p>
<p>现在的新方法是：</p>
<p>echo &quot;gnome-extra/gdesklets-core&quot; &gt;&gt; /etc/portage/package.keywords<br />
或者</p>
<p>echo &quot;=gnome-extra/gdesklets-core-2.10.9&quot; &gt;&gt; /etc/portage/package.keywords</p>
<p>如果你想开放一个特定的版本。</p>
<p>注意：你不需要在package.keywords里面指明电脑架构，除非你想使用其他架构中的软件，当然这是不推荐的。</p>
<p>如果emerge指示某个软件包被 &quot;~* keyword&quot;屏蔽， 你需要逐字的把他写下来，例如:</p>
<p>echo &quot;~gnome-extra/gdesklets-core-2.10.9 ~*&quot; &gt;&gt; /etc/portage/package.keywords</p>
<p>如果你在用crossdev为多种架构建立软件包，例如：</p>
<p>echo &quot;~gnome-extra/gdesklets-core-2.10.9 ~*&quot; &gt;&gt; /etc/portage/package.keywords/cross-i686-pc-linux-gnu</p>
<p><em>OSB: 在cross-i686-pc-linux-gnu中i686-pc-linux-gnu的名字要根据各架构做相应改变。</em></p>
<p>到此，在做了以上任一步骤后，需使用一下命令编译这个包：</p>
<p>emerge =gnome-extra/gdesklets-core-2.10.9</p>
<p>关于package.keywords这个文件的更多信息请点击这里http://zh.gentoo-wiki.com/Package.ke&#8230;8A%80%E5%B7%A7.</p>
<p>如果你在命令行模式下，app-portage/flagedit是自动向packages.keywords里面添加项目的工具。</p>
<p>使用实例：</p>
<div style="margin: 5px 20px 20px 0px;">
<div style="margin-bottom: 2px;" class="smallfont">代码:</div>
<pre style="border: 1px solid rgb(198, 198, 198); margin: 0px; padding: 4px; overflow: auto; width: 640px; height: 34px;" class="alt2">
<div style="text-align: left;" dir="ltr">flagedit gnome-extra/gdesklets-core -- +~x86</div>
</pre>
</div>
<p>Kuroo是一个有用的KDE程序，可以让你浏览portage树并且对任何包进行指定安装。</p>
<p>它使你能安装具有任何依赖性的包，但是，这个程序目前由于不稳定而被屏蔽，比如 ~x86, 所以你不能安逸的在实际安装中使用它（即使它只是portage的前端）。</p>
<p>即使你不想把kuroo用于实际安装，但在开放依赖包时你还是需要它。</p>
<div style="margin: 5px 20px 20px 0px;">
<div style="margin-bottom: 2px;" class="smallfont">代码:</div>
<pre style="border: 1px solid rgb(198, 198, 198); margin: 0px; padding: 4px; overflow: auto; width: 640px; height: 34px;" class="alt2">
<div style="text-align: left;" dir="ltr">emerge -pv kuroo</div>
</pre>
</div>
<p>它编辑标准的portage文件。</p>
<p><font size="+1"><strong>旧方法 (不提倡)</strong></font></p>
<p>ACCEPT_KEYWORDS=&quot;~x86&quot; emerge gnome-extra/gdesklets-core</p>
<p>这种方法已经不被提倡了，它出现在这里仅仅是因为历史原因，不要用这个方法。 <br />
请阅读<a target="_blank" href="http://forums.gentoo.org/viewtopic.php?p=1060314#1060314">http://forums.gentoo.org/viewtopic.p&#8230;060314#1060314</a> 这是关于为什么ACCEPT_KEYWORDS不好的帖子。</p>
<p>简而言之，是因为emerge -u world会对用ACCEPT_KEYWORDS安装的包降级，这会造成潜在的致命改变并且使你的系统陷入瘫痪。<br />
-U（功能：仅仅升级）这个参数也不被提倡了，这有一个充分的原因：如果包坏了，portage应该使它降级，-U确会对此操作造成阻碍。</p>
<p><font size="+1"><strong>被不明的关键字屏蔽</strong></font></p>
<p>在你试图安装一个没有在你的架构上测试过的软件时，这个问题很常见。 <br />
向package.keywords文件中，在你要安装的那个包后面加&quot;~*&quot;以开放这个包。 例如：</p>
<p>echo &quot;net-ftp/vsftpd -* ~*&quot; &gt;&gt; /etc/portage/package.keywords</p>
<p>如果你有被9999屏蔽的CVS包，你可以做如下操作：</p>
<p>echo &quot;media-gfx/retina **&quot; &gt;&gt; /etc/portage/package.keywords</p>
<p>牢记，如果你在一个没有测试个架构里安装软件，这个软件也许没法运行。</p>
<p><font size="+1"><strong>被严格屏蔽(Hard masked)的包</strong></font></p>
<p>开放被严格屏蔽(Hard masked)的包，需要把它们加到/etc/portage/package.unmask文件中。<br />
所用命令和package.keywords稍有不同：</p>
<p>echo &quot;=app-admin/filewatcher-2.4.0&quot; &gt;&gt; /etc/portage/package.unmask</p>
<p>这将开放2.4.0版的app-admin/filewatcher。 如果你想开放这个包的所有版本，仅仅写它的名字就行了：</p>
<p>echo &quot;app-admin/filewatcher&quot; &gt;&gt; /etc/portage/package.unmask</p>
<p>当然也可以像 http://gentoo-wiki.com/TIP_package.keywords 里面那么操作。</p>
<p>注意：由于这些包的不稳定性，被严格屏蔽的包一般也被同样关键字被屏蔽。 你多半须要向package.unmask和package.keywords中都加人这个包。</p>
<p><font size="+1"><strong>手动进行严格屏蔽</strong></font></p>
<p>很少的情况下，你需要避免这些包的安装。 <br />
这也许是个例子，如，某软件ebuild脚本里的一个bug造成那个包在你的系统上编译失败，这会使得像emerge &#8211;update &#8211;deep world这类命令无法顺利执行。</p>
<p>你可以跳过那个包的ebuild，这是通过把它的名字加到/etc/portage/package.mask来实现的：</p>
<p>echo &quot;=sys-apps/file-4.17-r1&quot; &gt;&gt; /etc/portage/package.mask</p>
<p>所用命令和上述package.unmask的一样。</p>
<p><font size="+1"><strong>编辑/etc/portage/package.keywords文件的简便方法</strong></font><br />
<font size="+1"><strong>flagedit</strong></font><br />
# 安装: emerge flagedit<br />
# 使用: flagedit &lt;atom&gt; &#8212; +&lt;keyword&gt;，例如 flagedit dev-util/libconf &#8212; +~x86<br />
<font size="+1"><strong>gimme</strong></font><br />
这个脚本使编译那些被关键字~arch屏蔽的包变得简单</p>
<p>/usr/bin/gimme </p>
<div style="margin: 5px 20px 20px 0px;">
<div style="margin-bottom: 2px;" class="smallfont">代码:</div>
<pre style="border: 1px solid rgb(198, 198, 198); margin: 0px; padding: 4px; overflow: auto; width: 640px; height: 498px;" class="alt2">
<div style="text-align: left;" dir="ltr">#!/bin/bash

############### gimme version 0.5.4 ################# Script to add package names to package.keywords. ## Originally by Tekmanx, re-written by Hackeron    ## re-re-written by Gherald and edited by D. Watzke #####################################################

source /sbin/functions.sh

 [[$EUID != 0]]  &amp;&amp; { eerror &quot;You are not root!&quot; exit 1}

 [[-z &quot;$1&quot;]]  &amp;&amp; { eerror &quot;Please specify a package name (eg. gimme &lt;package-name&gt;)&quot; exit 1}

 [[-d /etc/portage]]  || mkdir -p /etc/portage

# Get fully-qualified ebuild nameFQN=$(ACCEPT_KEYWORDS=&quot;~x86&quot; emerge -p $1 | grep &quot;$1&quot; | grep 'ebuild ' | tail -n2 | \head -n1 | sed -e 's/\[ebuild.......\]\ //' -e 's/\[[[:digit:]].*\]//' -e 's/-[[:digit:]].*$//')

# We think there is either none or more than one package matching $1# so we let the user deal with it [[-z &quot;$FQN&quot;]]  &amp;&amp; emerge $@ -a; exit

if grep -q &quot;^ *[\&gt;\&lt;=]*$FQN *&quot; /etc/portage/package.keywords; then ewarn &quot;/etc/portage/package.keywords already contains \&quot;$EXISTING\&quot;&quot; emerge $@ -a; exitelse einfo &quot;Adding $FQN to package.keywords and emerging in 5 seconds.&quot;; sleep 5 echo $FQN &gt;&gt; /etc/portage/package.keywords emerge $@ -afi</div>
</pre>
</div>
<p>把这个文件命名为&quot;gimme&quot;并保存到/usr/bin/然后执行：</p>
<p>chmod 755 /usr/bin/gimme</p>
<p>现在你就可以使用这个脚本了，例如：</p>
<p>gimme gdesklets-core</p>
<p><font size="+1"><strong>/etc/portage/package.unmask的脚本</strong></font></p>
<p>这个脚本使开放那些被严格屏蔽的包变得简单。<br />
/usr/local/bin/unmask</p>
<div style="margin: 5px 20px 20px 0px;">
<div style="margin-bottom: 2px;" class="smallfont">代码:</div>
<pre style="border: 1px solid rgb(198, 198, 198); margin: 0px; padding: 4px; overflow: auto; width: 640px; height: 498px;" class="alt2">
<div style="text-align: left;" dir="ltr">#!/bin/bash## This script will unmask any package masked by the actual profile.## First we search for what is actually masked # in /usr/portage/profiles/package.mask then add a corresponding # line in /etc/portage/package.unmask### Original by drax@sweon.net

source /sbin/functions.sh

[ &quot;$UID&quot; -ne &quot;0&quot; ] &amp;&amp; eerror &quot;You must be root to run this script.&quot; &amp;&amp; exit[ -z &quot;$1&quot; ] &amp;&amp; eerror &quot;Please state a package name (eg. unmask kde-base/kode)&quot; &amp;&amp; exit[ ! -d /etc/portage ] &amp;&amp; einfo &quot;Creating /etc/portage directory&quot; &amp;&amp; mkdir /etc/portage

if [ &quot;$(grep &quot;$1&quot;-[0-9] /etc/portage/package.unmask 2&gt;/dev/null)&quot; ]; then    ewarn &quot;$1 already exists in package.unmask&quot;else    PKG_LINE=&quot;$(grep &quot;$1&quot;-[0-9] /usr/portage/profiles/package.mask 2&gt;/dev/null)&quot;    if [ ! $PKG_LINE ]; then PKG_LINE=&quot;$(grep &quot;$1&quot; /usr/portage/profiles/package.mask 2&gt;/dev/null)&quot;    fi    if [ ! $PKG_LINE ]; then      ewarn &quot;Could not find $1 in /usr/portage/profiles/package.mask&quot; &amp;&amp; exit 1    else      ebegin &quot;Adding $1 to package.unmask&quot;      echo $PKG_LINE &gt;&gt; /etc/portage/package.unmask      eend $?    fifi</div>
</pre>
</div>
<p>
同样，把这个文件命名为&quot;unmask&quot;并保存到/usr/local/bin然后执行：</p>
<p>chmod 755 /usr/local/bin/unmask</p>
<p>现在你就可以使用这个脚本了，例如：</p>
<p>unmask kde-base/kode # this version of unmask requires the full package name, including app-category/</p>
<p>也可以配合gimme一起使用，例如：</p>
<p>unmask kde-base/kode &amp;&amp; gimme kode</p>
<p>潇洒去吧 <img border="0" class="inlineimg" title="心情好" src="http://www.linuxsir.org/bbs/images/smilies/Jump2.gif" /></p>
<p><font size="+1"><strong>开放一大群有联系的包</strong></font><br />
从Portage 2.1起，很多/etc/portage/package.*的文件能够被目录代替。这些目录里的文件可以自动被Portage连结在一起。</p>
<p>这个对于X模块(xorg)来说特别有用，几乎300个的和这个模块有联系的包都需要被开放。因而，你可以复制 http://www.gentoo.org/proj/en/deskto&#8230;x-packages.txt<br />
到/etc/portage/package.keywords/xorg (也许同样需要复制到 /etc/portage/package.unmask/xorg)。如果不这样的话/etc/portage/package.keywords里会 有一大窜东西，而使得这个文件不好管理。</p>
<p><font size="+1"><strong>脚本：开放所有被依赖的包</strong></font></p>
<p>/bin/gimme-everything</p>
<div style="margin: 5px 20px 20px 0px;">
<div style="margin-bottom: 2px;" class="smallfont">代码:</div>
<pre style="border: 1px solid rgb(198, 198, 198); margin: 0px; padding: 4px; overflow: auto; width: 640px; height: 338px;" class="alt2">
<div style="text-align: left;" dir="ltr">#!/bin/bash## This script will unmask any package masked by specified keyword## It is using flagedit to remove keyword# Usage:  /bin/gimme-everything &quot;=gnome-2.14.2&quot; &quot;+~amd64&quot;# Sorry that this is in one command line, but it was composed in one ;)## author: mmazurek[at]wallix.com

while true; do   if emerge &quot;$1&quot; | grep '!!! All ebuilds'; then      emerge &quot;$1&quot; | grep '!!! All ebuilds' | while read line; do         n=$(echo $line | sed -e &quot;s/.*\&quot;\(.*\)\&quot;.*/\\1/&quot;);         flagedit &quot;$n&quot; -- &quot;$2&quot;;      done;   else      break;   fi;done</div>
</pre>
</div>
<p><font size="+1"><strong>脚本：开放所有被依赖的包 2</strong></font><br />
这个脚本不需要flagedit.<br />
/sbin/unmask</p>
<div style="margin: 5px 20px 20px 0px;">
<div style="margin-bottom: 2px;" class="smallfont">代码:</div>
<pre style="border: 1px solid rgb(198, 198, 198); margin: 0px; padding: 4px; overflow: auto; width: 640px; height: 498px;" class="alt2">
<div style="text-align: left;" dir="ltr">#!/usr/bin/perl -wuse strict;

sub emerge{        my $package = shift;        $_ = `emerge -pv &quot;${package}&quot; 2&gt;&amp;1`;

        if(m/^- (\S+) \(masked by:.*package.mask/mi) {                print &quot;Unmasking ${1} in package.unmask\n&quot;;                print UNMASK &quot;=${1}\n&quot;;                return 1;        }        if(m/^- (\S+) \(masked by:.*keyword/mi) {                print &quot;Unmasking ${1} in package.keywords\n&quot;;                print KEYWORDS &quot;=${1}\n&quot;;                return 1;        }        if(m/^!!! masked or don't exist:\n(\S+)/mi) {                while(emerge($1) != 0){}                return 1;        }        return 0;}

open(UNMASK, &quot;&gt;&gt;/etc/portage/package.unmask&quot;);open(KEYWORDS, &quot;&gt;&gt;/etc/portage/package.keywords&quot;);our $package = $ARGV[0];$package =~ s/&quot;/\\&quot;/g;while(emerge($package) != 0){}print &quot;Done\n&quot;;close(UNMASK);close(KEYWORDS);</div>
</pre>
</div>
<p>使用：</p>
<p>unmask &quot;&gt;media-video/mplayer-1.0_rc1&quot;</p>
<div style=float:left><!-- JiaThis Button BEGIN -->
<div id="jiathis_style_32x32">
	<a class="jiathis_button_qzone"></a>
	<a class="jiathis_button_tsina"></a>
	<a class="jiathis_button_tqq"></a>
	<a class="jiathis_button_renren"></a>
	<a class="jiathis_button_kaixin001"></a>
	<a href="http://www.jiathis.com/share/" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
	<a class="jiathis_counter_style"></a>
</div>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- JiaThis Button END --></div><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F02%2F10570%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Ebuild and emerge</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F04%2F09%2F10732%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo上安装Texlive2009</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2008%2F02%2F27%2F9904%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">gentoo的相关配置-make.conf</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F03%2F07%2F10707%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Gentoo 沙盘简介</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lingcc.com%2F2010%2F01%2F04%2F10582%2F&from=http%3A%2F%2Fwww.lingcc.com%2F2008%2F03%2F28%2F9963%2F">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Strace命令介绍</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><p><h3>相关文章：</h3><ul>
<li><a href='http://www.lingcc.com/2010/01/02/10570/' rel='bookmark' title='Ebuild and emerge'>Ebuild and emerge</a></li>
<li><a href='http://www.lingcc.com/2009/12/31/10534/' rel='bookmark' title='Gentoo中的交叉编译利器&#8211;crossdev'>Gentoo中的交叉编译利器&#8211;crossdev</a></li>
<li><a href='http://www.lingcc.com/2008/02/27/9904/' rel='bookmark' title='gentoo的相关配置-make.conf'>gentoo的相关配置-make.conf</a></li>
<li><a href='http://www.lingcc.com/2010/01/05/10588/' rel='bookmark' title='用crossdev装龙芯的n32 gnu交叉工具链'>用crossdev装龙芯的n32 gnu交叉工具链</a></li>
<li><a href='http://www.lingcc.com/2010/04/09/10732/' rel='bookmark' title='Gentoo上安装Texlive2009'>Gentoo上安装Texlive2009</a></li>
<li><a href='http://www.lingcc.com/2010/01/07/10594/' rel='bookmark' title='使用crossdev安装龙芯的O32 gnu交叉工具链'>使用crossdev安装龙芯的O32 gnu交叉工具链</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.lingcc.com/2008/03/28/9963/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

