[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: kernel-handbook 査読依頼 #4



八津尾です。

まぁまぁ納得できるレベルに達したので
第 4 章の査読をお願いします。

# かなり長いです
# 実際にはコメント化されている原文を除いて
# 段落内での改行を全て消した状態になります

titanpad の方も更新しました。
http://yyatsuo.titanpad.com/6

よろしくお願いします。

<chapt id="common-tasks">

  <!-- <heading>Common kernel-related tasks</heading> -->
  <heading>カーネル関連の一般的な作業手順</heading>

  <sect id="common-getting">

    <!-- <heading>Obtaining the Debian kernel source</heading> -->
    <heading>Debian カーネルソースを取得する</heading>
<!--
      To get the Debian kernel source at the current maximum patchlevel,
      it is sufficient to install the latest <tt>linux-source-<em>version</em></tt>
      package and unpack the source, for example:
      <example>
      # apt-get install linux-source-3.2
      $ tar jxf /usr/src/linux-source-3.2.tar.bz2
      </example>
      The unpacked source tree then will be available in
      <tt>linux-source-3.2</tt> directory.
-->

    <p>
      <tt>linux-source-<em>version</em></tt> パッケージをインストールしてソース
      を展開するだけで Debian のカーネルソースを最新のパッチレベルで取得すること
      ができます。例えば:
      <example>
      # apt-get install linux-source-3.2
      $ tar jxf /usr/src/linux-source-3.2.tar.bz2
      </example>
      ソースツリーが<tt>linux-source-3.2</tt>ディレクトリに展開されます。
    </p>
  </sect>

 <sect id="common-official">

  <!-- <heading>Rebuilding official Debian kernel packages</heading> -->
  <heading>公式の Debian カーネルパッケージをリビルドする</heading>

<!--
    You can build all or selected kernel packages by following
    these instructions.  You may be asked to do this in order to
    test a potential bug fix.
-->

  <p>
    全ての、または任意のカーネルパッケージは、以下の手順でビルドできます。潜在的
    なバグの修正をテストするために、リビルドが必要になる場合があります。
  </p>

  <sect1>
  <!-- <heading>Preparation</heading> -->
  <heading>準備</heading>

<!--
    For Debian 6.0 (squeeze) and earlier versions, substitute
    the source package name <tt>linux-2.6</tt> for
    <tt>linux</tt>.
-->
  <p>
    Debian 6.0 (squeeze) 以前のバージョンでは、ソースパッケージ名
    <tt>linux</tt> を <tt>linux-2.6</tt> に読みかえてください。
  </p>

<!--
    Run the following commands:
-->
  <p>
    次のコマンドを実行します:
    <taglist>

      <tag><tt>$ apt-get source linux</tt></tag>

      <item>
<!--
        This will download and unpack the
        <tt>linux</tt> source package, making the
        tree available in the
        <tt>linux-<em>version</em></tt>
        directory. As always, the revision part of the version
        of this package (for example, 1 in 3.2.19-1) will
        determine its patchlevel with respect to the original
        upstream kernel source.
-->
        <tt>linux-<em>version</em></tt> ディレクトリに <tt>linux</tt> ソース
        パッケージがダウンロードされ、展開されます。このパッケージのバージョン名の
        リビジョンの部分 (例えば、3.2.19-1 の 1 にあたる部分) は、常にオリジナルの
        アップストリームカーネルに対するパッチレベルをあらわしています。
      </item>

      <tag><tt># apt-get install build-essential fakeroot</tt></tag>
      <tag><tt># apt-get build-dep linux</tt></tag>


<!--
        The last two commands will install the build dependencies required by the kernel
        build process.
-->
      <item>
        この 2 つのコマンドは、カーネルのビルド時に要求されるビルド依存を
        インストールします。
      </item>

      <tag><tt>$ cd linux-<em>version</em></tt></tag>
<!--
        Enter the source directory.
-->
      <item>
        ソースディレクトリに入ります。
      </item>
    </taglist>
  </p>

  <sect2 id="common-size">

    <!-- <heading>Disk space requirements</heading>-->
    <heading>必要なディスクの空きスペース</heading>

<!--
      Building binary packages for a single kernel flavour
      with debug info enabled (currently true for
      the <tt>686-pae</tt>, <tt>amd64</tt>, <tt>rt-686-pae</tt>,
      <tt>rt-amd64</tt> and <tt>s390x</tt> configurations)
      requires up to 10&nbsp;GB space in the package directory
-->
    <p>
      1 つのカーネルフレーバをデバッグ情報を有効にした状態でビルドするには
      ( 現在、<tt>686-pae</tt>、<tt>amd64</tt>、<tt>rt-686-pae</tt>、
      <tt>rt-amd64</tt>、<tt>s390x</tt> のコンフィグレーションで true になっています)
      パッケージディレクトリに最大で 10GB 程度以上、<tt>/tmp</tt>
      (または <tt>$TMPDIR</tt>) に 300MB 程度以上の空き容量が必要です。
    </p>

<!--
      Building with debug info disabled requires about
      2&nbsp;GB and 25&nbsp;MB respectively.  You can disable
      debug info by changing the value of <tt>debug-info</tt>
      to <tt>false</tt> in
      <tt>debian/config/</tt><var>arch</var><tt>/defines</tt>.
-->

    <p>
      デバッグ情報を無効にした場合は、それぞれ約 2GB と 25 MB 以上必要です。
      デバッグ情報は<tt>debian/config/</tt><var>arch</var><tt>/defines</tt>の
      <tt>debug-info</tt>の値を<tt>false</tt>にすることで無効にできます。
    </p>

<!--
      Building all binary packages for i386 or amd64 currently
      requires about 20&nbsp;GB space in the package
      directory.  Other architectures with no debug info or
      fewer drivers will require less space.
-->
    <p>
      i386 または amd64 のバイナリパッケージをビルドするには、今のところ
      約 20 GB の空き容量がパッケージディレクトリに必要です。デバッグ情報が
      なかったりドライバが少ない他のアーキテクチャに必要な空き容量はこれよりも
      少ないでしょう。
    </p>

    </sect2>
  </sect1>

  <sect1>

  <!-- <heading>Simple patching and building</heading> -->
  <heading>簡単なパッチ適用とビルド実行</heading>

<!--
    The source package includes a script to simplify the
    process of building with extra patches.  You can use this
    by running commands such as:
    <example>
    # apt-get install devscripts
    $ bash debian/bin/test-patches ../fix-bug123456.patch ../add-foo-driver.patch
    </example>
    This script has options to control the flavour, featureset,
    etc.  For a summary of the options, run:
    <example>
    $ bash debian/bin/test-patches
    </example>
-->

  <p>
    ソースパッケージには、追加のパッチを適用してビルドのプロセスを簡略化するための
    スクリプトが含まれます。このスクリプトは次のコマンドで実行します:
    <example>
# apt-get install devscripts $ bash debian/bin/test-patches ../fix-bug123456.patch ../add-foo-driver.patch
    </example>
    このスクリプトにはフレーバやフィーチャセットの制御が可能なオプションが指定できます。
    オプションの概要を見るには、次のコマンドを実行して下さい:
    <example>
$ bash debian/bin/test-patches
    </example>
  </p>

<!--
    You may then need to build the linux-base package as well:
    <example>
    $ fakeroot make -f debian/rules.real install-linux-base
    </example>
-->

  <p>
    場合によっては、linux-base パッケージもビルドする必要があるかもしれません:
    <example>
$ fakeroot make -f debian/rules.real install-linux-base
    </example>
  </p>

<!--
    However, if you need to change the configuration or make
    other changes, you should not use this script and should
    follow the instructions below.
-->

  <p>
    もし設定を変えたり変更を加えたりする必要がある場合、このスクリプトは使用せずに、
    次に説明する手順に従ってください。
  </p>
  </sect1>

  <sect1>

    <!-- <heading>Applying patches or configuration changes</heading> -->
    <heading>パッチの適用や設定の変更</heading>

<!--
      It is possible to apply extra patches to the source before
      starting the build.  In the <tt>linux</tt> source package,
      the default (non-featureset) patches are automatically
      applied in the top level directory.  If you are building
      the <tt>linux-2.6</tt> source package or building with a
      featureset, you should first apply the existing patches by
      running:
      <example>
      $ fakeroot debian/rules source
      </example>
      The patched source appears in the following directories.
-->
  <p>
    ビルドを開始する前に追加のパッチをソースに適用することができます。
    <tt>linux</tt> ソースパッケージには、トップディレクトリにデフォルト
    (フィーチャセットが無い状態) のパッチが自動的に適用されます。
    もし <tt>linux-2.6</tt> ソースパッケージをフィーチャセットつきでビルドするには、
    まず今あるパッチを適用しましょう。

    <example> $ fakeroot debian/rules source </example>

    パッチを適用したソースは次のディレクトリに格納されます。

<!-- TODO: 訳漏れ -->
    <taglist>
    <!-- <tag>linux default source:</tag> -->
    <tag>Linux デフォルトのソース:</tag>
        <!-- <item>top level</item> -->
        <item>最上位の階層</item>

    <!-- <tag>linux source with featureset:</tag> -->
    <tag>linux source with featureset:</tag>
        <!-- <item><tt>debian/build/source_<em>featureset</em></tt></item> -->
        <item><tt>debian/build/source_<em>featureset</em></tt></item>

    <!-- <tag><tt>linux-2.6</tt> default source:</tag> -->
    <tag><tt>linux-2.6</tt> default source:</tag>
        <!-- <item><tt>debian/build/source_<em>arch</em>_none</tt></item> -->
        <item><tt>debian/build/source_<em>arch</em>_none</tt></item>

    <!-- <tag><tt>linux-2.6</tt> source with featureset:</tag> -->
    <tag><tt>linux-2.6</tt> source with featureset:</tag>
        <!-- <item><tt>debian/build/source_<em>arch</em>_<em>featureset</em></tt></item> -->
        <item><tt>debian/build/source_<em>arch</em>_<em>featureset</em></tt></item>
    </taglist>

<!--
    You should apply the extra patches in the appropriate
    directory. In the <tt>linux</tt> source package you can
    use the <tt>quilt</tt> utility to do this.
-->
    追加のパッチは正しいディレクトリにそれぞれ適用して下さい。
    <tt>linux</tt> ソースパッケージでは、この作業に <tt>quilt</tt> を使用することが
    できます。
  </p>

<!--
    To change the configuration before building, for example
    for the 686-pae flavour on i386, run the commands:
    <example>
    $ fakeroot make -f debian/rules.gen setup_i386_none_686-pae
    $ make -C debian/build/build_i386_none_686-pae menuconfig
    </example>
-->

  <p>
    設定をビルドする前に変更するには、例えば i386 の 686-pae フレーバの場合は次の
    コマンドを実行します:
    <example>
    $ fakeroot make -f debian/rules.gen setup_i386_none_686-pae $ make -C debian/build/build_i386_none_686-pae menuconfig
    </example>
  </p>

<!--
    If the patches or configuration changes alter type
    definitions for the kernel, you may need to change the ABI
    name; see <ref id="abi-name">.
-->

  <p>
    パッチまたは変更した設定が、カーネルの型定義を変更する場合、 ABI 名を変更
    する必要があるかもしれません。<ref id="abi-name">を参照して下さい。
  </p>
  </sect1>

  <sect1>

    <!-- <heading>Building many packages</heading> -->
    <heading>パッケージを一度にビルドする</heading>

<!--
    To build all possible packages for this architecture, run:
    <example>
    $ fakeroot debian/rules binary
    </example>
    To build all architecture-dependent packages, run:
    <example>
    $ fakeroot debian/rules binary-arch
    </example>
    To build all architecture-independent packages, run:
    <example>
    $ fakeroot debian/rules binary-indep
    </example>
-->

  <p>
    可能な全てのアーキテクチャ用にパッケージをビルドする場合は次の
    コマンドを実行して下さい:
    <example>
      $ fakeroot debian/rules binary
    </example>

    アーキテクチャ依存の全てのパッケージをビルドする場合は次のコマンドを実行して下さい:
    <example>
      $ fakeroot debian/rules binary-arch
    </example>

    全てのアーキテクチャ非依存のパッケージをビルドする場合は次のコマンドを実行して下さい:
    <example>
      $ fakeroot debian/rules binary-indep
    </example>
  </p>
  </sect1>

  <sect1>
    <!-- <heading>Building packages for one flavour</heading> -->
    <heading>特定のフレーバのためにパッケージをビルドする</heading>

<!--
    For example, to build only the binary packages for 686-pae
    flavour on i386 architecture, use the following commands:
    <example>
    $ fakeroot debian/rules source
    $ fakeroot make -f debian/rules.gen binary-arch_i386_none_686-pae
    </example>
    The target in this command has the general form of
    <tt><em>target</em>_<em>arch</em>_<em>featureset</em>_<em>flavour</em></tt>.
    Replace the <tt><em>featureset</em></tt> with
    <tt>none</tt> if you do not want any of the extra
    featuresets. This command will build the linux image and
    kernel headers packages. You may also need
    the <tt>linux-headers-<em>version</em>-common</tt> binary
    package, which can be built using the commands:
    <example>
    $ fakeroot debian/rules source
    $ fakeroot make -f debian/rules.gen binary-arch_i386_none_real
    </example>
    The target in this command has the general form of
    <tt><em>target</em>_<em>arch</em>_<em>featureset</em>_<em>real</em></tt>
-->

  <p>
    例えば、 i386アーキテクチャで 686-pae フレーバだけのバイナリパッケージをビルド
    する場合は次のコマンドを実行して下さい:

    <example>
    $ fakeroot debian/rules source $ fakeroot make -f debian/rules.gen binary-arch_i386_none_686-pae
    </example>

    このコマンド内でのターゲットの指定方法は以下の書式で汎化されています:
    <tt><em>target</em>_<em>arch</em>_<em>featureset</em>_<em>flavour</em></tt>

    追加のフィーチャセットが不要な場合、<tt><em>featureset</em></tt> を <tt>none</tt>
    で置き変えます。このコマンドは linux イメージとカーネルヘッダパッケージをビルド
    します。場合によっては <tt>linux-headers-<em>version</em>-common</tt> バイナリ
    パッケージが必要かもしれません。

    次のコマンドでビルドできます:
    <example>
    $ fakeroot debian/rules source $ fakeroot make -f debian/rules.gen binary-arch_i386_none_real
    </example>

    このコマンドのターゲットは次の書式で汎化されています:
    <tt><em>target</em>_<em>arch</em>_<em>featureset</em>_<em>real</em></tt>
  </p>
  </sect1>
 </sect>


  <sect id="common-official-vcs">
    <!-- <heading>Building a development version of the Debian kernel package</heading>-->
    <heading>Debian カーネルパッケージの開発用バージョンをビルドする</heading>

<!--
    For Debian 6.0 (squeeze) and earlier versions, substitute
    the source package name <tt>linux-2.6</tt> for
    <tt>linux</tt>.
-->
  <p>
    Debian 6.0 (squeeze) 以前のバージョンでは、ソースパッケージ名 <tt>linux</tt> を <tt>linux-2.6</tt> に読みかえてください。
  </p>


  <p>
<!--
    To build a kernel image based on the kernel team's
    unreleased development version:
-->
    カーネルチームがまだリリースしていない開発バージョンのカーネルイメージをビルド
    するには、次のコマンドを実行します:

    <taglist>
    <tag><tt># apt-get install build-essential fakeroot rsync svn</tt></tag>
    <tag><tt># apt-get build-dep linux</tt></tag>

<!--
    The last two commands will install the build
    dependencies required by the kernel build process.
-->
    <item>
      最後の 2 つのコマンドはカーネルのビルドプロセス中に必要なビルド依存を
      インストールします。
    </item>

    <tag><tt>$ svn co svn://anonscm.debian.org/svn/kernel/dists/<em>dist</em>/linux</tt></tag>

<!--
    This will check out the Debian packaging.  <em>dist</em>
    is normally the distribution codename such as
    <tt>wheezy</tt> or <tt>sid</tt> (unstable).  For the very
    latest version, usually based on an upstream release
    candidate, use <tt>trunk</tt>.
-->
    <item>
      Debian のパッケージをチェックアウトします。<em>dist</em> には、<tt>wheezy</tt> や
      <tt>sid</tt> (不安定版) などのディストリビューションのコードネームが入ります。
      アップストリームのリリース候補版をベースにした最新のバージョンを入手したい場合は
      <tt>trunk</tt>からチェックアウトして下さい。
    </item>

    <tag><tt>$ apt-get source -d linux</tt></tag>

<!--
    This will download the <tt>linux</tt> upstream
    source (and the last released Debian patches).
    Depending on which version you are trying to build,
    you might need to override APT's version selection
    or download a tarball from
    <url id="http://people.debian.org";
    name="people.debian.org"> instead.
-->

    <item>
      <tt>linux</tt> のアップストリームのソース (と最新の Debian パッチ)をダウンロード
      します。ビルドしようとしているバージョンによって、APT のバージョン選択を上書きを
      したり、変わりに <url id="http://people.debian.org"; name="people.debian.org"> か
      ら tarball をダウンロードする必要があります。
    </item>

    <tag><tt>$ cd linux</tt></tag>
    <tag><tt>$ debian/rules orig</tt></tag>

<!--
    This unpacks the upstream source and merges it with
    the Debian packaging.
-->

    <item>
      アップストリームのソースを展開し、Debian のパッケージとマージします。
    </item>

    <tag><tt>$ debian/rules debian/control</tt></tag>

<!--
    This generates a Debian package control file based on
    the current definitions of the various kernel flavours
    which can be built.
-->
    <item>
      現在ビルドすることができる様々なカーネルフレーバの定義にもとづいて、
      Debian パッケージの control ファイルを生成します。
    </item>

    <tag><tt>$ fakeroot debian/rules <em>target</em></tt></tag>

<!--
    Finally, build binary packages as explained in
    <ref id="common-official">.
-->

    <item>
      <ref id="common-official"> で説明したバイナリパッケージをビルドします。
    </item>
    </taglist>
    </p>
  </sect>

  <sect id="gen-orig">
    <!-- <heading>Generating orig tarball from newer upstream</heading> -->
    <heading>orig tarball をより新しいアップストリームの tarball から生成する</heading>

<!--
    First you must add a changelog entry for the new upstream
    version.  If the new version is a release candidate, change
    the string <tt>-rc</tt> to <tt>~rc</tt>.  (In Debian package
    versions, a suffix beginning with <tt>~</tt> indicates a
    pre-release.)
-->

  <p>
    まず、新しいアップストリームバージョンの変更履歴を追加します。新しいバージョンが
    リリース候補版なら、バージョン文字列の <tt>-rc</tt> を <tt>~rc</tt> に変更して下
    さい。(Debian のパッケージでは、サフィックス<tt>~</tt>がプレリリース用に使われて
    います )
  </p>

<!--
    The 'orig' tarball is generated by the <tt>genorig.py</tt>
    script.  It takes either a tarball and optional patch from
    kernel.org, or a git repository.  If you have a tarball, run
    a command such as:
    <example>
    $ python debian/bin/genorig.py ../linux-3.4.tar.bz2 ../patch-3.5-rc1.bz2
    </example>
-->

  <p>
    'orig'  tarball は<tt>genorig.py</tt>スクリプトによって生成されます。
    このスクリプトは tarball、オプションのパッチ、または kernel.org の git リポジトリ
    へのパスを引数にとります。tarball が手元にある場合は次のようなコマンドを実行します:
    <example>
      $ python debian/bin/genorig.py ../linux-3.4.tar.bz2 ../patch-3.5-rc1.bz2
    </example>
  </p>

<!--
    If you have a git repository, pass the name of its
    directory:
    <example>
    $ python debian/bin/genorig.py ~/src/linux
    </example>
-->

  <p>
    git リポジトリが手元にある場合は、そのディレクトリ名を引数に渡します:
    <example>
      $ python debian/bin/genorig.py ~/src/linux
    </example>
  </p>

<!--
    Either of these will generate a file such as
    <tt>../orig/linux_3.5~rc1.orig.tar.xz</tt>.
    You can then combine this tarball with the Debian packaging
    by running:
    <example>
    $ debian/rules orig
    </example>
-->

  <p>
    どちらを実行した場合にも、<tt>../orig/linux_3.5~rc1.orig.tar.xz</tt>のような
    ファイルが生成されます。この tarball を次のコマンドで Debian パッケージに統合
    します:
    <example>
      $ debian/rules orig
    </example>
  </p>
 </sect>

  <sect id="common-building">
    <!-- <heading>Building a custom kernel from Debian kernel source</heading> -->
    <heading>Debian カーネルソースからカスタムカーネルをビルドする</heading>

<!--
    This section describes the simplest possible procedure to
    build a custom kernel the "Debian way". It is assumed that
    user is somewhat familiar with kernel configuration and
    build process. If that's not the case, it is recommended to
    consult the kernel documentation and many excellent online
    resources dedicated to it.
-->

  <p>
    このセクションでは "Debian way" でカスタムカーネルをビルドするための可能な限り
    シンプルな手順を紹介します。カーネルの設定やビルドプロセスにある程度の知識があ
    ることを前提とします。もし、そうでない場合はカーネルドキュメンテーションと素晴
    らしいオンラインのリソースに目を通しましょう。
  </p>

<!--
    The easiest way to build a custom kernel (the kernel with
    the configuration different from the one used in the
    official packages) from the Debian kernel source is to use
    the <tt>linux-source</tt> package and the <tt>make deb-pkg</tt>
    target. First, prepare the kernel tree:
-->

  <p>
    Debian カーネルのソースからカスタムカーネル (オフィシャルパッケージで使われてい
    る設定とは違う設定のカーネル) をビルドするための最も簡単な方法は
    <tt>linux-source</tt> パッケージと <tt>make deb-pkg</tt> ターゲットを使うことです。
    まず、カーネルツリーの準備をします。
    <example>
    # apt-get install linux-source-3.2 $ tar xjf /usr/src/linux-source-3.2.tar.bz2 $ cd linux-source-3.2
    </example>

<!--
    The kernel now needs to be configured, that is you have to
    set the kernel options and select the drivers which are
    going to be included, either as built-in, or as external
    modules. The kernel build infrastructure offers a number of
    targets, which invoke different configuration frontends. For
    example, one can use console-based menu configuration by
    invoking the command
-->
    次に、カーネルの設定が必要になります。つまり、カーネルのオプションを設定し
    どのドライバーを含めるか、ビルトインにするか外部モジュールにするか、などを
    決めなければなりません。カーネルのビルド機構は多くのターゲットに対応してお
    り、異なる設定用フロントエンドを起動することができます。たとえばコンソール
    ベースのメニュー形式の設定画面は
    <example>
    $ make menuconfig
    </example>
    コマンドで起動できます。

<!--
    Instead of <tt>menuconfig</tt> one can use <tt>config</tt>
    (text-based line-by-line configuration frontend) or
    <tt>xconfig</tt> (graphical configuration frontend). It is
    also possible to reuse your old configuration file by
    placing it as a <tt>.config</tt> file in the top-level
    directory and running one of the configuration targets (if
    you want to adjust something) or <tt>make oldconfig</tt>
    (to keep the same configuration).
    Note that different frontends may require different
    additional libraries and utilities to be installed to
    function properly. For example, the <tt>menuconfig</tt>
    frontend requires the <tt>ncurses</tt> library, which at
    time of writing is provided by the <tt>libncurses5-dev</tt>
    package.
-->

    <tt>menuconfig</tt> のかわりに  <tt>config</tt> (テキストベースで 1 行毎に
    設定を行うフロントエンド) または <tt>xconfig</tt> (グラフィカルな設定フロン
    トエンド) なども利用できます。古い設定ファイルは <tt>.config</tt> ファイル
    としてトップディレクトリに配置し、設定するターゲットの起動コマンドを実行する
    か (なにかを設定し直す場合)、<tt>make oldconfig</tt> コマンドを実行する (設定
    を保持する場合) ことで再利用できます。フロントエンドによっては、正常に動作
    するためにライブラリやユーティリティをインストールする必要があるかもしれない
    ことに注意して下さい。例えば、<tt>menuconfig</tt>フロントエンドは執筆時点では
    <tt>libncurses5-dev</tt> パッケージとして提供されている <tt>ncurses</tt>
    ライブラリが必要です。
  </p>

<!--
    The build will use less disk space if the CONFIG_DEBUG_INFO
    option is disabled (see <ref id="common-size">).
    Debuginfo is only needed if you plan to use binary object
    tools like crash, kgdb, and SystemTap on the kernel.
-->

  <p>
    CONFIG_DEBUG_INFO オプションが無効化されている場合は (<ref id="common-size"> 参照)
    ビルドに必要な空きディスクスペースは少なく済みます。デバッグ情報は、crash、kgbd、
    SystemTap のようなカーネル上のバイナリオブジェクトツールを使わない場合は不要です。

    <example>
    $ scripts/config --disable DEBUG_INFO
    </example>
  </p>


  <p>
<!--
    After the configuration process is finished, the new or
    updated kernel configuration will be stored in
    <tt>.config</tt> file in the top-level directory. The build
    is started using the commands
    <example>
    $ make clean
    $ make deb-pkg
    </example>
    As a result of the build, a custom kernel package
    <tt>linux-image-3.2.19_3.2.19-1_i386.deb</tt> (name will
    reflect the version of the kernel and build number) will be
    created in the directory one level above the top of the
    tree. It may be installed using <tt>dpkg</tt> just as
    any other package:
    <example>
    # dpkg -i ../linux-image-3.2.19_3.2.19-1_i386.deb
    </example>
    This command will unpack the kernel, generate the initrd if
    necessary (see <ref id="initramfs"> for details), and configure
    the bootloader to make the newly installed kernel the
    default one. If this command completed without any problems,
    you can reboot using the
    <example>
    # shutdown -r now
    </example>
    command to boot the new kernel.
-->
    設定プロセスの終了後、変更または新規に作成されたカーネルの設定はトップレベル
    ディレクトリの <tt>.config</tt> ファイルとして保存されます。ビルドの開始には

    <example>
    $ make clean
    $ make deb-pkg
    </example>

    を使用します。 ビルドによって生成されたカスタムカーネルパッケージ
    <tt>linux-image-3.2.19_3.2.19-1_i386.deb</tt> (ファイル名にはカーネルのバージョン
    とビルド番号が反映されます) がツリーのトップレベルの 1 つ上の階層に生成されます。
    このファイルは他のパッケージと同様に、 <tt>dpkg</tt> コマンドでインストールできます。

    <example>
    # dpkg -i ../linux-image-3.2.19_3.2.19-1_i386.deb
    </example>

    このコマンドはカーネルを展開し、もし必要であれば initrd を生成し (詳細は
    <ref id="initramfs"> を参照) 新規でインストールしたカーネルがデフォルトとなるように
    ブートローダを設定します。このコマンドが問題無く完了したら

    <example>
    # shutdown -r now
    </example>

    コマンドで再起動すると新しいカーネルで起動します。
  </p>

<!--
    For much more information about
    bootloaders and their configuration please check their
    documentation, which can be accessed using the commands
    <tt>man lilo</tt>, <tt>man
    lilo.conf</tt>, <tt>man grub</tt>, and so on. You can also
    look for documentation in the
    <tt>/usr/share/doc/<em>package</em></tt> directories, with
    <tt><em>package</em></tt> being the name of the package
    involved.
-->

  <p>
    ブートローダとその設定方法に関しての詳細は <tt>man lilo</tt>、
    <tt>man lilo.conf</tt>、<tt>man grub</tt>、などのコマンドでそれぞれのドキュメントを
    参照してください。ドキュメントは <tt>/usr/share/doc/<em>package</em></tt>
    ディレクトリから探すこともできます。
    <tt><em>package</em></tt>には関連するパッケージ名を指定してください。
  </p>
</sect>

  <sect id="kernel-org-package">
    <!-- <heading>Building a custom kernel from the "pristine" kernel source</heading> -->
    <heading>"pristine" なカーネルソースからカスタムカーネルをビルドする</heading>


  <p>
<!--
    Building a kernel from the "pristine" (also sometimes called "vanilla")
    kernel source, distributed from <url id="http://www.kernel.org"; name="www.kernel.org">
    and its mirrors, may be occasionally useful for debugging or in the
    situations when a newer kernel version is desired. The procedure
    differs only in obtaining the kernel source: instead of unpacking
    the kernel source from Debian packages, the "pristine" source is
    downloaded using your favourite browser or using wget, as follows:
    <url id="http://www.kernel.org"; name="www.kernel.org"> とそのミラーで配布されている
    "pristine" (訳注: 原始の、汚されていない、の意) ("vanilla" と呼ばれることもあります)
    カーネルソースからビルドすることは、デバッグやより新しいバージョンのカーネルが必要な
    場面で役に立ちます。この手順では、カーネルのソースの取得方法のみが異なります。
    Debian パッケージを展開してカーネルソースを取得するかわりに、ブラウザや wget で
    "pristine" なソースを取得します。
-->
    <example>
    $ wget http://kernel.org/pub/linux/kernel/v3.x/linux-3.4.tar.bz2
    </example>

<!--
    The integrity of the downloaded archive may be verified by fetching
    the corresponding cryptographic signature
    <example>
    $ wget http://kernel.org/pub/linux/kernel/v3.x/linux-3.4.tar.bz2.sign
    </example>
    and running this command (<tt>gnupg</tt> package must be installed):
-->
    アーカイブの整合性はそれぞれの暗号化シグネチャを検証することで確認できます。
    <example>
    $ wget http://kernel.org/pub/linux/kernel/v3.x/linux-3.4.tar.bz2.sign
    </example>
    コマンドを実行し、次のコマンドを実行してください。
    (<tt>gnupg</tt> パッケージがインストールされていなければなりません)

    <example>
    $ wget http://kernel.org/pub/linux/kernel/v3.x/linux-3.4.tar.bz2.sign
    </example>
    <example>
    $ gpg --verify linux-3.4.tar.bz2.sign
    </example>

<!--
    Successful verification results in output similar to the one below:
-->

    検証に成功した場合、次に示すような出力を得ることができます。

    <example>
    gpg: Signature made Wed 29 Nov 2006 02:50:07 PM PST using DSA key ID 517D0F0E gpg: Good signature from "Linux Kernel Archives Verification Key &lt;ftpadmin@xxxxxxxxxx&gt;" gpg: WARNING: This key is not certified with a trusted signature!gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: C75D C40A 11D7 AF88 9981 ED5B C86B A06A 517D 0F0E
    </example>

<!--
    After that the archive may be unpacked using
-->
    検証が済んだら、アーカイブを展開しましょう。

    <example>
    $ tar xjf linux-3.4.tar.bz2 $ cd linux-3.4
    </example>

<!--
    The unpacked kernel tree (in <tt>linux-3.4</tt> now has to be configured.
    The existing configuration file may be used as a starting point
-->
    展開されたカーネルツリー (<tt>linux-3.4</tt> ディレクトリ) の設定をする準備が
    できました。手始めに、すでにある設定ファイルを使うと良いでしょう。

    <example>
    $ cp /boot/config-3.2.0-2-686-pae ./.config
    </example>

<!--
    After the configuration with one of the configuration frontends
    (invoked by <tt>make oldconfig</tt>, <tt>make config</tt>,
    <tt>make menuconfig</tt>, etc) is completed, the build may be started using
    <tt>make deb-pkg</tt> target as described above.
-->
    設定フロントエンドのどれかを使い (<tt>make oldconfig</tt>、<tt>make config</tt>、
    <tt>make menuconfig</tt>、などで起動します) 設定が完了したら、すでに説明した
    <tt>make deb-pkg</tt> ターゲットを使い、ビルドを開始できます。
  </p>
  </sect>

  <sect id="common-out-of-tree">
<!-- <heading>Building out-of-tree kernel modules</heading> -->
    <heading>ツリー外にあるカーネルモジュールをビルドする</heading>

<!--
    Some kernel modules are not included in the upstream or
    Debian kernel source, but are provided as third-party source
    packages. For some of the most popular out-of-tree modules,
    the binary Debian packages with modules built against the
    stock Debian kernels are provided. For example, if you are
    running stock Debian kernel <tt>3.2.0-2-686-pae</tt> (use the
    <tt>uname -r</tt> command to verify the version) from the
    <tt>linux-image-3.2.0-2-686-pae</tt> package, and would like to
    use the squash filesystem, all you need to do is install
    <tt>squashfs-modules-3.2.0-2-686-pae</tt> binary package, which
    provides the neccessary binary kernel modules.
-->
  <p>
    カーネルモジュールのなかには、アップストリームや Debian カーネルソースには含まれず
    に、サードパーティのソースパッケージとして提供されているものがあります。ツリー外の
    カーネルモジュールの中でも特に有名なものは、Debian カーネル用にビルドしたモジュール
    の、バイナリの Debian パッケージが提供されている場合があります。例えば
    <tt>linux-image-3.2.0-2-686-pae</tt> パッケージからインストールした、Debian カーネル
    <tt>3.2.0-2-686-pae</tt> を使っていて (<tt>uname -r</tt> コマンドでバージョンの確認
    ができます) squashファイルシステムを使いたくなった場合は、そのために必要なバイナリの
    カーネルモジュールを提供している <tt>squashfs-modules-3.2.0-2-686-pae</tt> パッケー
    ジをインストールするだけで利用可能になります。
  </p>

<!--
    If you are not so lucky, and there are no binary module
    packages in the archive, there is a fair chance that the
    Debian archive contains the packaged <strong>source</strong>
    for the kernel modules. Names of such packages typically end
    in <tt>-source</tt>, for example <tt>squashfs-source</tt>,
    <tt>thinkpad-source</tt>, <tt>rt2x00-source</tt> and many
    others. These packages contain debianized source code of the
    kernel modules, suitable for building using the
    <tt>module-assistant</tt> (or <tt>m-a</tt>) script from the
    <tt>module-assistant</tt> package.  Typical sequence to
    build a custom binary module package, matching a kernel
    <tt>3.2.0-2-686-pae</tt> (as returned by <tt>uname -r</tt>)
    from the debianized source consists of the following steps:
-->

  <p>
    残念ながら使いたいモジュールのバイナリパッケージがアーカイブにない場合でも、 カーネ
    ルモジュールの<strong>ソース</strong>パッケージが Debian アーカイブにある可能性もあ
    ります。パッケージ名の最後に <tt>-source</tt> とついているパッケージは、このような
    パッケージの典型例です。例えば <tt>squashfs-source</tt>、<tt>thinkpad-source</tt>、
    <tt>rt2x00-source</tt> などがありますが、他にも多数あります。これらのパッケージには、
    Debian 化したカーネルモジュールのソースコードが含まれています。
    ビルドには <tt>module-assistant</tt> パッケージの<tt>module-assistant</tt>
    (または <tt>m-a</tt>) スクリプトを使うと便利です。Debian 化したソースからカーネル
    <tt>3.2.0-2-686-pae</tt> (<tt>uname -r</tt>コマンドの返答値) 用のカスタムバイナリモジュールパッケージをビルドする場合の大まかな流れを説明します。
  </p>

<!--
    Install a set of kernel headers, matching the kernel for
    which the modules are going to be built:
    <example>
    # apt-get install linux-headers-3.2.0-2-686-pae
    </example>
    Install the package containing the source:
    <example>
    # apt-get install squashfs-source
    </example>
    Invoke <tt>module-assistant</tt> (aka <tt>m-a</tt>) to do
    the heavy lifting:
    <example>
    # m-a build squashfs
    </example>
    As a result, a Debian package is going to be built and placed
    in <tt>/usr/src</tt>. It can be installed the usual way, using
    <tt>dpkg -i</tt>. Two last steps (building and installation)
    may be combined using the invocation
    <example>
    # m-a auto-install squashfs
    </example>
    Check out the <tt>module-assistant</tt> documentation (<tt>man module-assistant</tt>)
    for other options and much more information on how to use it.
-->
  <p>
    まず、ビルドしたいモジュールに適切なカーネルヘッダをインストールします。

    <example>
    # apt-get install linux-headers-3.2.0-2-686-pae
    </example>

    ソースを含んでいるパッケージをインストールします。

    <example>
    # apt-get install squashfs-source
    </example>

    <tt>module-assistant</tt> (または <tt>m-a</tt>) を実行し、ビルドさせます。

    <example>
    # m-a build squashfs
    </example>

    Debian パッケージがビルドされ、<tt>/usr/src</tt> に配置されます。
    いつも通り <tt>dpkg -i</tt> でインストールすることもできます。
    最後の 2 つのステップ (ビルドとインストール) は、

    <example>
    # m-a auto-install squashfs
    </example>

    で 1 つにまとめることもできます。その他のオプションと使い方について、もっと
    詳しく知りたい場合は、<tt>module-assistant</tt> のドキュメント
    (<tt>man module-assistant</tt>) を参照してください。
  </p>

<!--
    Finally, in some rare circumstances, you might need to build the kernel modules
    from the upstream source packages. In that case, follow the documentation included
    with the package to build the modules. If the build process will
    require you to specify the directory with the kernel headers,
    matching the currently running kernel, for stock Debian kernels this directory is
    <tt>/usr/src/linux-headers-<em>uname</em></tt>, provided by the
    <tt>linux-headers-<em>uname</em></tt> package. Here <tt><em>uname</em></tt> is the
    output of the <tt>uname -r</tt> command. If you are building and running your own
    custom kernels, it is a good idea to keep the original build tree around, as it
    also can be used for out-of-tree module building.
-->
  <p>
    とても稀なケースではありますが、カーネルモジュールのパッケージをアップストリーム
    のソースからビルドする必要があるかもしれません。その場合、モジュールをビルドする
    ためのパッケージに付属しているドキュメントの指示に従って下さい。もしビルドプロセ
    スの途中で現在使用中のカーネルに合わせたカーネルヘッダを含むディレクトリを指定し
    なければならない場合、Debian の 素のカーネルのディレクトリは
    <tt>/usr/src/linux-headers-<em>uname</em></tt> で、
    <tt>linux-headers-<em>uname</em></tt> パッケージによって提供されます。
    ここでの <tt><em>uname</em></tt> は <tt>uname -r</tt> コマンドの出力結果です。
    もし独自でカスタマイズしたカーネルを使っている場合は、オリジナルのビルドツリーを
    手元に置いておくと良いでしょう。ビルドツリー外にあるモジュールをビルドする際にも
    役立ちます。
  </p>
</sect>
</chapt>

Attachment: signature.asc
Description: Digital signature