diff options
Diffstat (limited to 'zh_TW.Big5/books/handbook/cutting-edge/chapter.xml')
-rw-r--r-- | zh_TW.Big5/books/handbook/cutting-edge/chapter.xml | 199 |
1 files changed, 82 insertions, 117 deletions
diff --git a/zh_TW.Big5/books/handbook/cutting-edge/chapter.xml b/zh_TW.Big5/books/handbook/cutting-edge/chapter.xml index 08ea2f4dd1..50f6f0e072 100644 --- a/zh_TW.Big5/books/handbook/cutting-edge/chapter.xml +++ b/zh_TW.Big5/books/handbook/cutting-edge/chapter.xml @@ -5,42 +5,24 @@ $FreeBSD$ Original revision: 1.225 --> - -<chapter id="cutting-edge"> - <chapterinfo> +<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="cutting-edge"> + <info><title>更新、升級 FreeBSD</title> <authorgroup> - <author> - <firstname>Jim</firstname> - <surname>Mock</surname> - <contrib>Restructured, reorganized, and parts updated by </contrib> - </author> + <author><personname><firstname>Jim</firstname><surname>Mock</surname></personname><contrib>Restructured, reorganized, and parts updated by </contrib></author> <!-- Mar 2000 --> </authorgroup> <authorgroup> - <author> - <firstname>Jordan</firstname> - <surname>Hubbard</surname> - <contrib>Original work by </contrib> - </author> - <author> - <firstname>Poul-Henning</firstname> - <surname>Kamp</surname> - </author> - <author> - <firstname>John</firstname> - <surname>Polstra</surname> - </author> - <author> - <firstname>Nik</firstname> - <surname>Clayton</surname> - </author> + <author><personname><firstname>Jordan</firstname><surname>Hubbard</surname></personname><contrib>Original work by </contrib></author> + <author><personname><firstname>Poul-Henning</firstname><surname>Kamp</surname></personname></author> + <author><personname><firstname>John</firstname><surname>Polstra</surname></personname></author> + <author><personname><firstname>Nik</firstname><surname>Clayton</surname></personname></author> </authorgroup> - <!-- with feedback from various others --> - </chapterinfo> + + </info> - <title>更新、升級 FreeBSD</title> + - <sect1 id="cutting-edge-synopsis"> + <sect1 xml:id="cutting-edge-synopsis"> <title>概述</title> <para>&os; 是個持續發展的作業系統。對於喜歡追求新鮮、刺激的使用者而言, @@ -72,12 +54,11 @@ <listitem><para>先設好你的網路(<xref linkend="advanced-networking"/>)。 </para> </listitem> - <listitem><para>知道如何透過 port/package 安裝軟體(<xref - linkend="ports"/>)。</para></listitem> + <listitem><para>知道如何透過 port/package 安裝軟體(<xref linkend="ports"/>)。</para></listitem> </itemizedlist> </sect1> - <sect1 id="current-stable"> + <sect1 xml:id="current-stable"> <title>&os.current; vs. &os.stable;</title> <indexterm><primary>-CURRENT</primary></indexterm> <indexterm><primary>-STABLE</primary></indexterm> @@ -86,7 +67,7 @@ &os.stable;。本節將會陸續介紹,並介紹它們分別又是如何更新。 首先,先介紹 &os.current;,接著再介紹 &os.stable;。</para> - <sect2 id="current"> + <sect2 xml:id="current"> <title>使用最新的 &os; CURRENT</title> <para>這裡再次強調,&os.current; 是 &os; 開發的 <quote>最前線</quote>。 @@ -210,14 +191,13 @@ </listitem> <listitem> - <para>使用 <application><link - linkend="ctm">CTM</link></application><indexterm><primary>-CURRENT</primary><secondary>Syncing with CTM</secondary></indexterm> 工具。 若網路環境不佳 + <para>使用 <application>CTM</application><indexterm><primary>-CURRENT</primary><secondary>Syncing with CTM</secondary></indexterm> 工具。 若網路環境不佳 (上網費用貴,或只能用 email 而已) <application>CTM</application> 會比較適合您的需求。 然而,這也有一些爭議並且常抓到一些有問題的檔案。 因此, 很少人會用它。 這也註定了不能長期依賴這個更新方式。 若是使用 9600 bps modem 或頻寬更大的上網者,建議使用 - <application><link linkend="cvsup">CVSup</link></application> + <application>CVSup</application> 。</para> </listitem> </orderedlist> @@ -248,7 +228,7 @@ </sect3> </sect2> - <sect2 id="stable"> + <sect2 xml:id="stable"> <title>使用最新的 &os; STABLE</title> <sect3> @@ -275,8 +255,7 @@ 都會解說如何去修復有受到影響的版本 <footnote><para>然而,這也不一定是正確,我們不可能永遠支援 FreeBSD 昔日的各種發行版本,儘管每個發行版發佈之後,都仍會持續支援數年之久。 - 若欲瞭解 FreeBSD 目前對於舊版的支援政策細節,請參閱 <ulink - url="&url.base;/security/">http://www.FreeBSD.org/security/</ulink> + 若欲瞭解 FreeBSD 目前對於舊版的支援政策細節,請參閱 <link xlink:href="&url.base;/security/">http://www.FreeBSD.org/security/</link> 。</para> </footnote> ,若僅因為安全因素而去採用開發分支,雖然會解決現有已知問題, @@ -317,8 +296,7 @@ <listitem> <para>若打算要安裝一個全新的系統,並且希望裝 &os.stable; - 每月定期的 snapshot,那麼請參閱 <ulink - url="&url.base;/snapshots/">Snapshots</ulink> 網頁以瞭解相關細節。 + 每月定期的 snapshot,那麼請參閱 <link xlink:href="&url.base;/snapshots/">Snapshots</link> 網頁以瞭解相關細節。 此外,也可從 <link linkend="mirrors">mirror 站</link> 來安裝最新的 &os.stable; 發行版,並透過下列的的說明來更新到最新的 &os.stable; 原始碼。</para> @@ -345,8 +323,7 @@ </listitem> <listitem> - <para>使用 <application><link - linkend="ctm">CTM</link></application><indexterm><primary>-STABLE</primary><secondary>syncing with CTM</secondary></indexterm> 更新工具。 + <para>使用 <application>CTM</application><indexterm><primary>-STABLE</primary><secondary>syncing with CTM</secondary></indexterm> 更新工具。 若網路不快或網路費用貴,那麼可以考慮採用。</para> </listitem> </orderedlist> @@ -362,8 +339,7 @@ <listitem> <para>在編譯 &os.stable;<indexterm><primary>-STABLE</primary><secondary>compiling</secondary></indexterm> 之前,請先仔細閱讀 <filename>/usr/src</filename> 內的 <filename>Makefile</filename> - 檔。 儘管只是升級部分東西而已,您至少也要先 <link - linkend="makeworld">裝新的 kernel 以及重新編譯 world</link>。 + 檔。 儘管只是升級部分東西而已,您至少也要先 <link linkend="makeworld">裝新的 kernel 以及重新編譯 world</link>。 此外,多多閱讀 &a.stable; 以及 <filename>/usr/src/UPDATING</filename> 也是必備的, 這樣才能知道目前進度是怎樣,以及下一版會有哪些新東西。</para> @@ -373,12 +349,11 @@ </sect2> </sect1> - <sect1 id="synching"> + <sect1 xml:id="synching"> <title>更新你的 Source</title> <para>&os; 計劃原始碼有許多透過網路(或 email)的方式來更新, - 無論是更新那一塊領域,這些全由您自行決定。 我們主要提供的是 <link - linkend="anoncvs">Anonymous CVS</link>、<link linkend="cvsup">CVSup</link> + 無論是更新那一塊領域,這些全由您自行決定。 我們主要提供的是 <link linkend="anoncvs">Anonymous CVS</link>、<link linkend="cvsup">CVSup</link> 、<link linkend="ctm">CTM</link>。</para> <warning> @@ -436,7 +411,7 @@ 只要把不正確的地方砍掉,再重新做同步的動作即可。</para> </sect1> - <sect1 id="makeworld"> + <sect1 xml:id="makeworld"> <title>重新編譯 <quote>world</quote></title> <indexterm> @@ -501,14 +476,14 @@ &prompt.root; <userinput>reboot</userinput></screen> <note> - <para>在少數狀況,可能需要先在 <maketarget>buildworld</maketarget> + <para>在少數狀況,可能需要先在 <buildtarget>buildworld</buildtarget> 步驟之前先作 <command>mergemaster -p</command> 才能完成。 至於何時需要或不需要,請參閱 <filename>UPDATING</filename> 內的說明。 一般來說,只要不是進行跨版號(major)的 &os; 版本升級, 就可略過這步驟。</para> </note> - <para>完成 <maketarget>installkernel</maketarget> 之後,需要重開機並切到 + <para>完成 <buildtarget>installkernel</buildtarget> 之後,需要重開機並切到 single user 模式(舉例:也可以在 loader 提示符號後面加上 <command>boot -s</command>)。 接下來執行:</para> @@ -559,12 +534,12 @@ <para>一般使用者通常會從 <filename>/usr/share/examples/etc/make.conf</filename> 複製 - <makevar>CFLAGS</makevar> 以及 <makevar>NO_PROFILE</makevar> + <varname>CFLAGS</varname> 以及 <varname>NO_PROFILE</varname> 之類的設定到 <filename>/etc/make.conf</filename>,並解除相關註解印記 。</para> - <para>此外,也可以試試看其他設定 (<makevar>COPTFLAGS</makevar>、 - <makevar>NOPORTDOCS</makevar> 等等),是否符合自己所需。</para> + <para>此外,也可以試試看其他設定 (<varname>COPTFLAGS</varname>、 + <varname>NOPORTDOCS</varname> 等等),是否符合自己所需。</para> </sect2> <sect2> @@ -582,15 +557,15 @@ 因此升級時就會造成問題。 有時候 <command>make buildworld</command> 會先檢查這些所需的帳號或群組是否已有存在。</para> - <para>舉個這樣的例子,像是某次升級之後必須新增 <username>smmsp</username> + <para>舉個這樣的例子,像是某次升級之後必須新增 <systemitem class="username">smmsp</systemitem> 帳號。 若使用者尚未新增該帳號就要完成升級操作的話, 會在 &man.mtree.8; 嘗試建立 <filename>/var/spool/clientmqueue</filename> 時發生失敗。</para> <para>解法是在 buildworld 階段之前,先執行 &man.mergemaster.8; 並搭配 <option>-p</option> 選項。 它會比對那些執行 - <maketarget>buildworld</maketarget> 或 - <maketarget>installworld</maketarget> 所需之關鍵設定檔。 + <buildtarget>buildworld</buildtarget> 或 + <buildtarget>installworld</buildtarget> 所需之關鍵設定檔。 若你所用的是早期仍未支援 <option>-p</option> 的 <command>mergemaster</command> 版本,那麼直接使用 source tree 內的新版即可:</para> @@ -603,14 +578,14 @@ 可以像下面這樣去試著檢查系統上有哪些檔案屬於已改名或被刪除的群組 :</para> - <screen>&prompt.root; <userinput>find / -group <replaceable>GID</replaceable> -print</userinput></screen> + <screen>&prompt.root; <userinput>find / -group GID -print</userinput></screen> <para>這會顯示所有符合要找的 <replaceable>GID</replaceable> 群組 (可以是群組名稱,或者是群組的數字代號)的所有檔案。</para> </tip> </sect2> - <sect2 id="makeworld-singleuser"> + <sect2 xml:id="makeworld-singleuser"> <title>切換到 Single User 模式</title> <indexterm><primary>single-user mode</primary></indexterm> @@ -624,8 +599,8 @@ <para>另一種模式是先在 multi-user 模式下編譯好系統,然後再切到 single user 模式去安裝。 若您比較喜歡這種方式,只需在 build(編譯過程) 完成之後, 再去執行下面的步驟即可。 一直到可切換 single user 模式時,再去執行 - <maketarget>installkernel</maketarget> 或 - <maketarget>installworld</maketarget> 即可。</para> + <buildtarget>installkernel</buildtarget> 或 + <buildtarget>installworld</buildtarget> 即可。</para> <para>切換為 root 身份打:</para> @@ -678,7 +653,7 @@ &prompt.root; <userinput>rm -rf *</userinput></screen> </sect2> - <sect2 id="cutting-edge-compilebase"> + <sect2 xml:id="cutting-edge-compilebase"> <title>重新編譯 Base System</title> <sect3> @@ -705,10 +680,10 @@ Script done, …</screen> <filename>/tmp</filename> 目錄內。 因為重開機之後, 這目錄內的東西都會被清空。 比較妥善的地方是 <filename>/var/tmp</filename> (如上例所示) 或者是 - <username>root</username> 的家目錄。</para> + <systemitem class="username">root</systemitem> 的家目錄。</para> </sect3> - <sect3 id="make-buildworld"> + <sect3 xml:id="make-buildworld"> <title>編譯 Base System</title> <para>首先請先切換到 <filename>/usr/src</filename> 目錄:</para> @@ -725,7 +700,7 @@ Script done, …</screen> <para>一般下指令的格式如下:</para> - <screen>&prompt.root; <userinput>make -<replaceable>x</replaceable> -D<replaceable>VARIABLE</replaceable> <replaceable>target</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>make -x -DVARIABLE target</userinput></screen> <para>在這個例子,<option>-<replaceable>x</replaceable></option> 是你想傳給 &man.make.1; 的選項,細節說明請參閱 &man.make.1; 說明, @@ -737,7 +712,7 @@ Script done, …</screen> <filename>/etc/make.conf</filename> 的變數設定是一樣, 只是另一種設定方式而已。</para> - <screen>&prompt.root; <userinput>make -DNO_PROFILE <replaceable>target</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>make -DNO_PROFILE target</userinput></screen> <para>上面的例子則是另一種設定方式,也就是哪些不要。 這個例子中的意思是不去編譯 profiled libraries,效果就如同設定在 @@ -760,37 +735,37 @@ Script done, …</screen> &man.make.1;, and so your command like will look like this:</para> - <screen>&prompt.root; <userinput>make <replaceable>target</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>make target</userinput></screen> <para>Where <replaceable>target</replaceable> will be one of many build options. The first target should always be - <makevar>buildworld</makevar>.</para> + <varname>buildworld</varname>.</para> - <para>As the names imply, <maketarget>buildworld</maketarget> + <para>As the names imply, <buildtarget>buildworld</buildtarget> builds a complete new tree under <filename>/usr/obj</filename>, - and <maketarget>installworld</maketarget>, another target, installs this tree on + and <buildtarget>installworld</buildtarget>, another target, installs this tree on the current machine.</para> <para>Having separate options is very useful for two reasons. First, it allows you to do the build safe in the knowledge that no components of your running system will be affected. The build is <quote>self hosted</quote>. Because of this, you can safely - run <maketarget>buildworld</maketarget> on a machine running + run <buildtarget>buildworld</buildtarget> on a machine running in multi-user mode with no fear of ill-effects. It is still recommended that you run the - <maketarget>installworld</maketarget> part in single user + <buildtarget>installworld</buildtarget> part in single user mode, though.</para> <para>Secondly, it allows you to use NFS mounts to upgrade multiple machines on your network. If you have three machines, - <hostid>A</hostid>, <hostid>B</hostid> and <hostid>C</hostid> that you want to upgrade, run <command>make + <systemitem>A</systemitem>, <systemitem>B</systemitem> and <systemitem>C</systemitem> that you want to upgrade, run <command>make buildworld</command> and <command>make installworld</command> on - <hostid>A</hostid>. <hostid>B</hostid> and <hostid>C</hostid> should then NFS mount <filename>/usr/src</filename> - and <filename>/usr/obj</filename> from <hostid>A</hostid>, and you can then run + <systemitem>A</systemitem>. <systemitem>B</systemitem> and <systemitem>C</systemitem> should then NFS mount <filename>/usr/src</filename> + and <filename>/usr/obj</filename> from <systemitem>A</systemitem>, and you can then run <command>make installworld</command> to install the results of - the build on <hostid>B</hostid> and <hostid>C</hostid>.</para> + the build on <systemitem>B</systemitem> and <systemitem>C</systemitem>.</para> - <para>Although the <maketarget>world</maketarget> target still exists, + <para>Although the <buildtarget>world</buildtarget> target still exists, you are strongly encouraged not to use it.</para> <para>Run</para> @@ -853,24 +828,23 @@ Script done, …</screen> can then build a new kernel based on your normal kernel configuration file.</para> - <para>On &os; it is important to <link - linkend="make-buildworld">build world</link> before building a + <para>On &os; it is important to <link linkend="make-buildworld">build world</link> before building a new kernel.</para> <note><para>If you want to build a custom kernel, and already have a configuration - file, just use <literal>KERNCONF=<replaceable>MYKERNEL</replaceable></literal> + file, just use <literal>KERNCONF=MYKERNEL</literal> like this:</para> <screen>&prompt.root; <userinput>cd /usr/src</userinput> -&prompt.root; <userinput>make buildkernel KERNCONF=<replaceable>MYKERNEL</replaceable></userinput> -&prompt.root; <userinput>make installkernel KERNCONF=<replaceable>MYKERNEL</replaceable></userinput></screen> +&prompt.root; <userinput>make buildkernel KERNCONF=MYKERNEL</userinput> +&prompt.root; <userinput>make installkernel KERNCONF=MYKERNEL</userinput></screen> </note> <para>Note that if you have raised <literal>kern.securelevel</literal> above 1 <emphasis>and</emphasis> you have set either the <literal>noschg</literal> or similar flags to your kernel binary, you might find it necessary to drop into single user mode to use - <maketarget>installkernel</maketarget>. Otherwise you should be able + <buildtarget>installkernel</buildtarget>. Otherwise you should be able to run both these commands from multi user mode without problems. See &man.init.8; for details about <literal>kern.securelevel</literal> and &man.chflags.1; for details @@ -886,12 +860,12 @@ Script done, …</screen> <xref linkend="makeworld-singleuser"/>.</para> </sect2> - <sect2 id="make-installworld"> + <sect2 xml:id="make-installworld"> <title>Install the New System Binaries</title> <para>If you were building a version of &os; recent enough to have used <command>make buildworld</command> then you should now use - <maketarget>installworld</maketarget> to install the new system + <buildtarget>installworld</buildtarget> to install the new system binaries.</para> <para>Run</para> @@ -905,7 +879,7 @@ Script done, …</screen> variables in the <command>make installworld</command> command line. This does not necessarily hold true for other options; for example, <option>-j</option> must never be used with - <maketarget>installworld</maketarget>.</para> + <buildtarget>installworld</buildtarget>.</para> <para>For example, if you ran:</para> @@ -934,17 +908,13 @@ Script done, …</screen> choose, be sure to make a backup of <filename>/etc</filename> in case anything goes wrong.</para> - <sect3 id="mergemaster"> - <sect3info> + <sect3 xml:id="mergemaster"> + <info><title><command>mergemaster</command></title> <authorgroup> - <author> - <firstname>Tom</firstname> - <surname>Rhodes</surname> - <contrib>Contributed by </contrib> - </author> + <author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Contributed by </contrib></author> </authorgroup> - </sect3info> - <title><command>mergemaster</command></title> + </info> + <indexterm><primary><command>mergemaster</command></primary></indexterm> <para>The &man.mergemaster.8; utility is a Bourne script that will @@ -1164,7 +1134,7 @@ Script done, …</screen> </sect3> </sect2> - <sect2 id="cutting-edge-rebooting"> + <sect2 xml:id="cutting-edge-rebooting"> <title>Rebooting</title> <para>You are now done. After you have verified that everything appears @@ -1360,7 +1330,7 @@ Building everything.. <listitem> <para>Also in <filename>/etc/make.conf</filename>, set - <makevar>CFLAGS</makevar> to something like <option>-O + <varname>CFLAGS</varname> to something like <option>-O -pipe</option>. The optimization <option>-O2</option> is much slower, and the optimization difference between <option>-O</option> and <option>-O2</option> is normally @@ -1459,17 +1429,13 @@ Building everything.. </sect2> </sect1> - <sect1 id="small-lan"> - <sect1info> + <sect1 xml:id="small-lan"> + <info><title>Tracking for Multiple Machines</title> <authorgroup> - <author> - <firstname>Mike</firstname> - <surname>Meyer</surname> - <contrib>Contributed by </contrib> - </author> + <author><personname><firstname>Mike</firstname><surname>Meyer</surname></personname><contrib>Contributed by </contrib></author> </authorgroup> - </sect1info> - <title>Tracking for Multiple Machines</title> + </info> + <indexterm> <primary>NFS</primary> <secondary>installing multiple machines</secondary> @@ -1483,7 +1449,7 @@ Building everything.. machines mount that work via NFS. This section outlines a method of doing so.</para> - <sect2 id="small-lan-preliminaries"> + <sect2 xml:id="small-lan-preliminaries"> <title>Preliminaries</title> <para>First, identify a set of machines that is going to run @@ -1517,12 +1483,12 @@ Building everything.. the build machine must build all the parts of the base system that any machine in the build set is going to install. Also, each build machine should have its kernel - name set with <makevar>KERNCONF</makevar> in + name set with <varname>KERNCONF</varname> in <filename>/etc/make.conf</filename>, and the build machine - should list them all in <makevar>KERNCONF</makevar>, listing + should list them all in <varname>KERNCONF</varname>, listing its own kernel first. The build machine must have the kernel configuration files for each machine in - <filename>/usr/src/sys/<replaceable>arch</replaceable>/conf</filename> + <filename>/usr/src/sys/arch/conf</filename> if it is going to build their kernels.</para> </sect2> @@ -1530,8 +1496,7 @@ Building everything.. <title>The Base System</title> <para>Now that all that is done, you are ready to build - everything. Build the kernel and world as described in <xref - linkend="make-buildworld"/> on the build machine, + everything. Build the kernel and world as described in <xref linkend="make-buildworld"/> on the build machine, but do not install anything. After the build has finished, go to the test machine, and install the kernel you just built. If this machine mounts <filename>/usr/src</filename> @@ -1557,14 +1522,14 @@ Building everything.. critical step is mounting <filename>/usr/ports</filename> from the same machine to all the machines in the build set. You can then set up <filename>/etc/make.conf</filename> properly to share - distfiles. You should set <makevar>DISTDIR</makevar> to a + distfiles. You should set <varname>DISTDIR</varname> to a common shared directory that is writable by whichever user - <username>root</username> is mapped to by your NFS mounts. Each - machine should set <makevar>WRKDIRPREFIX</makevar> to a + <systemitem class="username">root</systemitem> is mapped to by your NFS mounts. Each + machine should set <varname>WRKDIRPREFIX</varname> to a local build directory. Finally, if you are going to be building and distributing packages, you should set - <makevar>PACKAGES</makevar> to a directory similar to - <makevar>DISTDIR</makevar>.</para> + <varname>PACKAGES</varname> to a directory similar to + <varname>DISTDIR</varname>.</para> </sect2> </sect1> </chapter> |