kconfig-language.txt(for linux-2.6.23.8) (日本語訳、英語同時掲載版) 訳注: 超意訳。間違っていても知りません。 間違いのご指摘は歓迎いたします。 訳文の更新履歴 -------------- 11/20/2007 すずきかつひろ Introduction ------------ はじめに -------- The configuration database is a collection of configuration options organized in a tree structure: カーネルの設定データベースは以下のようなツリーで構成されるコンフィグ オプションの集まりです。 +- Code maturity level options | +- Prompt for development and/or incomplete code/drivers +- General setup | +- Networking support | +- System V IPC | +- BSD Process Accounting | +- Sysctl support +- Loadable module support | +- Enable loadable module support | +- Set version information on all module symbols | +- Kernel module loader +- ... Every entry has its own dependencies. These dependencies are used to determine the visibility of an entry. Any child entry is only visible if its parent entry is also visible. 各項目は依存性を持っています。項目を表示するときにこれらの依存性を 利用します。子項目は親項目が見えていないと見えません。 Menu entries ------------ メニュー項目 ------------ Most entries define a config option, all other entries help to organize them. A single configuration option is defined like this: ほとんどの項目はコンフィグオプションの定義で、他の項目は項目をまとめるために あります。 単一のコンフィグオプションは以下のように定義できます: config MODVERSIONS bool "Set version information on all module symbols" depends on MODULES help Usually, modules have to be recompiled whenever you switch to a new kernel. ... Every line starts with a key word and can be followed by multiple arguments. "config" starts a new config entry. The following lines define attributes for this config option. Attributes can be the type of the config option, input prompt, dependencies, help text and default values. A config option can be defined multiple times with the same name, but every definition can have only a single input prompt and the type must not conflict. どの行もキーワードから始まって、その後に複数の引数が続きます。 キーワード "config" は新たなコンフィグの項目を意味します。それに続く行はこの コンフィグオプションの属性を定義しています。属性はそれぞれ、コンフィグの型 と見出し(訳注: 2行目)、依存する項目(訳注: 3行目)、ヘルプに表示される文 (訳注: 4行目以降)と、デフォルトの値(訳注: 例には載って無い)です。 コンフィグオプションは同じ名前で何回でも定義できますが、一つの項目にされます。 そのとき型が異なってはいけません。 Menu attributes --------------- メニューの属性 -------------- A menu entry can have a number of attributes. Not all of them are applicable everywhere (see syntax). メニューの項目はいくつもの属性を持っていますが、どこでも全ての属性を使える わけではありません(構文の章を見てね)。 - type definition: "bool"/"tristate"/"string"/"hex"/"int" Every config option must have a type. There are only two basic types: tristate and string, the other types are based on these two. The type definition optionally accepts an input prompt, so these two examples are equivalent: - 型の定義: "bool"/"tristate"/"string"/"hex"/"int" どのコンフィグオプションも必ず型を決めなければなりません。基本的には "tristate" と "string" の二つの型です。他の型はこれら二つを基礎にしています。 型の定義では見出しの設定も受け付けます。 以下の二つの例は等価です: bool "Networking support" and bool prompt "Networking support" - input prompt: "prompt" ["if" ] Every menu entry can have at most one prompt, which is used to display to the user. Optionally dependencies only for this prompt can be added with "if". - 見出し: "prompt" ["if" ] メニュー項目にはユーザに対して表示する見出しを一つだけ設定できます。もし この見出しだけに対する依存関係がある場合は、"if" とともに条件を指定して ください。 - default value: "default" ["if" ] A config option can have any number of default values. If multiple default values are visible, only the first defined one is active. Default values are not limited to the menu entry where they are defined. This means the default can be defined somewhere else or be overridden by an earlier definition. The default value is only assigned to the config symbol if no other value was set by the user (via the input prompt above). If an input prompt is visible the default value is presented to the user and can be overridden by him. Optionally, dependencies only for this default value can be added with "if". - デフォルト値: "default" ["if" ] コンフィグオプションにはいくつものデフォルト値を設定できます。二つめ以降の デフォルト値が表示されるためには、最初のデフォルト値がアクティブでないとなり ません。デフォルト値はメニュー項目を定義した場所にしか書けないというわけでは ありません。別の場所に書いたり、事前に定義した値を上書きしたり出来ます。 デフォルト値はユーザが何も値を設定しなかった(上記の "input prompt" で) ときに、コンフィグオプションに割り当てられます。もし見出しが見えていれば、 ユーザに対してデフォルト値が表示され、ユーザは値を上書きできます。 もしこのデフォルト値だけに対する依存関係がある場合は、"if" とともに条件を指定 してください。 - dependencies: "depends on"/"requires" This defines a dependency for this menu entry. If multiple dependencies are defined, they are connected with '&&'. Dependencies are applied to all other options within this menu entry (which also accept an "if" expression), so these two examples are equivalent: - 依存関係: "depends on"/"requires" これはメニュー項目の依存関係を定義します。もし複数の依存関係を定義したいなら、 '&&' で繋げてください。依存関係はメニュー項目の属性全て("if" も含め)に適用 されます。 そのため以下の二つは等価です: bool "foo" if BAR default y if BAR and depends on BAR bool "foo" default y - reverse dependencies: "select" ["if" ] While normal dependencies reduce the upper limit of a symbol (see below), reverse dependencies can be used to force a lower limit of another symbol. The value of the current menu symbol is used as the minimal value can be set to. If is selected multiple times, the limit is set to the largest selection. Reverse dependencies can only be used with boolean or tristate symbols. - 逆依存関係: "select" ["if" ] 通常の依存関係がシンボルの上限を決める(以下を見てね)とするなら、 逆依存関係は他のシンボルの下限を決めるのに使えます。現在のメニュー項目から 他のシンボルに対して最小値 を設定できます。もし が複数選 ばれたら、その中でもっとも大きな値を最小値に選びます。 逆依存関係は "boolean" か "tristate" のシンボルにしか使えません。 Note: select is evil.... select will by brute force set a symbol equal to 'y' without visiting the dependencies. So abusing select you are able to select a symbol FOO even if FOO depends on BAR that is not set. In general use select only for non-visible symbols (no promts anywhere) and for symbols with no dependencies. That will limit the usefulness but on the other hand avoid the illegal configurations all over. kconfig should one day warn about such things. 注意: "select" は危険です。"select" は依存関係を検査しないで強制的に他のシン ボルを 'y' にしてしまうでしょう。だから "select" を使うと FOO が依存し ている BAR が有効でないにも関わらず、FOO を有効にしてしまう、という悪用 ができてしまいます。通常の利用では "select" は見えないシンボル(見出し がどこにもない)に使うか、依存関係のないシンボルに使います。これは利便 性がなくなりますが、一方でおかしなコンフィグが設定されるのを回避できま す。kconfig はいつかそのことを警告すべきです。 - numerical ranges: "range" ["if" ] This allows to limit the range of possible input values for int and hex symbols. The user can only input a value which is larger than or equal to the first symbol and smaller than or equal to the second symbol. - 数値の範囲: "range" ["if" ] これは "int" あるいは "hex" で入力される数値の範囲を制限できます。一つめの 数値より大きいあるいは等しい値から、二つめの数値と等しい値までの数字だけを ユーザから受け取ります。 - help text: "help" or "---help---" This defines a help text. The end of the help text is determined by the indentation level, this means it ends at the first line which has a smaller indentation than the first line of the help text. "---help---" and "help" do not differ in behaviour, "---help---" is used to help visually separate configuration logic from help within the file as an aid to developers. - ヘルプの文章: "help" or "---help---" これはヘルプの文章を定義します。ヘルプの文章の終わりはインデントのレベルで 決まります。つまり最初の行より少ないインデントの行で終わるということです。 "help" も "---help---" も動作になんら違いはありません。"---help---" を使うと 設定ファイルのロジックを視覚的に区切る事ができて、設定ファイルを書き直そうと する開発者の手助けになります。 Menu dependencies ----------------- メニューの依存関係 ------------------ Dependencies define the visibility of a menu entry and can also reduce the input range of tristate symbols. The tristate logic used in the expressions uses one more state than normal boolean logic to express the module state. Dependency expressions have the following syntax: 依存関係はメニュー項目の表示/非表示と、"tristate" のシンボルの入力範囲を限定 します。"tristate" は普通の "boolean" に加えてさらにモジュール状態を表すため に使います。 依存関係は以下の構文で表されます: ::= (1) '=' (2) '!=' (3) '(' ')' (4) '!' (5) '&&' (6) '||' (7) Expressions are listed in decreasing order of precedence. 式は以下の優先順位(優先度が高い順)に並べます (1) Convert the symbol into an expression. Boolean and tristate symbols are simply converted into the respective expression values. All other symbol types result in 'n'. (2) If the values of both symbols are equal, it returns 'y', otherwise 'n'. (3) If the values of both symbols are equal, it returns 'n', otherwise 'y'. (4) Returns the value of the expression. Used to override precedence. (5) Returns the result of (2-/expr/). (6) Returns the result of min(/expr/, /expr/). (7) Returns the result of max(/expr/, /expr/). (1) シンボルを式に変換します。"boolean" と "tristate" シンボルは単純にそれぞれ の持つ値に変換されます。他の型のシンボルであれば結果は 'n' になります。 (2) もし二つのシンボルの値が等しければ 'y' を、そうでなければ 'n' を返します。 (3) もし二つのシンボルの値が等しければ 'n' を、そうでなければ 'y' を返します。 (4) 式の値を返します。式の優先度を変えるために使います。 (5) 2 - (式の値) を返します。 (6) 二つの式の最小値を返します。 (7) 二つの式の最大値を返します。 An expression can have a value of 'n', 'm' or 'y' (or 0, 1, 2 respectively for calculations). A menu entry becomes visible when it's expression evaluates to 'm' or 'y'. 式は値 'n', 'm', 'y' を取ります(計算するときはそれぞれ 0, 1, 2 です)。 メニュー項目は式の評価値が 'm' または 'y' のときに表示されます。 There are two types of symbols: constant and nonconstant symbols. Nonconstant symbols are the most common ones and are defined with the 'config' statement. Nonconstant symbols consist entirely of alphanumeric characters or underscores. Constant symbols are only part of expressions. Constant symbols are always surrounded by single or double quotes. Within the quote, any other character is allowed and the quotes can be escaped using '\'. シンボルの型は二つあります: 定数シンボルと非定数シンボルです。非定数シンボル は一般的なシンボルで、"config" 行で定義します。非定数シンボルはアルファベット か数字か下線(underscore)から成ります。 定数シンボルは式の一部にしか使えません。定数シンボルは常にシングルクォート あるいはダブルクォートに囲まれています。クォートの内側では他のどんな記号でも 使えますし、クォートも '\' を使ってエスケープすれば使えます。 Menu structure -------------- メニューの構造 -------------- The position of a menu entry in the tree is determined in two ways. First it can be specified explicitly: ツリー内でのメニュー項目の位置を決めるには二つの方法があります。 一つは以下のように明確に指定します: menu "Network device support" depends on NET config NETDEVICES ... endmenu All entries within the "menu" ... "endmenu" block become a submenu of "Network device support". All subentries inherit the dependencies from the menu entry, e.g. this means the dependency "NET" is added to the dependency list of the config option NETDEVICES. "menu" と "endmenu" ブロック内の全ての項目は "Network device support" の サブメニューとなります。"menu" の依存性は全てのサブメニューに引き継がれま す。 この例なら、依存関係 "NET" がコンフィグオプション NETDEVICES の依存関係 リストに追加されるわけです。 The other way to generate the menu structure is done by analyzing the dependencies. If a menu entry somehow depends on the previous entry, it can be made a submenu of it. First, the previous (parent) symbol must be part of the dependency list and then one of these two conditions must be true: - the child entry must become invisible, if the parent is set to 'n' - the child entry must only be visible, if the parent is visible 他の方法というのは、依存関係を解析してメニューの構造を生成する方法です。 あるメニュー項目とそれ以前のメニュー項目になんらかの依存関係があるなら、 そのメニュー項目はサブメニューにします。はじめに以前のシンボル(親となる シンボル)が依存関係リストに出てこなければならず、以下の二条件の内一つが 必ず成り立ちます。 - 親となる項目が 'n' なら、子となる項目は非表示です - 親となる項目が表示されているなら、子となる項目も表示されています。 config MODULES bool "Enable loadable module support" config MODVERSIONS bool "Set version information on all module symbols" depends on MODULES comment "module support disabled" depends on !MODULES MODVERSIONS directly depends on MODULES, this means it's only visible if MODULES is different from 'n'. The comment on the other hand is always visible when MODULES is visible (the (empty) dependency of MODULES is also part of the comment dependencies). MODVERSIONS は直に MODULES に依存しています。これは MODULES が 'n' 以外なら MODVERSIONS が表示されることを示しています。一方でコメント "module support disabled" は、MODULE が表示されていても表示されます。MODULES の空の依存関係 もコメントの依存関係の一部であるからです。 (訳注: 英語の意味が意味がよくわかりません。実際に試すと、MODULES が 'y' か 'm' のとき comment は消えます。) Kconfig syntax -------------- Kconfig の構文 -------------- The configuration file describes a series of menu entries, where every line starts with a keyword (except help texts). The following keywords end a menu entry: - config - menuconfig - choice/endchoice - comment - menu/endmenu - if/endif - source The first five also start the definition of a menu entry. 設定ファイルには一連のメニュー項目(ヘルプの文章を除いてどの行もキーワードで 始まる)を記述しています。 以下のキーワードがメニュー項目を終わらせます: - config - menuconfig - choice/endchoice - comment - menu/endmenu - if/endif - source 上から五個まではメニュー項目の定義です。 config: "config" This defines a config symbol and accepts any of above attributes as options. "config" はシンボル を定義します。その後に属性を続けて書く事もでき ます。 menuconfig: "menuconfig" This is similar to the simple config entry above, but it also gives a hint to front ends, that all suboptions should be displayed as a separate list of options. これは単純な "config" 項目と似ていますが、フロントエンドにヒントを与えていま す。この項目のサブ項目は全てバラバラのオプションとして表示すべきです。 choices: "choice" "endchoice" This defines a choice group and accepts any of the above attributes as options. A choice can only be of type bool or tristate, while a boolean choice only allows a single config entry to be selected, a tristate choice also allows any number of config entries to be set to 'm'. This can be used if multiple drivers for a single hardware exists and only a single driver can be compiled/loaded into the kernel, but all drivers can be compiled as modules. A choice accepts another option "optional", which allows to set the choice to 'n' and no entry needs to be selected. "choice" はグループの選択を定義します。この後に属性を続けて書くことも出来ます。 "choice" は "bool" か "tristate" 型でなければなりません。"bool" 型ならば、 一つのコンフィグ項目だけを選択でき、"tristate" 型ならばいくつでもコンフィグ項目 を 'm' にできます。これは一つのハードウェアに対して複数のドライバがあって、その うちの一つしかコンパイルできない(あるいは一つしかカーネルにロードできない)です が、全てのドライバをモジュールとしてコンパイルすることができる、というときに使い ます。 "choice" はオプション "optional" が使えます。このオプションを使うと、項目を一つも 選択しなくても良い "choice" が作れます。 comment: "comment" This defines a comment which is displayed to the user during the configuration process and is also echoed to the output files. The only possible options are dependencies. "comment" はユーザが設定しているの間、ユーザに対して表示するコメントを定義し ます。コメントは出力ファイルにも書かれます。 "comment" で使えるオプションは依存関係だけです。 menu: "menu" "endmenu" This defines a menu block, see "Menu structure" above for more information. The only possible options are dependencies. "menu" はメニューのブロックを定義します。詳しくは上にある「メニューの構造」を 見てね。使えるオプションは依存関係だけです。 if: "if" "endif" This defines an if block. The dependency expression is appended to all enclosed menu entries. "if" ブロックを定義します。ブロック内のメニュー項目に対して式 である 依存関係を加えます。 source: "source" This reads the specified configuration file. This file is always parsed. 指定した設定ファイルを読みます。このファイルは常にパースされます。