八津尾です。
Debian kernel-handbook 8 章の翻訳です。
査読をお願いします。
titanpad は http://yyatsuo.titanpad.com/8 です。
以上、よろしくお願いします。
<chapt id="update-hooks">
<!-- Package maintainer scripts and hooks -->
<heading>メンテナスクリプトとフック</heading>
<!--
Kernel packages for Debian have historically had complex
maintainer scripts which can invoke the initramfs builder and/or a
boot loader, based on a mixture of file tests, explicit
configuration through the file <tt>/etc/kernel-img.conf</tt> and
debconf questions. Starting with Debian 6.0, this has been greatly
simplified.
-->
<p>
Debian のカーネルパッケージは複雑なメンテナスクリプトを歴史的に引き
継いでいます。このスクリプは、ファイルテストと、<tt>/etc/kernel-img.
conf</tt>ファイルと debconf の質問による明示的な設定の複合に基いて、
initramfs ビルダーおよび/またはブートローダを起動します。Debian 6.0
以降、これは大幅に簡略化されています。
</p>
<!--
The following policy applies to Debian GNU/Linux 6.0 'squeeze' and
later releases. Some parts may be applicable to kernels other
than Linux, but this policy does not set any requirements for
them.
-->
<p>
以下のポリシーは GNU/Linux 6.0 'squeeze' と、それ以降のリリースに関し
適用されます。これらのなかには、 Linux 以外のカーネルに対して適用可能
なものもありますが、このポリシーにはそれらのための要件を設定していませ
ん。
</p>
<sect id="kernel-hooks">
<!-- Kernel hooks -->
<heading>Kernel フック</heading>
<!--
The maintainer scripts in Linux kernel packages must use
<tt>run-parts</tt> to invoke hook scripts in the corresponding
subdirectory of <tt>/etc/kernel</tt>, e.g. the <tt>postinst</tt>
script must invoke scripts in <tt>/etc/kernel/postinst.d</tt>.
-->
<p>
Linux カーネルパッケージ内のメンテナスクリプトは、 <tt>/etc/kernel
</tt> の対応したサブディレクトリに配置されたフックスクリプトを起動
する際に <tt>run-parts</tt> を使用しなければなりません。例えば、
<tt>postinst</tt> スクリプトは <tt>/etc/kernel/postinst.d</tt> 内の
スクリプトを起動します。
</p>
<!--
The arguments given to all kernel hook scripts are the kernel
ABI version (the string that <tt>uname -r</tt> reports) and,
optionally, the absolute path to the kernel image. If the
second argument is missing then the path is
either <tt>/boot/vmlinuz-<em>version</em></tt> or
<tt>/boot/vmlinux-<em>version</em></tt>, according to
architecture convention. The environment variable
<tt>DEB_MAINT_PARAMS</tt> will contain the arguments given to
the kernel maintainer script, possibly single-quoted. In a
shell script, this variable can be parsed using:
-->
<p>
全てのカーネルフックスクリプトには、カーネルの ABI バージョン
(<tt>uname -r</tt> コマンドが応答する文字列) と、 必要であれば、
カーネルイメージへの絶対パスを引数として渡します。2 つ目の引数
が無い場合アーキテクチャの慣例に従い、パスは<tt>/boot/vmlinuz-
<em>version</em></tt> か <tt>/boot/vmlinux-<em>version</em></tt>
になります。カーネルのメンテナスクリプトに与えられる引数は、環境
変数 <tt>DEB_MAINT_PARAMS</tt> に格納されます。これは、単一引用
符で囲まれている場合があります。シェルスクリプト内では、この変数
は次のようにパースできます:
<example> eval set -- "$DEB_MAINT_PARAMS" </example>
</p>
<!--
Kernel hook scripts may be run under debconf. In this case
they must not use stdin and stdout, and should send all output
to stderr (fd 2). A shell script can ensure that it does this
using:
-->
<p>
カーネルフックスクリプトは debconf の下で実行することもできま
す。その場合、stdin と stdout は使用せず、全て stderr (fd 2)
に出力しなければなりません。シェルスクリプトで確実にそうするに
は、次のように書きます:
<example> exec </dev/null >&2 </example>
</p>
</sect>
<sect id="kernel-hooks-loader">
<!-- Kernel hooks required for boot loaders -->
<heading>ブートローダに必要なカーネルフック</heading>
<!--
Packages for boot loaders that need to be updated whenever the
files they load are modified (i.e. those that store a block
list) must install hook scripts in
<tt>/etc/kernel/postinst.d</tt> and
<tt>/etc/kernel/postrm.d</tt>.
-->
<p>
ブートローダがロードするファイルが変更された場合、必ず更新しなけ
ればならないブートローダ用のパッケージ (ブロックリストを保存して
いるものなど) は <tt>/etc/kernel/postinst.d</tt> と <tt>/etc/ker
nel/postrm.d</tt> にフックスクリプトをインストールしなければなり
ません。
</p>
<!--
Since these boot loaders should be updated as the last step
during installation/upgrade and removal, hook scripts for boot
loaders must be named using the prefix <tt>zz-</tt> and no other
packages may use this prefix or one that sorts later by the
rules used by <tt>run-parts</tt>. A postrm hook script should
warn but exit with code 0 if the boot loader configuration file
still refers to the kernel image that has been removed.
-->
<p>
これらのブートローダはインストール/アップグレード/削除の最終段階
で更新されるべきものです。したがって、ブートローダのフックスクリ
プトに <tt>zz-</tt> のプレフィックスを持たせて他のパッケージはこ
のプレフィックスを使わないようにするか、後で<tt>run-parts</tt> で
使用されるルールを使用して並び替えなければなりません。ブートロー
ダの設定ファイルが、削除されたカーネルイメージを参照している場合、
postrm フックスクリプトは警告すべきですが、終了コードは 0 を返さ
なければなりません。
</p>
<!--
These boot loader packages must be installable on the filesystem
in a disabled state where they will not write to the boot sector
or other special storage. While a boot loader is disabled, any
kernel hooks it includes must do nothing except (optionally)
printing a warning that the boot loader is disabled, and must
exit successfully.
-->
<p>
これらのブートローダパッケージは、ブートセクタや特殊なストレージ
に書き込まないように、無効化された状態でファイルシステムにインス
トール可能でなければなりません。ブートローダが無効になっている間、
カーネルフックは (任意で) ブートローダが無効になっているという警
告を出力する以外は何もせず、成功裏に終了しなければなりません。
</p>
<!--
Packages for boot loaders that can provide a menu of kernel
versions should install kernel hook scripts in order to update
that menu.
-->
<p>
カーネルバージョンのメニューを提供することができるブートローダ用
のパッケージは、メニューを更新するためにカーネルフックスクリプト
をインストールするべきです。
</p>
</sect>
<sect id="initramfs-hooks">
<!-- Initramfs hooks -->
<heading>Initramfs フック</heading>
<!--
Packages for boot loaders that need to be updated whenever the
files they load are modified must also install hook scripts in
<tt>/etc/initramfs/post-update.d</tt>. Initramfs builders
must call these scripts using <tt>run-parts</tt> after they
create, update or delete an initramfs. The arguments given to
these hook scripts are the kernel ABI version and the absolute
path to the initramfs image.
-->
<p>
ブートローダがロードするファイルが変更された場合、必ず更新しなけ
ればならないブートローダ用のパッケージは、<tt>/etc/initramfs/pos
t-update.d</tt> にフックスクリプトをインストールしなければなりま
せん。initramfs ビルダーは initramfs を作成、更新、または削除した
後にこのスクリプトを <tt>run-parts</tt> から呼び出します。これら
のフックスクリプトに与えられる引数は、カーネルの ABI バージョン
と、initramfs イメージへの絶対パスです。
</p>
<!--
While a boot loader is disabled, any initramfs hook it includes
must do nothing except (optionally) printing a warning that the
boot loader is disabled, and must exit successfully.
-->
<p>
ブートローダが無効になっている間、initramfs フックは (任意で) ブ
ートローダが無効になっているという警告を出力する以外は何もせず、
成功裏に終了しなければなりません。
</p>
</sect>
<sect id="kernel-hooks-initramfs">
<!-- Kernel hooks required for initramfs builders -->
<heading>Kernel フックに依存する initramfs ビルダー</heading>
<!--
Initramfs builders must install hook scripts in
<tt>/etc/kernel/postinst.d</tt> and
<tt>/etc/kernel/postrm.d</tt>, to create/update and delete the
corresponding initramfs images. The postinst hook script must
complete its work before returning.
-->
<p>
Initramfs ビルダーは、対応する initramfs イメージを作成/更新/削
除するために、<tt>/etc/kernel/postinst.d</tt> と <tt>/etc/kernel
/postrm.d</tt> にフックスクリプトをインストールしなければなりま
せん。postinst フックスクリプトは return する前にその処理を終え
ている必要があります。
</p>
</sect>
<sect id="loader-optimisation">
<!-- Optimising boot loader updates -->
<heading>ブートローダの更新を最適化する</heading>
<!--
During a kernel package installation, upgrade or removal, various
boot loader hooks may be invoked (in this order):
<enumlist>
<item>
A <tt>postinst_hook</tt> or <tt>postrm_hook</tt> command
set by the user or the installer in
<tt>/etc/kernel-img.conf</tt>
</item>
<item>
A hook script in <tt>/etc/initramfs/post-update.d</tt>
</item>
<item>
A hook script in <tt>/etc/kernel/postinst.d</tt> or
...<tt>/postrm.d</tt>
</item>
</enumlist>
-->
<p>
カーネルパッケージのインストール、更新、または削除中に、様々なブ
ートローダ hook が (次の順で) 起動します:
<enumlist>
<item>
<tt>postinst_hook</tt> または <tt>postrm_hook</tt> ユーザかイ
ンストーラによる <tt>/etc/kernel-img.conf</tt> 内のコマンドセ
ット
</item>
<item>
<tt>/etc/initramfs/post-update.d</tt>内のフックスクリプト
</item>
<item>
<tt>/etc/kernel/postinst.d</tt> または <tt>/postrm.d</tt> 内の
フックスクリプト
</item>
</enumlist>
</p>
<!--
To avoid unnecessary updates, the hooks invoked at steps 1 and
2 may check whether <tt>$DPKG_MAINTSCRIPT_PACKAGE</tt> begins
with <tt>linux-image-</tt> and do nothing in this case.
-->
<p>
不要な更新を避けるには、ステップ 1 と ステップ 2 で呼び出される
フックは、<tt>$DPKG_MAINTSCRIPT_PACKAGE</tt> が <tt>linux-image-
</tt> で始まるかどうかをチェックし、その場合は何もしないようにす
ると良いでしょう。
</p>
</sect>
<sect id="deprecation">
<!-- Deprecated features -->
<heading>非推奨の機能</heading>
<!--
Kernel packages must not invoke boot loaders except via hooks.
If <tt>/etc/kernel-img.conf</tt> contains <tt>do_bootloader yes</tt> or equivalent, maintainer scripts that previously
acted on this must warn that they are ignoring
it. <tt>linux-base</tt> must also warn on upgrade that the
default has changed. In Debian 7.0 'wheezy', this prohibition
extends to initramfs builder packages.
-->
<p>
カーネルパッケージはフックを経由する以外の方法でブートローダを起
動してはいけません。<tt>/etc/kernel-img.conf</tt> に <tt>do_boot
loader = yes</tt>または同等のオプションが設定されている場合、以前
これに作用したメンテナスクリプトはこのオプションを無視することを
警告しなければなりません。<tt>linux-base</tt> もまた、アップデー
ト時にデフォルトが変更されたことを警告しなければなりません。Debi
an 7.0 'wheezy' では、この禁止条件は initramfs ビルダーパッケージ
にも拡張されます。
</p>
</sect>
<sect id="init-config">
<!-- Initial configuration by the installer -->
<heading>インストーラによる初期設定</heading>
<!--
The installer must not define <tt>do_bootloader</tt>,
<tt>postinst_hook</tt> or <tt>postrm_hook</tt> in
<tt>/etc/kernel-img.conf</tt>.
-->
<p>
インストーラは <tt>/etc/kernel-img.conf</tt> 内の<tt>do_bootload
er</tt>、<tt>postinst_hook</tt> または <tt>postrm_hook</tt> オプ
ションを設定してはいけません。
</p>
</sect>
</chapt>
Attachment:
signature.asc
Description: Digital signature