⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makeworld.html

📁 FreeBSD操作系统的详细使用手册
💻 HTML
📖 第 1 页 / 共 4 页
字号:
For example, if you accidentally deleted <tt class="FILENAME">/etc/magic</tt> as part ofthe upgrade or merge of <tt class="FILENAME">/etc</tt>, the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=file&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">file</span>(1)</span></a> command willstop working. In this case, the fix would be to run:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /usr/src/usr.bin/file</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">make all install</kbd></pre></div><div class="SECT2"><h2 class="SECT2"><a id="AEN28165" name="AEN28165">19.4.16 Questions</a></h2><div class="QANDASET"><dl><dt>19.4.16.1. <a href="makeworld.html#Q19.4.16.1.">Do I need to re-make the world forevery change?</a></dt><dt>19.4.16.2. <a href="makeworld.html#Q19.4.16.2.">My compile failed with lots of signal11 (or other signal number) errors. What has happened?</a></dt><dt>19.4.16.3. <a href="makeworld.html#Q19.4.16.3.">Can I remove <ttclass="FILENAME">/usr/obj</tt> when I have finished?</a></dt><dt>19.4.16.4. <a href="makeworld.html#Q19.4.16.4.">Can interrupted builds beresumed?</a></dt><dt>19.4.16.5. <a href="makeworld.html#Q19.4.16.5.">How can I speed up making theworld?</a></dt><dt>19.4.16.6. <a href="makeworld.html#Q19.4.16.6.">What do I do if something goeswrong?</a></dt></dl><div class="QANDAENTRY"><div class="QUESTION"><p><a id="Q19.4.16.1." name="Q19.4.16.1."></a><b>19.4.16.1.</b> Do I need to re-make theworld for every change?</p></div><div class="ANSWER"><p><b></b>There is no easy answer to this one, as it depends on the nature of the change.For example, if you just ran <b class="APPLICATION">CVSup</b>, and it has shown thefollowing files as being updated:</p><pre class="SCREEN"><tt class="FILENAME">src/games/cribbage/instr.c</tt><tt class="FILENAME">src/games/sail/pl_main.c</tt><tt class="FILENAME">src/release/sysinstall/config.c</tt><tt class="FILENAME">src/release/sysinstall/media.c</tt><tt class="FILENAME">src/share/mk/bsd.port.mk</tt></pre><p>it probably is not worth rebuilding the entire world. You could just go to theappropriate sub-directories and <tt class="COMMAND">make all install</tt>, and that'sabout it. But if something major changed, for example <ttclass="FILENAME">src/lib/libc/stdlib</tt> then you should either re-make the world, or atleast those parts of it that are statically linked (as well as anything else you mighthave added that is statically linked).</p><p>At the end of the day, it is your call. You might be happy re-making the world everyfortnight say, and let changes accumulate over that fortnight. Or you might want tore-make just those things that have changed, and be confident you can spot all thedependencies.</p><p>And, of course, this all depends on how often you want to upgrade, and whether you aretracking FreeBSD-STABLE or FreeBSD-CURRENT.</p></div></div><div class="QANDAENTRY"><div class="QUESTION"><p><a id="Q19.4.16.2." name="Q19.4.16.2."></a><b>19.4.16.2.</b> My compile failed withlots of signal 11 (or other signal number) errors. What has happened?</p></div><div class="ANSWER"><p><b></b>This is normally indicative of hardware problems. (Re)making the world is aneffective way to stress test your hardware, and will frequently throw up memory problems.These normally manifest themselves as the compiler mysteriously dying on receipt ofstrange signals.</p><p>A sure indicator of this is if you can restart the make and it dies at a differentpoint in the process.</p><p>In this instance there is little you can do except start swapping around thecomponents in your machine to determine which one is failing.</p></div></div><div class="QANDAENTRY"><div class="QUESTION"><p><a id="Q19.4.16.3." name="Q19.4.16.3."></a><b>19.4.16.3.</b> Can I remove <ttclass="FILENAME">/usr/obj</tt> when I have finished?</p></div><div class="ANSWER"><p><b></b>The short answer is yes.</p><p><tt class="FILENAME">/usr/obj</tt> contains all the object files that were producedduring the compilation phase. Normally, one of the first steps in the ``make buildworld''process is to remove this directory and start afresh. In this case, keeping <ttclass="FILENAME">/usr/obj</tt> around after you have finished makes little sense, andwill free up a large chunk of disk space (currently about 340&nbsp;MB).</p><p>However, if you know what you are doing you can have ``make buildworld'' skip thisstep. This will make subsequent builds run much faster, since most of sources will notneed to be recompiled. The flip side of this is that subtle dependency problems can creepin, causing your build to fail in odd ways. This frequently generates noise on theFreeBSD mailing lists, when one person complains that their build has failed, notrealizing that it is because they have tried to cut corners.</p></div></div><div class="QANDAENTRY"><div class="QUESTION"><p><a id="Q19.4.16.4." name="Q19.4.16.4."></a><b>19.4.16.4.</b> Can interrupted builds beresumed?</p></div><div class="ANSWER"><p><b></b>This depends on how far through the process you got before you found aproblem.</p><p><span class="emphasis"><i class="EMPHASIS">In general</i></span> (and this is not ahard and fast rule) the ``make buildworld'' process builds new copies of essential tools(such as <a href="http://www.FreeBSD.org/cgi/man.cgi?query=gcc&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">gcc</span>(1)</span></a>, and <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=make&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">make</span>(1)</span></a>) and thesystem libraries. These tools and libraries are then installed. The new tools andlibraries are then used to rebuild themselves, and are installed again. The entire system(now including regular user programs, such as <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=ls&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ls</span>(1)</span></a> or <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=grep&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">grep</span>(1)</span></a>) is thenrebuilt with the new system files.</p><p>If you are at the last stage, and you know it (because you have looked through theoutput that you were storing) then you can (fairly safely) do:</p><pre class="SCREEN"><span class="emphasis"><i class="EMPHASIS">... fix the problem ...</i></span><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /usr/src</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">make -DNOCLEAN all</kbd></pre><p>This will not undo the work of the previous ``make buildworld''.</p><p>If you see the message:</p><pre class="SCREEN">--------------------------------------------------------------Building everything..--------------------------------------------------------------</pre><p>in the ``make buildworld'' output then it is probably fairly safe to do so.</p><p>If you do not see that message, or you are not sure, then it is always better to besafe than sorry, and restart the build from scratch.</p></div></div><div class="QANDAENTRY"><div class="QUESTION"><p><a id="Q19.4.16.5." name="Q19.4.16.5."></a><b>19.4.16.5.</b> How can I speed up makingthe world?</p></div><div class="ANSWER"><p><b></b></p><ul class="noindent"><li><p>Run in single user mode.</p></li><li><p>Put the <tt class="FILENAME">/usr/src</tt> and <tt class="FILENAME">/usr/obj</tt>directories on separate file systems held on separate disks. If possible, put these diskson separate disk controllers.</p></li><li><p>Better still, put these file systems across multiple disks using the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=ccd&sektion=4"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">ccd</span>(4)</span></a> (concatenateddisk driver) device.</p></li><li><p>Turn off profiling (set ``NOPROFILE=true'' in <ttclass="FILENAME">/etc/make.conf</tt>). You almost certainly do not need it.</p></li><li><p>Also in <tt class="FILENAME">/etc/make.conf</tt>, set <tt class="MAKEVAR">CFLAGS</tt>to something like <var class="OPTION">-O -pipe</var>. The optimization <varclass="OPTION">-O2</var> is much slower, and the optimization difference between <varclass="OPTION">-O</var> and <var class="OPTION">-O2</var> is normally negligible. <varclass="OPTION">-pipe</var> lets the compiler use pipes rather than temporary files forcommunication, which saves disk access (at the expense of memory).</p></li><li><p>Pass the <var class="OPTION">-j<var class="REPLACEABLE">n</var></var> option to <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=make&sektion=1"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">make</span>(1)</span></a> to runmultiple processes in parallel. This usually helps regardless of whether you have asingle or a multi processor machine.</p></li><li><p>The file system holding <tt class="FILENAME">/usr/src</tt> can be mounted (orremounted) with the <var class="OPTION">noatime</var> option. This prevents the filesystem from recording the file access time. You probably do not need this informationanyway.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mount -u -o noatime /usr/src</kbd></pre><div class="WARNING"><blockquote class="WARNING"><p><b>Warning:</b> The example assumes <tt class="FILENAME">/usr/src</tt> is on its ownfile system. If it is not (if it is a part of <tt class="FILENAME">/usr</tt> for example)then you will need to use that file system mount point, and not <ttclass="FILENAME">/usr/src</tt>.</p></blockquote></div></li><li><p>The file system holding <tt class="FILENAME">/usr/obj</tt> can be mounted (orremounted) with the <var class="OPTION">async</var> option. This causes disk writes tohappen asynchronously. In other words, the write completes immediately, and the data iswritten to the disk a few seconds later. This allows writes to be clustered together, andcan be a dramatic performance boost.</p><div class="WARNING"><blockquote class="WARNING"><p><b>Warning:</b> Keep in mind that this option makes your file system more fragile.With this option there is an increased chance that, should power fail, the file systemwill be in an unrecoverable state when the machine restarts.</p><p>If <tt class="FILENAME">/usr/obj</tt> is the only thing on this file system then it isnot a problem. If you have other, valuable data on the same file system then ensure yourbackups are fresh before you enable this option.</p></blockquote></div><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">mount -u -o async /usr/obj</kbd></pre><div class="WARNING"><blockquote class="WARNING"><p><b>Warning:</b> As above, if <tt class="FILENAME">/usr/obj</tt> is not on its own filesystem, replace it in the example with the name of the appropriate mount point.</p></blockquote></div></li></ul></div></div><div class="QANDAENTRY"><div class="QUESTION"><p><a id="Q19.4.16.6." name="Q19.4.16.6."></a><b>19.4.16.6.</b> What do I do if somethinggoes wrong?</p></div><div class="ANSWER"><p><b></b>Make absolutely sure your environment has no extraneous cruft from earlierbuilds. This is simple enough.</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">chflags -R noschg /usr/obj/usr</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">rm -rf /usr/obj/usr</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /usr/src</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">make cleandir</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">make cleandir</kbd></pre><p>Yes, <tt class="COMMAND">make cleandir</tt> really should be run twice.</p><p>Then restart the whole process, starting with <tt class="COMMAND">makebuildworld</tt>.</p><p>If you still have problems, send the error and the output of <tt class="COMMAND">uname-a</tt> to <a href="http://lists.FreeBSD.org/mailman/listinfo/freebsd-questions"target="_top">FreeBSD general questions mailing list</a>. Be prepared to answer otherquestions about your setup!</p></div></div></div></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="synching.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="small-lan.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Synchronizing Your Source</td><td width="34%" align="center" valign="top"><a href="cutting-edge.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Tracking for Multiple Machines</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -