OSDN Git Service

[lfsja-git] r11.1-117 対応。
[lfsbookja/lfsja-git.git] / src / chapter10 / kernel.ch
1 %
2 % This is part of LFSbookja package.
3 %
4 % This is a CTIE change file for the original XML source of the LFSbook.
5 %
6 @x
7 <?xml version="1.0" encoding="ISO-8859-1"?>
8 @y
9 <?xml version="1.0" encoding="UTF-8"?>
10 @z
11
12 @x
13     <para>The Linux package contains the Linux kernel.</para>
14 @y
15     <para>Linux パッケージは Linux カーネルを提供します。 </para>
16 @z
17
18 @x
19     <title>Installation of the kernel</title>
20 @y
21     <title>&InstallationOf1;カーネル&InstallationOf2;</title>
22 @z
23
24 @x
25     <para>Building the kernel involves a few steps&mdash;configuration,
26     compilation, and installation. Read the <filename>README</filename> file
27     in the kernel source tree for alternative methods to the way this book
28     configures the kernel.</para>
29 @y
30     <para>
31     カーネルの構築は、カーネルの設定、コンパイル、インストールの順に行っていきます。
32     本書が行っているカーネル設定の方法以外については、カーネルソースツリー内にある <filename>README</filename> ファイルを参照してください。
33     </para>
34 @z
35
36 @x
37     <para>Prepare for compilation by running the following command:</para>
38 @y
39     <para>
40     コンパイルするための準備として以下のコマンドを実行します。
41     </para>
42 @z
43
44 @x
45     <para>This ensures that the kernel tree is absolutely clean. The
46     kernel team recommends that this command be issued prior to each
47     kernel compilation. Do not rely on the source tree being clean after
48     un-tarring.</para>
49 @y
50     <para>
51     これによりカーネルソースが完全にクリーンなものになります。
52     カーネル開発チームは、カーネルコンパイルするなら、そのたびにこれを実行することを推奨しています。
53     tar コマンドにより伸張しただけのソースではクリーンなものにはなりません。
54     </para>
55 @z
56
57 @x
58     <para>There are several ways to configure the kernel options. Usually,
59     This is done through a menu-driven interface, for example:</para>
60 @y
61     <para>
62     カーネルオプションの設定方法にはいくつかあります。
63     通常は以下に示すように、メニュー形式のインターフェースを通じて行います。
64     </para>
65 @z
66
67 @x
68       <title>The meaning of optional make environment variables:</title>
69 @y
70       <title>追加する make 環境変数の意味:</title>
71 @z
72
73 @x
74           <para>This establishes the locale setting to the one used on the
75           host.  This may be needed for a proper menuconfig ncurses interface
76           line drawing on a UTF-8 linux text console.</para>
77 @y
78           <para>
79           これはホストのロケール設定を指示するものです。
80           この設定は UTF-8 での表示設定がされたテキストコンソールにて menuconfig の ncurses による行表示を適切に行うために必要となります。
81           </para>
82 @z
83
84 @x
85           <para>If used, be sure to replace
86           <replaceable>&lt;host_LANG_value&gt;</replaceable> by the value of
87           the <envar>$LANG</envar> variable from your host.  You can
88           alternatively use instead the host's value of <envar>$LC_ALL</envar>
89           or <envar>$LC_CTYPE</envar>.</para>
90 @y
91           <para>
92           <replaceable>&lt;host_LANG_value&gt;</replaceable> の部分は、ホストの <envar>$LANG</envar> 変数の値に置き換えてください。
93           <envar>$LC_ALL</envar> あるいは <envar>$LC_CTYPE</envar> の値を設定することもできます。
94           </para>
95 @z
96
97 @x make menuconfig
98           <para>This launches an ncurses menu-driven interface. For other
99           (graphical) interfaces, type <command>make help</command>.</para>
100 @y
101           <para>
102           これは ncurses によるメニュー形式のインターフェースを起動します。
103           これ以外の(グラフィカルな)インターフェースについては <command>make help</command> を入力して確認してください。
104           </para>
105 @z
106
107 @x
108     <para>For general information on kernel configuration see <ulink
109     url="&hints-root;kernel-configuration.txt"/>.  BLFS has some information
110     regarding particular kernel configuration requirements of packages outside
111     of LFS at <ulink
112     url="&blfs-book;longindex.html#kernel-config-index"/>.  Additional
113     information about configuring and building the kernel can be found at
114     <ulink url="http://www.kroah.com/lkn/"/> </para>
115 @y
116     <para>
117     カーネルの設定方法に関する一般的な情報が <ulink url="&hints-root;kernel-configuration.txt"/> にあるので参照してください。
118     BLFS では LFS が取り扱わない各種パッケージに対して、必要となるカーネル設定項目を説明しています。
119     <ulink url="&blfs-book;longindex.html#kernel-config-index"/> を参照してください。
120     さらに詳しくカーネルの構築や設定を説明している <ulink url="http://www.kroah.com/lkn/"/> もあります。
121     </para>
122 @z
123
124 @x
125       <para>A good starting place for setting up the kernel configuration is to
126       run <command>make defconfig</command>. This will set the base
127       configuration to a good state that takes your current system architecture
128       into account.</para>
129 @y
130       <para>
131       カーネル設定を行うにあたって、分かりやすいやり方として <command>make defconfig</command> を実行する方法があります。
132       これを実行することで基本的な設定がなされ、現在のシステム構成が考慮された、より良い設定が得られるかもしれません。
133       </para>
134 @z
135
136 @x
137       <para>Be sure to enable/disable/set the following features or the system might
138       not work correctly or boot at all:</para>
139 @y
140       <para>
141       以下の機能項目についての有効、無効、設定状況を確認してください。
142       不適切である場合にはシステムが正常動作しなかったり起動できなかったりするかもしれません。
143       </para>
144 @z
145
146 @x
147       <para>While "The IPv6 Protocol" is not strictly
148       required, it is highly recommended by the systemd developers.</para>
149 @y
150       <para>
151       "The IPv6 Protocol" については厳密には不要としても良いものですが、システム開発者は強く推奨しているものです。</para>
152 @z
153
154 @x
155     <para revision="sysv">There are several other options that may be desired
156     depending on the requirements for the system. For a list of options needed
157     for BLFS packages, see the <ulink
158     url="&lfs-root;blfs/view/&short-version;/longindex.html#kernel-config-index">BLFS
159     Index of Kernel Settings</ulink>
160     (&lfs-root;blfs/view/&short-version;/longindex.html#kernel-config-index).</para>
161 @y
162     <para revision="sysv">
163     システムに特定の機能性が必要になれば、それだけ多くのオプションが必要となります。
164     例えば BLFS パッケージにて必要となるオプションについては <ulink 
165     url="&lfs-root;blfs/view/&short-version;/longindex.html#kernel-config-index">BLFS 
166     Index of Kernel Settings</ulink> 
167     (&lfs-root;blfs/view/&short-version;/longindex.html#kernel-config-index)
168     を参照してください。
169     </para>
170 @z
171
172 @x
173       <para>If your host hardware is using UEFI and you wish to boot the
174       LFS system with it, you should adjust some kernel configuration
175       following <ulink url="&blfs-book;postlfs/grub-setup.html#uefi-kernel">
176       the BLFS page</ulink>.</para>
177 @y
178       <para>
179       ホストが UEFI を利用していて、これを使って LFS システムのブートを行いたい場合は、<ulink
180       url="&blfs-book;postlfs/grub-setup.html#uefi-kernel">
181       BLFS ページ</ulink> に従って、カーネル設定を調整する必要があります。
182       </para>
183 @z
184
185 @x
186       <title>The rationale for the above configuration items:</title>
187 @y
188       <title>上の設定項目の説明</title>
189 @z
190
191 @x Compile the kernel with warnings as errors
192           <para>This may cause building failure if the compiler and/or
193           configuration are different from those of the kernel
194           developers.</para>
195 @y
196           <para>
197           これを設定すると、カーネル開発者が採用するコンパイラーや設定と異なる場合に、カーネルビルドエラーとなる場合があります。
198           </para>
199 @z
200
201 @x Enable kernel headers through /sys/kernel/kheaders.tar.xz
202           <para>This will require <command>cpio</command> building the kernel.
203           <command>cpio</command> is not installed by LFS.</para>
204 @y
205           <para>
206           これは、 カーネルビルドにあたって <command>cpio</command> を必要とします。
207           <command>cpio</command> は LFS ではインストールしません。
208           </para>
209 @z
210
211 @x Support for uevent helper
212           <para>Having this option set may interfere with device
213           management when using Udev/Eudev. </para>
214 @y
215           <para>
216           本項目を有効にすることで、デバイス管理を Udev/Eudev により行ないます。
217           </para>
218 @z
219
220 @x Maintain a devtmpfs
221           <para>This will create automated device nodes which are populated by the
222           kernel, even without Udev running.  Udev then runs on top of this,
223           managing permissions and adding symlinks.  This configuration
224           item is required for all users of Udev/Eudev.</para>
225 @y
226           <para>
227           本項目は、カーネルにより事前登録される自動化デバイスノードを生成します。
228           これは Udev が動作していなくても行われます。
229           Udev はその上で起動し、パーミッション管理やシンボリックリンクの追加を行います。
230           Udev/Eudev を利用する場合には本項目を有効にすることが必要です。
231           </para>
232 @z
233
234 @x Automount devtmpfs at /dev
235           <para>This will mount the kernel view of the devices on /dev
236           upon switching to root filesystem just before starting
237           init.</para>
238 @y
239           <para>
240           これは、カーネルから見たデバイス情報を /dev 上にマウントするものです。
241           init が起動される直前にルートファイルシステムに切り替えられます。
242           </para>
243 @z
244
245 @x
246     <para>Alternatively, <command>make oldconfig</command> may be more
247     appropriate in some situations. See the <filename>README</filename>
248     file for more information.</para>
249 @y
250     <para>
251     上のコマンドではなく、状況によっては <command>make oldconfig</command> を実行することが適当な場合もあります。
252     詳細についてはカーネルソース内の <filename>README</filename> ファイルを参照してください。
253     </para>
254 @z
255
256 @x
257     <para>If desired, skip kernel configuration by copying the kernel
258     config file, <filename>.config</filename>, from the host system
259     (assuming it is available) to the unpacked <filename
260     class="directory">linux-&linux-version;</filename> directory. However,
261     we do not recommend this option. It is often better to explore all the
262     configuration menus and create the kernel configuration from
263     scratch.</para>
264 @y
265     <para>
266     カーネル設定は行わずに、ホストシステムにあるカーネル設定ファイル <filename>.config</filename> をコピーして利用することもできます。
267     そのファイルが存在すればの話です。
268     その場合は <filename class="directory">linux-&linux-version;</filename> ディレクトリにそのファイルをコピーしてください。
269     もっともこのやり方はお勧めしません。
270     設定項目をメニューから探し出して、カーネル設定を一から行っていくことが望ましいことです。
271     </para>
272 @z
273
274 @x
275     <para>Compile the kernel image and modules:</para>
276 @y
277     <para>カーネルイメージとモジュールをコンパイルします。</para>
278 @z
279
280 @x
281     <para>If using kernel modules, module configuration in <filename
282     class="directory">/etc/modprobe.d</filename> may be required.
283     Information pertaining to modules and kernel configuration is
284     located in <xref linkend="ch-config-udev"/> and in the kernel
285     documentation in the <filename
286     class="directory">linux-&linux-version;/Documentation</filename> directory.
287     Also, <filename>modprobe.d(5)</filename> may be of interest.</para>
288 @y
289     <para>
290     カーネルモジュールを利用する場合 <filename class="directory">/etc/modprobe.d</filename> ディレクトリ内での設定を必要とします。
291     モジュールやカーネル設定に関する情報は <xref linkend="ch-config-udev"/>や <filename
292     class="directory">linux-&linux-version;/Documentation</filename> ディレクトリにあるカーネルドキュメントを参照してください。
293     また <filename>modprobe.d(5)</filename> も有用です。
294     </para>
295 @z
296
297 @x
298     <para>Unless module support has been disabled in the kernel configuration,
299     install the modules with:</para>
300 @y
301     <para>カーネル設定においてモジュールの利用を無効にしているのでなければ、ここでモジュールをインストールします。</para>
302 @z
303
304 @x
305     <para>After kernel compilation is complete, additional steps are
306     required to complete the installation. Some files need to be copied to
307     the <filename class="directory">/boot</filename> directory.</para>
308 @y
309     <para>
310     カーネルのコンパイルが終わったら、インストールの完了に向けてあと少し作業を行います。
311     <filename class="directory">/boot</filename> ディレクトリにいくつかのファイルをコピーします。
312     </para>
313 @z
314
315 @x
316       <para>If the host system has a separate /boot partition, the files copied
317       below should go there. The easiest way to do that is to bind /boot on the
318       host (outside chroot) to /mnt/lfs/boot before proceeding.  As the
319       &root; user in the <emphasis>host system</emphasis>:</para>
320 @y
321       <para>
322       ホストシステムが独立した /boot パーティションを用いている場合はファイルをそこにコピーします。
323       これを簡単に行うために、作業前に(chroot 前の)/boot をホストの /mnt/lfs/boot にバインドしておく方法があります。
324       <emphasis>ホストシステム</emphasis> の &root; ユーザーとなって以下を実行します。
325       </para>
326 @z
327
328 @x
329     <para>The path to the kernel image may vary depending on the platform being
330     used. The filename below can be changed to suit your taste, but the stem of
331     the filename should be <emphasis>vmlinuz</emphasis> to be compatible with
332     the automatic setup of the boot process described in the next section.  The
333     following command assumes an x86 architecture:</para>
334 @y
335     <para>
336     カーネルイメージへのパスは、利用しているプラットフォームによってさまざまです。
337     そのファイル名は、好みにより自由に変更して構いません。
338     ただし <emphasis>vmlinuz</emphasis> という語は必ず含めてください。
339     これにより、次節で説明するブートプロセスを自動的に設定するために必要なことです。
340     以下のコマンドは x86 アーキテクチャーの場合の例です。
341     </para>
342 @z
343
344 @x
345     <para><filename>System.map</filename> is a symbol file for the kernel.
346     It maps the function entry points of every function in the kernel API,
347     as well as the addresses of the kernel data structures for the running
348     kernel.  It is used as a resource when investigating kernel problems. 
349     Issue the following command to install the map file:</para>
350 @y
351     <para>
352     <filename>System.map</filename> はカーネルに対するシンボルファイルです。
353     このファイルはカーネル API の各関数のエントリポイントをマッピングしています。
354     同様に実行中のカーネルのデータ構成のアドレスを保持します。
355     このファイルは、カーネルに問題があった場合にその状況を調べる手段として利用できます。
356     マップファイルをインストールするには以下を実行します。
357     </para>
358 @z
359
360 @x
361     <para>The kernel configuration file <filename>.config</filename>
362     produced by the <command>make menuconfig</command> step
363     above contains all the configuration selections for the kernel
364     that was just compiled. It is a good idea to keep this file for future
365     reference:</para>
366 @y
367     <para>
368     カーネル設定ファイル <filename>.config</filename> は、上で実行した <command>make menuconfig</command> によって生成されます。
369     このファイル内には、今コンパイルしたカーネルの設定項目の情報がすべて保持されています。
370     将来このファイルを参照する必要が出てくるかもしれないため、このファイルを保存しておきます。
371     </para>
372 @z
373
374 @x
375     <para>Install the documentation for the Linux kernel:</para>
376 @y
377     <para>Linux カーネルのドキュメントをインストールします。</para>
378 @z
379
380 @x
381     <para>It is important to note that the files in the kernel source
382     directory are not owned by <emphasis>root</emphasis>. Whenever a
383     package is unpacked as user <emphasis>root</emphasis> (like we did
384     inside chroot), the files have the user and group IDs of whatever
385     they were on the packager's computer. This is usually not a problem
386     for any other package to be installed because the source tree is
387     removed after the installation. However, the Linux source tree is
388     often retained for a long time.  Because of this, there is a chance
389     that whatever user ID the packager used will be assigned to somebody
390     on the machine. That person would then have write access to the kernel
391     source.</para>
392 @y
393     <para>
394     カーネルのソースディレクトリは所有者が <emphasis>root</emphasis> ユーザーになっていません。
395     我々は chroot 環境内の <emphasis>root</emphasis> ユーザーとなってパッケージを展開してきましたが、展開されたファイル類はパッケージ開発者が用いていたユーザー ID、グループ ID が適用されています。
396     このことは普通はあまり問題になりません。
397     というのもパッケージをインストールした後のソースファイルは、たいていは削除するからです。
398     一方 Linux のソースファイルは、削除せずに保持しておくことがよく行われます。
399     このことがあるため開発者の用いたユーザーIDが、インストールしたマシン内の誰かの ID に割り当たった状態となりえます。
400     その人はカーネルソースを自由に書き換えてしまう権限を持つことになるわけです。
401     </para>
402 @z
403
404 @x
405       <para>In many cases, the configuration of the kernel will need to be
406       updated for packages that will be installed later in BLFS.  Unlike
407       other packages, it is not necessary to remove the kernel source tree
408       after the newly built kernel is installed.</para>
409 @y
410       <para>
411       カーネルの設定は、BLFS をインストールしていくにつれて、設定を更新していかなければならないことが多々あります。
412       一般にパッケージのソースは削除することが通常ですが、カーネルのソースに関しては、カーネルをもう一度新たにインストールするなら、削除しなくて構いません。
413       </para>
414 @z
415
416 @x
417       <para>If the kernel source tree is going to be retained, run
418       <command>chown -R 0:0</command> on the <filename
419       class="directory">linux-&linux-version;</filename> directory to ensure
420       all files are owned by user <emphasis>root</emphasis>.</para>
421 @y
422       <para>
423       カーネルのソースファイルを保持しておくつもりなら <filename
424       class="directory">linux-&linux-version;</filename> ディレクトリにおいて <command>chown -R 0:0</command> を実行しておいてください。
425       これによりそのディレクトリの所有者は <emphasis>root</emphasis> ユーザーとなります。
426       </para>
427 @z
428
429 @x
430       <para>Some kernel documentation recommends creating a symlink from
431       <filename class="symlink">/usr/src/linux</filename> pointing to the kernel
432       source directory.  This is specific to kernels prior to the 2.6 series and
433       <emphasis>must not</emphasis> be created on an LFS system as it can cause
434       problems for packages you may wish to build once your base LFS system is
435       complete.</para>
436 @y
437       <para>
438       カーネルを説明する書の中には、カーネルのソースディレクトリに対してシンボリックリンク <filename
439       class="symlink">/usr/src/linux</filename> の生成を勧めているものがあります。
440       これはカーネル 2.6 系以前におけるものであり LFS システム上では生成<emphasis>してはなりません </emphasis>。
441       ベースとなる LFS システムを構築し、そこに新たなパッケージを追加していこうとした際に、そのことが問題となるからです。
442       </para>
443 @z
444
445 @x
446       <para>The headers in the system's <filename
447       class="directory">include</filename> directory (<filename
448       class="directory">/usr/include</filename>) should
449       <emphasis>always</emphasis> be the ones against which Glibc was compiled,
450       that is, the sanitised headers installed in <xref
451       linkend="ch-tools-linux-headers"/>.  Therefore, they should
452       <emphasis>never</emphasis> be replaced by either the raw kernel headers
453       or any other kernel sanitized headers.</para>
454 @y
455       <para>
456       さらに <filename
457       class="directory">include</filename> ディレクトリ (<filename
458       class="directory">/usr/include</filename>) にあるヘッダーファイルは、<emphasis>必ず</emphasis> Glibc のコンパイル時のものでなければなりません。
459       つまり <xref
460       linkend="ch-tools-linux-headers"/> によってインストールされた、健全化 (sanitizing) したものです。
461       したがって生のカーネルヘッダーや他のカーネルにて健全化されたヘッダーによって上書きされてしまうのは避けなければなりません。
462       </para>
463 @z
464
465 @x
466     <title>Configuring Linux Module Load Order</title>
467 @y
468     <title>Linux モジュールのロード順の設定</title>
469 @z
470
471 @x
472     <para>Most of the time Linux modules are loaded automatically, but
473     sometimes it needs some specific direction.  The program that loads
474     modules, <command>modprobe</command> or <command>insmod</command>, uses
475     <filename>/etc/modprobe.d/usb.conf</filename> for this purpose.  This file
476     needs to be created so that if the USB drivers (ehci_hcd, ohci_hcd and
477     uhci_hcd) have been built as modules, they will be loaded in the correct
478     order; ehci_hcd needs to be loaded prior to ohci_hcd and uhci_hcd in order
479     to avoid a warning being output at boot time.</para>
480 @y
481     <para>
482     たいていの場合 Linux モジュールは自動的にロードされます。
483     しかし中には特定の指示を必要とするものもあります。
484     モジュールをロードするプログラム、<command>modprobe</command> または <command>insmod</command> は、そのような指示を行う目的で <filename>/etc/modprobe.d/usb.conf</filename> を利用します。
485     USB ドライバー (ehci_hcd, ohci_hcd, uhci_hcd) がモジュールとしてビルドされていた場合には、それらを正しい順でロードしなければならず、そのために <filename>/etc/modprobe.d/usb.conf</filename> ファイルが必要となります。
486     ehci_hcd は ohci_hcd や uhci_hcd よりも先にロードしなければなりません。
487     これを行わないとブート時に警告メッセージが出力されます。
488     </para>
489 @z
490
491 @x
492     <para>Create a new file <filename>/etc/modprobe.d/usb.conf</filename> by running
493     the following:</para>
494 @y
495     <para>
496     以下のコマンドを実行して <filename>/etc/modprobe.d/usb.conf</filename> ファイルを生成します。
497     </para>
498 @z
499
500 @x
501     <title>Contents of Linux</title>
502 @y
503     <title>&ContentsOf1;Linux&ContentsOf2;</title>
504 @z
505
506 @x
507       <segtitle>Installed files</segtitle>
508       <segtitle>Installed directories</segtitle>
509 @y
510       <segtitle>&InstalledFiles;</segtitle>
511       <segtitle>&InstalledDirectory;</segtitle>
512 @z
513
514 @x
515         <seg>config-&linux-version;,
516         vmlinuz-&linux-version;-lfs-&version;,
517         and System.map-&linux-version;</seg>
518         <seg>/lib/modules, /usr/share/doc/linux-&linux-version;</seg>
519 @y
520         <seg>config-&linux-version;,
521         vmlinuz-&linux-version;-lfs-&version;,
522         and System.map-&linux-version;</seg>
523         <seg>/lib/modules, /usr/share/doc/linux-&linux-version;</seg>
524 @z
525
526 @x
527       <bridgehead renderas="sect3">Short Descriptions</bridgehead>
528 @y
529       <bridgehead renderas="sect3">&ShortDescriptions;</bridgehead>
530 @z
531
532 @x
533           <para>Contains all the configuration selections for the kernel</para>
534 @y
535           <para>
536           カーネルの設定をすべて含みます。
537           </para>
538 @z
539
540 @x
541           <para>The engine of the Linux system. When turning on the computer,
542           the kernel is the first part of the operating system that gets loaded.
543           It detects and initializes all components of the computer's hardware,
544           then makes these components available as a tree of files to the
545           software and turns a single CPU into a multitasking machine capable
546           of running scores of programs seemingly at the same time</para>
547 @y
548           <para>
549           Linux システムのエンジンです。
550           コンピューターを起動した際には、オペレーティングシステム内にて最初にロードされるものです。
551           カーネルはコンピューターのハードウェアを構成するあらゆるコンポーネントを検知して初期化します。
552           そしてそれらのコンポーネントをツリー階層のファイルとして、ソフトウェアが利用できるようにします。
553           ただひとつの CPU からマルチタスクを処理するマシンとして、あたかも多数のプログラムが同時稼動しているように仕向けます。
554           </para>
555 @z
556
557 @x
558           <para>A list of addresses and symbols; it maps the entry points and
559           addresses of all the functions and data structures in the
560           kernel</para>
561 @y
562           <para>
563           アドレスとシンボルのリストです。
564           カーネル内のすべての関数とデータ構成のエントリポイントおよびアドレスを示します。
565           </para>
566 @z