[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[d781ffb] | 7 |
|
---|
[7d096f3] | 8 | <sect1 id="ch-scripts-console">
|
---|
[d781ffb] | 9 | <?dbhtml filename="console.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Configuring the Linux Console</title>
|
---|
| 12 |
|
---|
| 13 | <indexterm zone="ch-scripts-console">
|
---|
| 14 | <primary sortas="d-console">console</primary>
|
---|
| 15 | <secondary>configuring</secondary>
|
---|
| 16 | </indexterm>
|
---|
| 17 |
|
---|
[69283af] | 18 | <indexterm zone="ch-scripts-console">
|
---|
| 19 | <primary sortas="d-consolelog">consolelog</primary>
|
---|
| 20 | <secondary>configuring</secondary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
[d781ffb] | 23 | <para>This section discusses how to configure the <command>console</command>
|
---|
[479f92f] | 24 | and <command>consolelog</command> bootscripts that set up the keyboard map,
|
---|
| 25 | console font and console kernel log level. If non-ASCII characters (e.g.,
|
---|
| 26 | the copyright sign, the British pound sign and Euro symbol) will not be used
|
---|
| 27 | and the keyboard is a U.S. one, much of this section can be skipped. Without
|
---|
[fa21b3d] | 28 | the configuration file, the <command>console</command> bootscript will do
|
---|
| 29 | nothing.</para>
|
---|
[d781ffb] | 30 |
|
---|
[479f92f] | 31 | <para>The <command>console</command> and <command>consolelog</command>
|
---|
| 32 | script reads the <filename>/etc/sysconfig/console</filename> file for
|
---|
| 33 | configuration information.
|
---|
[d781ffb] | 34 | Decide which keymap and screen font will be used. Various language-specific
|
---|
[fa21b3d] | 35 | HOWTOs can also help with this, see <ulink
|
---|
| 36 | url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in
|
---|
[9a07261] | 37 | doubt, look in the <filename class="directory">/lib/kbd</filename>
|
---|
[fa21b3d] | 38 | directory for valid keymaps and screen fonts. Read
|
---|
| 39 | <filename>loadkeys(1)</filename> and <filename>setfont(8)</filename> manual
|
---|
| 40 | pages to determine the correct arguments for these programs.</para>
|
---|
| 41 |
|
---|
| 42 | <para>The <filename>/etc/sysconfig/console</filename> file should contain lines
|
---|
| 43 | of the form: VARIABLE="value". The following variables are recognized:</para>
|
---|
| 44 |
|
---|
| 45 | <variablelist>
|
---|
| 46 |
|
---|
[479f92f] | 47 | <varlistentry>
|
---|
| 48 | <term>LOGLEVEL</term>
|
---|
| 49 | <listitem>
|
---|
| 50 | <para>This variable specifies the log level for kernel messages sent
|
---|
| 51 | to the console as set by <command>dmesg</command>. Valid levels are
|
---|
| 52 | from "1" (no messages) to "8". The default level is "7".</para>
|
---|
| 53 | </listitem>
|
---|
| 54 | </varlistentry>
|
---|
| 55 |
|
---|
[fa21b3d] | 56 | <varlistentry>
|
---|
| 57 | <term>KEYMAP</term>
|
---|
| 58 | <listitem>
|
---|
| 59 | <para>This variable specifies the arguments for the
|
---|
| 60 | <command>loadkeys</command> program, typically, the name of keymap
|
---|
| 61 | to load, e.g., <quote>es</quote>. If this variable is not set, the
|
---|
| 62 | bootscript will not run the <command>loadkeys</command> program,
|
---|
| 63 | and the default kernel keymap will be used.</para>
|
---|
| 64 | </listitem>
|
---|
| 65 | </varlistentry>
|
---|
| 66 |
|
---|
| 67 | <varlistentry>
|
---|
| 68 | <term>KEYMAP_CORRECTIONS</term>
|
---|
| 69 | <listitem>
|
---|
| 70 | <para>This (rarely used) variable
|
---|
| 71 | specifies the arguments for the second call to the
|
---|
| 72 | <command>loadkeys</command> program. This is useful if the stock keymap
|
---|
| 73 | is not completely satisfactory and a small adjustment has to be made. E.g.,
|
---|
| 74 | to include the Euro sign into a keymap that normally doesn't have it,
|
---|
| 75 | set this variable to <quote>euro2</quote>.</para>
|
---|
| 76 | </listitem>
|
---|
| 77 | </varlistentry>
|
---|
| 78 |
|
---|
| 79 | <varlistentry>
|
---|
| 80 | <term>FONT</term>
|
---|
| 81 | <listitem>
|
---|
| 82 | <para>This variable specifies the arguments for the
|
---|
| 83 | <command>setfont</command> program. Typically, this includes the font
|
---|
| 84 | name, <quote>-m</quote>, and the name of the application character
|
---|
| 85 | map to load. E.g., in order to load the <quote>lat1-16</quote> font
|
---|
| 86 | together with the <quote>8859-1</quote> application character map
|
---|
| 87 | (as it is appropriate in the USA), <!-- because of the copyright sign -->
|
---|
| 88 | set this variable to <quote>lat1-16 -m 8859-1</quote>.
|
---|
| 89 | If this variable is not set, the bootscript will not run the
|
---|
| 90 | <command>setfont</command> program, and the default VGA font will be
|
---|
| 91 | used together with the default application character map.</para>
|
---|
| 92 | </listitem>
|
---|
| 93 | </varlistentry>
|
---|
| 94 |
|
---|
| 95 | <varlistentry>
|
---|
| 96 | <term>UNICODE</term>
|
---|
| 97 | <listitem>
|
---|
| 98 | <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or
|
---|
| 99 | <quote>true</quote> in order to put the
|
---|
| 100 | console into UTF-8 mode. This is useful in UTF-8 based locales and
|
---|
| 101 | harmful otherwise.</para>
|
---|
| 102 | </listitem>
|
---|
| 103 | </varlistentry>
|
---|
| 104 |
|
---|
| 105 | <varlistentry>
|
---|
| 106 | <term>LEGACY_CHARSET</term>
|
---|
| 107 | <listitem>
|
---|
| 108 | <para>For many keyboard layouts, there is no stock Unicode keymap in
|
---|
| 109 | the Kbd package. The <command>console</command> bootscript will
|
---|
| 110 | convert an available keymap to UTF-8 on the fly if this variable is
|
---|
[49451499] | 111 | set to the encoding of the available non-UTF-8 keymap.</para>
|
---|
[fa21b3d] | 112 | </listitem>
|
---|
| 113 | </varlistentry>
|
---|
| 114 |
|
---|
| 115 | </variablelist>
|
---|
| 116 |
|
---|
| 117 | <para>Some examples:</para>
|
---|
| 118 |
|
---|
| 119 | <itemizedlist>
|
---|
| 120 |
|
---|
| 121 | <listitem>
|
---|
| 122 | <para>For a non-Unicode setup, only the KEYMAP and FONT variables are
|
---|
| 123 | generally needed. E.g., for a Polish setup, one would use:</para>
|
---|
| 124 |
|
---|
| 125 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 126 | <literal># Begin /etc/sysconfig/console
|
---|
| 127 |
|
---|
| 128 | KEYMAP="pl2"
|
---|
| 129 | FONT="lat2a-16 -m 8859-2"
|
---|
| 130 |
|
---|
| 131 | # End /etc/sysconfig/console</literal>
|
---|
[f67f5cf] | 132 | EOF</userinput></screen>
|
---|
[fa21b3d] | 133 | </listitem>
|
---|
[b32e803] | 134 |
|
---|
[fa21b3d] | 135 | <listitem>
|
---|
| 136 | <para>As mentioned above, it is sometimes necessary to adjust a
|
---|
| 137 | stock keymap slightly. The following example adds the Euro symbol to the
|
---|
| 138 | German keymap:</para>
|
---|
[81fd230] | 139 |
|
---|
[fa21b3d] | 140 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 141 | <literal># Begin /etc/sysconfig/console
|
---|
| 142 |
|
---|
| 143 | KEYMAP="de-latin1"
|
---|
| 144 | KEYMAP_CORRECTIONS="euro2"
|
---|
| 145 | FONT="lat0-16 -m 8859-15"
|
---|
| 146 |
|
---|
| 147 | # End /etc/sysconfig/console</literal>
|
---|
[81fd230] | 148 | EOF</userinput></screen>
|
---|
[fa21b3d] | 149 | </listitem>
|
---|
[81fd230] | 150 |
|
---|
[fa21b3d] | 151 | <listitem>
|
---|
[49451499] | 152 | <para>The following is a Unicode-enabled example for Bulgarian, where a
|
---|
| 153 | stock UTF-8 keymap exists:</para>
|
---|
[5536f74] | 154 |
|
---|
[fa21b3d] | 155 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 156 | <literal># Begin /etc/sysconfig/console
|
---|
| 157 |
|
---|
| 158 | UNICODE="1"
|
---|
| 159 | KEYMAP="bg_bds-utf8"
|
---|
| 160 | FONT="LatArCyrHeb-16"
|
---|
| 161 |
|
---|
| 162 | # End /etc/sysconfig/console</literal>
|
---|
| 163 | EOF</userinput></screen>
|
---|
| 164 | </listitem>
|
---|
| 165 |
|
---|
| 166 | <listitem>
|
---|
| 167 | <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous
|
---|
| 168 | example, bright colors are no longer available on the Linux console unless
|
---|
| 169 | a framebuffer is used. If one wants to have bright colors without
|
---|
| 170 | framebuffer and can live without characters not belonging to his language,
|
---|
| 171 | it is still possible to use a language-specific 256-glyph font, as
|
---|
[f19e766] | 172 | illustrated below:</para>
|
---|
[81fd230] | 173 |
|
---|
[fa21b3d] | 174 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 175 | <literal># Begin /etc/sysconfig/console
|
---|
| 176 |
|
---|
| 177 | UNICODE="1"
|
---|
| 178 | KEYMAP="bg_bds-utf8"
|
---|
| 179 | FONT="cyr-sun16"
|
---|
| 180 |
|
---|
| 181 | # End /etc/sysconfig/console</literal>
|
---|
[f67f5cf] | 182 | EOF</userinput></screen>
|
---|
[fa21b3d] | 183 | </listitem>
|
---|
| 184 |
|
---|
| 185 | <listitem>
|
---|
[4d84ed5] | 186 | <para>There is no pre-made UTF-8 Russian keymap, therefore it has to be
|
---|
[49451499] | 187 | produced by converting the existing KOI8-R keymap as illustrated
|
---|
| 188 | below:</para>
|
---|
[fa21b3d] | 189 |
|
---|
| 190 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 191 | <literal># Begin /etc/sysconfig/console
|
---|
[b32e803] | 192 |
|
---|
[fa21b3d] | 193 | UNICODE="1"
|
---|
[10c9f9c] | 194 | KEYMAP="ru-ms"
|
---|
[49451499] | 195 | LEGACY_CHARSET="koi8-r"
|
---|
| 196 | FONT="LatArCyrHeb-16"
|
---|
[b32e803] | 197 |
|
---|
[fa21b3d] | 198 | # End /etc/sysconfig/console</literal>
|
---|
[f67f5cf] | 199 | EOF</userinput></screen>
|
---|
[fa21b3d] | 200 | </listitem>
|
---|
[b32e803] | 201 |
|
---|
[49451499] | 202 | <listitem>
|
---|
| 203 | <para>Some keymaps have dead keys (i.e., keys that don't produce a
|
---|
| 204 | character by themselves, but put an accent on the character produced
|
---|
| 205 | by the next key) or define composition rules (such as: <quote>press
|
---|
| 206 | Ctrl+. A E to get Æ</quote> in the default keymap).
|
---|
| 207 | Linux-&linux-version; in UTF-8 keyboard mode assumes that accented
|
---|
| 208 | characters produced via dead keys or composing are in the Latin-1 range
|
---|
| 209 | of Unicode, and it is impossible to change this assumption. Thus,
|
---|
| 210 | accented characters needed for, e.g., the Czech language, can't be typed
|
---|
| 211 | on Linux console in UTF-8 mode (but files containing these characters can
|
---|
| 212 | be displayed correctly). The solution is either to avoid the use of
|
---|
| 213 | UTF-8, or to install the X window system that doesn't have this
|
---|
| 214 | limitation in its input handling.</para>
|
---|
| 215 | </listitem>
|
---|
| 216 |
|
---|
[fa21b3d] | 217 | <listitem>
|
---|
| 218 | <para>For Chinese, Japanese, Korean and some other languages, the Linux
|
---|
| 219 | console cannot be configured to display the needed characters. Users
|
---|
| 220 | who need such languages should install the X Window System, fonts that
|
---|
| 221 | cover the necessary character ranges, and the proper input method (e.g.,
|
---|
| 222 | SCIM, it supports a wide variety of languages).</para>
|
---|
| 223 | </listitem>
|
---|
| 224 |
|
---|
| 225 | </itemizedlist>
|
---|
| 226 |
|
---|
| 227 | <!-- Added because folks keep posting their console file with X questions
|
---|
| 228 | to blfs-support list -->
|
---|
| 229 | <note>
|
---|
[49451499] | 230 | <para>The <filename>/etc/sysconfig/console</filename> file only controls the Linux text console localization. It has nothing to do with setting the
|
---|
| 231 | proper keyboard layout and terminal fonts in the X Window System, with ssh
|
---|
| 232 | sessions or with a serial console. In such situations, limitations mentioned
|
---|
| 233 | in the last two list items above do not apply.</para>
|
---|
[fa21b3d] | 234 | </note>
|
---|
[81fd230] | 235 |
|
---|
[1050066] | 236 | </sect1>
|
---|