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