diff options
Diffstat (limited to 'zh_TW.Big5/books/handbook/kernelconfig/chapter.xml')
-rw-r--r-- | zh_TW.Big5/books/handbook/kernelconfig/chapter.xml | 151 |
1 files changed, 62 insertions, 89 deletions
diff --git a/zh_TW.Big5/books/handbook/kernelconfig/chapter.xml b/zh_TW.Big5/books/handbook/kernelconfig/chapter.xml index d53d51a270..eedc59c065 100644 --- a/zh_TW.Big5/books/handbook/kernelconfig/chapter.xml +++ b/zh_TW.Big5/books/handbook/kernelconfig/chapter.xml @@ -5,30 +5,19 @@ $FreeBSD$ Original revision: 1.180 --> - -<chapter id="kernelconfig"> - <chapterinfo> +<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="kernelconfig"> + <info><title>設定 FreeBSD Kernel</title> <authorgroup> - <author> - <firstname>Jim</firstname> - <surname>Mock</surname> - <contrib>更新、重排:</contrib> - <!-- Mar 2000 --> - </author> + <author><personname><firstname>Jim</firstname><surname>Mock</surname></personname><contrib>更新、重排:</contrib></author> </authorgroup> <authorgroup> - <author> - <firstname>Jake</firstname> - <surname>Hamby</surname> - <contrib> 原作為:</contrib> - <!-- 6 Oct 1995 --> - </author> + <author><personname><firstname>Jake</firstname><surname>Hamby</surname></personname><contrib> 原作為:</contrib></author> </authorgroup> - </chapterinfo> + </info> - <title>設定 FreeBSD Kernel</title> + - <sect1 id="kernelconfig-synopsis"> + <sect1 xml:id="kernelconfig-synopsis"> <title>概述</title> <indexterm> @@ -65,10 +54,10 @@ </listitem> </itemizedlist> - <para>本章所舉例的相關指令都是以 <username>root</username> 權限來進行。</para> + <para>本章所舉例的相關指令都是以 <systemitem class="username">root</systemitem> 權限來進行。</para> </sect1> - <sect1 id="kernelconfig-custom-kernel"> + <sect1 xml:id="kernelconfig-custom-kernel"> <title>為何需要重新調配、編譯 kernel?</title> <para>早期的 &os; 的 kernel 被戲稱為 <quote>monolithic</quote> kernel。 @@ -114,17 +103,13 @@ </itemizedlist> </sect1> - <sect1 id="kernelconfig-devices"> - <sect1info> + <sect1 xml:id="kernelconfig-devices"> + <info><title>探測系統硬體</title> <authorgroup> - <author> - <firstname>Tom</firstname> - <surname>Rhodes</surname> - <contrib>Written by </contrib> - </author> + <author><personname><firstname>Tom</firstname><surname>Rhodes</surname></personname><contrib>Written by </contrib></author> </authorgroup> - </sect1info> - <title>探測系統硬體</title> + </info> + <para>在進行 kernel 設定的探索之旅前, 先把該機器各項硬體資訊作點調查會是明智之舉。 @@ -144,7 +129,7 @@ 其中一種方式是透過 &man.dmesg.8; 以及 &man.man.1;。 &os; 上大多硬體都會有相關的 man 說明有支援的規格型號, 並且開機的偵測過程中,也會列出有找到的硬體。 舉個例子, - 下面這幾行是說有偵測到滑鼠,並且是以 <devicename>psm</devicename> + 下面這幾行是說有偵測到滑鼠,並且是以 <filename>psm</filename> 驅動程式:</para> <programlisting>psm0: <PS/2 Mouse> irq 12 on atkbdc0 @@ -167,9 +152,9 @@ psm0: model Generic PS/2 mouse, device ID 0</programlisting> class = network subclass = ethernet</programlisting> - <para>上面顯示是透過 <command>pciconf <option>-lv</option></command> - 所看到的 <devicename>ath</devicename> 無線網卡驅動程式。 可以用 - <command>man <replaceable>ath</replaceable></command> 來查看 + <para>上面顯示是透過 <command>pciconf -lv</command> + 所看到的 <filename>ath</filename> 無線網卡驅動程式。 可以用 + <command>man ath</command> 來查看 &man.ath.4; 的相關說明。</para> <para>在使用 &man.man.1; 時,加上 <option>-k</option> @@ -186,7 +171,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> 打造過程更為順利。</para> </sect1> - <sect1 id="kernelconfig-building"> + <sect1 xml:id="kernelconfig-building"> <title>重新調配、編譯 kernel</title> <indexterm> <primary>kernel</primary> @@ -198,7 +183,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> 也可以用 <filename>/sys</filename> 這個 symbolic link 來連到這。 這裡的許多子目錄分別擺放 kernel 的各組成部分,但對打造 kernel 影響最重要的目錄是 - <filename><replaceable>arch</replaceable>/conf</filename>, + <filename>arch/conf</filename>, 這裡是可以針對需求來修改自訂 kernel 相關設定。 此外,還有在編譯 kernel 過程中會暫時擺放的 <filename>compile</filename> 目錄。 @@ -219,7 +204,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> <para>若您系統上 <emphasis>沒裝</emphasis> <filename>/usr/src/sys</filename> 目錄, 也就是說沒裝 kernel source code 的話,那麼最簡單安裝方式就是以 - <username>root</username> 權限來執行 <command>sysinstall</command>, + <systemitem class="username">root</systemitem> 權限來執行 <command>sysinstall</command>, 接著請選 <guimenuitem>Configure</guimenuitem>,然後選 <guimenuitem>Distributions</guimenuitem> 接著為 <guimenuitem>src</guimenuitem> 再選 @@ -237,11 +222,11 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> </note> <para>接下來,切換到 - <filename><replaceable>arch</replaceable>/conf</filename> 目錄, + <filename>arch/conf</filename> 目錄, 複製 <filename>GENERIC</filename> 設定檔為你想稱呼的新 kernel 名稱。 例如:</para> - <screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf</userinput> + <screen>&prompt.root; <userinput>cd /usr/src/sys/i386/conf</userinput> &prompt.root; <userinput>cp GENERIC MYKERNEL</userinput></screen> <para>通常,命名方式都是大寫。如果你負責維護許多不同硬體架構的 &os; @@ -261,15 +246,15 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> 它會被新版覆蓋,而相關修改也將隨之而逝。</para> <para>你也可考慮把 kernel 設定檔改放到其他地方,然後再到 - <filename><replaceable>i386</replaceable></filename> + <filename>i386</filename> 目錄內建個指向它的 symbolic link。</para> <para>舉例:</para> - <screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf</userinput> + <screen>&prompt.root; <userinput>cd /usr/src/sys/i386/conf</userinput> &prompt.root; <userinput>mkdir /root/kernels</userinput> -&prompt.root; <userinput>cp GENERIC /root/kernels/<replaceable>MYKERNEL</replaceable></userinput> -&prompt.root; <userinput>ln -s /root/kernels/<replaceable>MYKERNEL</replaceable></userinput></screen> +&prompt.root; <userinput>cp GENERIC /root/kernels/MYKERNEL</userinput> +&prompt.root; <userinput>ln -s /root/kernels/MYKERNEL</userinput></screen> </tip> <para>現在,就開始用自己喜歡的編輯器來修改 <filename>MYKERNEL</filename>。 @@ -290,8 +275,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> 會循序漸進地介紹。</para> <note> - <para>若有從 &os; 計劃去 <link - linkend="cutting-edge">更新你的 source tree</link> 的話, + <para>若有從 &os; 計劃去 <link linkend="cutting-edge">更新你的 source tree</link> 的話, 則切記在進行任何升級之前,務必要察看 <filename>/usr/src/UPDATING</filename>。 這檔會介紹在更新過程中的重大議題或要注意的事項。 @@ -305,8 +289,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> <title>編譯 Kernel</title> <step> - <para>請切換至 <filename - class="directory">/usr/src</filename> 目錄:</para> + <para>請切換至 <filename>/usr/src</filename> 目錄:</para> <screen>&prompt.root; <userinput>cd /usr/src</userinput></screen> </step> @@ -314,13 +297,13 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> <step> <para>編譯 kernel:</para> - <screen>&prompt.root; <userinput>make buildkernel KERNCONF=<replaceable>MYKERNEL</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>make buildkernel KERNCONF=MYKERNEL</userinput></screen> </step> <step> <para>安裝新 kernel:</para> - <screen>&prompt.root; <userinput>make installkernel KERNCONF=<replaceable>MYKERNEL</replaceable></userinput></screen> + <screen>&prompt.root; <userinput>make installkernel KERNCONF=MYKERNEL</userinput></screen> </step> </procedure> @@ -345,40 +328,33 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> </tip> <indexterm> - <primary><filename class="directory">/boot/kernel.old</filename></primary> + <primary><filename>/boot/kernel.old</filename></primary> </indexterm> - <para>新的 kernel 會複製到 <filename - class="directory">/boot/kernel</filename> 目錄內的 + <para>新的 kernel 會複製到 <filename>/boot/kernel</filename> 目錄內的 <filename>/boot/kernel/kernel</filename>,而舊的則移至 <filename>/boot/kernel.old/kernel</filename>。 現在呢,先關機,然後就會以新 kernel 重開機 - 若有問題的話,本章後面會介紹一些<link - linkend="kernelconfig-trouble">疑難雜症</link>來協助你。 - 若新 kernel 無法開機的話,請參閱 <link - linkend="kernelconfig-noboot">這裡</link> 以恢復系統運作。</para> + 若有問題的話,本章後面會介紹一些<link linkend="kernelconfig-trouble">疑難雜症</link>來協助你。 + 若新 kernel 無法開機的話,請參閱 <link linkend="kernelconfig-noboot">這裡</link> 以恢復系統運作。</para> <note> <para>至於開機過程的其他相關檔案、設定,比如 &man.loader.8; 及其設定,則放在 <filename>/boot</filename>。 Third party 或自訂的 kernel modules 則會放在 - <filename class="directory">/boot/kernel</filename>,不過, + <filename>/boot/kernel</filename>,不過, 應注意要保持 kernel module 與 kernel 是否有同步, 這點很重要,否則會導致不穩或出問題。</para> </note> </sect1> - <sect1 id="kernelconfig-config"> - <sect1info> + <sect1 xml:id="kernelconfig-config"> + <info><title>kernel 設定檔解說</title> <authorgroup> - <author> - <firstname>Joel</firstname> - <surname>Dahl</surname> - <contrib>Updated for &os; 6.X by </contrib> - </author> + <author><personname><firstname>Joel</firstname><surname>Dahl</surname></personname><contrib>Updated for &os; 6.X by </contrib></author> </authorgroup> - </sect1info> - <title>kernel 設定檔解說</title> + </info> + <indexterm> <primary>kernel</primary> <secondary>NOTES</secondary> @@ -394,17 +370,16 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> 很多行大多只有一個參數。任何以 <literal>#</literal> 開頭的敘述都將被視為註解而被忽略。 接下來將以在 <filename>GENERIC</filename> 所出現的順序一一介紹之。 - <anchor - id="kernelconfig-options"/>若要看與該平台架構有關的各選項、設備列表, + <anchor xml:id="kernelconfig-options"/>若要看與該平台架構有關的各選項、設備列表, 請參閱與 <filename>GENERIC</filename> 檔同目錄的 <filename>NOTES</filename> 檔。 而與平台架構差異較無關的通用部份,則可參閱 <filename>/usr/src/sys/conf/NOTES</filename>。</para> <note> <para>若為了測試,而需要一份含有所有可用設定的設定檔,那麼請以 - <username>root</username> 身份下:</para> + <systemitem class="username">root</systemitem> 身份下:</para> - <screen>&prompt.root; <userinput>cd /usr/src/sys/<replaceable>i386</replaceable>/conf && make LINT</userinput></screen> + <screen>&prompt.root; <userinput>cd /usr/src/sys/i386/conf && make LINT</userinput></screen> </note> <indexterm> @@ -414,7 +389,7 @@ ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting> <para>下面為 <filename>GENERIC</filename> 設定檔的範例, 其中包括說明用的註釋。 這例子應該與您機器上的 - <filename>/usr/src/sys/<replaceable>i386</replaceable>/conf/GENERIC</filename> + <filename>/usr/src/sys/i386/conf/GENERIC</filename> 相當接近。</para> <indexterm> @@ -567,7 +542,7 @@ options NFS_ROOT # NFS usable as /, requires NFSCLIENT</progra hard drive partition at boot time, you can safely comment this out. It will be automatically loaded the first time you mount a DOS partition, as described above. Also, the excellent - <filename role="package">emulators/mtools</filename> software + <package>emulators/mtools</package> software allows you to access DOS floppies without having to mount and unmount them (and does not require <literal>MSDOSFS</literal> at all).</para> @@ -740,7 +715,7 @@ device ata</programlisting> <para>This is needed along with <literal>device ata</literal> for ATA RAID drives.</para> - <programlisting><anchor id="kernelconfig-atapi"/> + <programlisting><anchor xml:id="kernelconfig-atapi"/> device atapicd # ATAPI CDROM drives</programlisting> <para>This is needed along with <literal>device ata</literal> for @@ -936,12 +911,12 @@ device cardbus # CardBus (32-bit) bus</programlisting> device sio # 8250, 16[45]50 based serial ports</programlisting> <para>These are the serial ports referred to as - <devicename>COM</devicename> ports in the &ms-dos;/&windows; + <filename>COM</filename> ports in the &ms-dos;/&windows; world.</para> <note> - <para>If you have an internal modem on <devicename>COM4</devicename> - and a serial port at <devicename>COM2</devicename>, you will have + <para>If you have an internal modem on <filename>COM4</filename> + and a serial port at <filename>COM2</filename>, you will have to change the IRQ of the modem to 2 (for obscure technical reasons, IRQ2 = IRQ 9) in order to access it from &os;. If you have a multiport serial card, check the @@ -951,13 +926,13 @@ device sio # 8250, 16[45]50 based serial ports</programli S3 chips) use IO addresses in the form of <literal>0x*2e8</literal>, and since many cheap serial cards do not fully decode the 16-bit IO address space, they clash with - these cards making the <devicename>COM4</devicename> port + these cards making the <filename>COM4</filename> port practically unavailable.</para> <para>Each serial port is required to have a unique IRQ (unless you are using one of the multiport cards where shared interrupts are - supported), so the default IRQs for <devicename>COM3</devicename> - and <devicename>COM4</devicename> cannot be used.</para> + supported), so the default IRQs for <filename>COM3</filename> + and <filename>COM4</filename> cannot be used.</para> </note> <programlisting># Parallel port @@ -1065,7 +1040,7 @@ device xe # Xircom pccard Ethernet #device le</programlisting> <para>ISA Ethernet drivers. See - <filename>/usr/src/sys/<replaceable>i386</replaceable>/conf/NOTES</filename> for details + <filename>/usr/src/sys/i386/conf/NOTES</filename> for details of which cards are supported by which driver.</para> @@ -1097,8 +1072,7 @@ device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. device loop # Network loopback</programlisting> <para>This is the generic loopback device for TCP/IP. If you telnet - or FTP to <hostid>localhost</hostid> (a.k.a. <hostid - role="ipaddr">127.0.0.1</hostid>) it will come back at you through + or FTP to <systemitem>localhost</systemitem> (a.k.a. <systemitem class="ipaddress">127.0.0.1</systemitem>) it will come back at you through this device. This is <emphasis>mandatory</emphasis>.</para> <programlisting>device random # Entropy device</programlisting> @@ -1130,7 +1104,7 @@ device loop # Network loopback</programlisting> the <link linkend="userppp">PPP</link> section of this book for more information.</para> - <programlisting><anchor id="kernelconfig-ptys"/> + <programlisting><anchor xml:id="kernelconfig-ptys"/> device pty # Pseudo-ttys (telnet etc)</programlisting> <para>This is a <quote>pseudo-terminal</quote> or simulated login port. @@ -1208,7 +1182,7 @@ device fwe # Ethernet over FireWire (non-standard!)</programl <para>For more information and additional devices supported by &os;, see - <filename>/usr/src/sys/<replaceable>i386</replaceable>/conf/NOTES</filename>.</para> + <filename>/usr/src/sys/i386/conf/NOTES</filename>.</para> <sect2> <title>Large Memory Configurations (<acronym>PAE</acronym>)</title> @@ -1305,7 +1279,7 @@ device fwe # Ethernet over FireWire (non-standard!)</programl </sect1> - <sect1 id="kernelconfig-trouble"> + <sect1 xml:id="kernelconfig-trouble"> <title>If Something Goes Wrong</title> <para>There are five categories of trouble that can occur when @@ -1346,8 +1320,7 @@ device fwe # Ethernet over FireWire (non-standard!)</programl </varlistentry> <varlistentry> - <term>The kernel does not boot:<anchor - id="kernelconfig-noboot"/></term> + <term>The kernel does not boot:<anchor xml:id="kernelconfig-noboot"/></term> <listitem> <para>If your new kernel does not boot, or fails to @@ -1359,7 +1332,7 @@ device fwe # Ethernet over FireWire (non-standard!)</programl prompt</quote> option, number six. At the prompt, type <command>unload kernel</command> and then type - <command>boot /boot/<replaceable>kernel.old</replaceable>/kernel</command>, + <command>boot /boot/kernel.old/kernel</command>, or the filename of any other kernel that will boot properly. When reconfiguring a kernel, it is always a good idea to keep a kernel that is known to work on hand.</para> @@ -1380,13 +1353,13 @@ device fwe # Ethernet over FireWire (non-standard!)</programl new kernel, <filename>kernel.old</filename> is overwritten with the last installed kernel which may be non-functional. Also, as soon as possible, move the working kernel to the - proper <filename class="directory">/boot/kernel</filename> + proper <filename>/boot/kernel</filename> location or commands such as &man.ps.1; may not work properly. To do this, simply rename the directory containing the good kernel:</para> <screen>&prompt.root; <userinput>mv /boot/kernel /boot/kernel.bad</userinput> -&prompt.root; <userinput>mv /boot/<replaceable>kernel.good</replaceable> /boot/kernel</userinput></screen> +&prompt.root; <userinput>mv /boot/kernel.good /boot/kernel</userinput></screen> </note> |