[519ee45] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-scripts-console">
|
---|
| 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>
|
---|
| 19 | bootscript that sets up the keyboard map and the console font. If non-ASCII
|
---|
| 20 | characters (e.g., the copyright sign, the British pound sign and Euro symbol)
|
---|
| 21 | will not be used and the keyboard is a U.S. one, skip this section. Without
|
---|
| 22 | the configuration file, the <command>console</command> bootscript will do
|
---|
| 23 | nothing.</para>
|
---|
| 24 |
|
---|
| 25 | <para>The <command>console</command> script reads the
|
---|
| 26 | <filename>/etc/sysconfig/console</filename> file for configuration information.
|
---|
| 27 | Decide which keymap and screen font will be used. Various language-specific
|
---|
| 28 | HOWTOs can also help with this, see <ulink
|
---|
| 29 | url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in
|
---|
| 30 | doubt, look in the <filename class="directory">/usr/share/kbd</filename>
|
---|
| 31 | directory for valid keymaps and screen fonts. Read
|
---|
| 32 | <filename>loadkeys(1)</filename> and <filename>setfont(8)</filename> manual
|
---|
| 33 | pages to determine the correct arguments for these programs.</para>
|
---|
| 34 |
|
---|
| 35 | <para>The <filename>/etc/sysconfig/console</filename> file should contain lines
|
---|
| 36 | of the form: VARIABLE="value". The following variables are recognized:</para>
|
---|
| 37 |
|
---|
| 38 | <variablelist>
|
---|
| 39 |
|
---|
| 40 | <varlistentry>
|
---|
| 41 | <term>KEYMAP</term>
|
---|
| 42 | <listitem>
|
---|
| 43 | <para>This variable specifies the arguments for the
|
---|
| 44 | <command>loadkeys</command> program, typically, the name of keymap
|
---|
| 45 | to load, e.g., <quote>es</quote>. If this variable is not set, the
|
---|
| 46 | bootscript will not run the <command>loadkeys</command> program,
|
---|
| 47 | and the default kernel keymap will be used.</para>
|
---|
| 48 | </listitem>
|
---|
| 49 | </varlistentry>
|
---|
| 50 |
|
---|
| 51 | <varlistentry>
|
---|
| 52 | <term>KEYMAP_CORRECTIONS</term>
|
---|
| 53 | <listitem>
|
---|
| 54 | <para>This (rarely used) variable
|
---|
| 55 | specifies the arguments for the second call to the
|
---|
| 56 | <command>loadkeys</command> program. This is useful if the stock keymap
|
---|
| 57 | is not completely satisfactory and a small adjustment has to be made. E.g.,
|
---|
| 58 | to include the Euro sign into a keymap that normally doesn't have it,
|
---|
| 59 | set this variable to <quote>euro2</quote>.</para>
|
---|
| 60 | </listitem>
|
---|
| 61 | </varlistentry>
|
---|
| 62 |
|
---|
| 63 | <varlistentry>
|
---|
| 64 | <term>FONT</term>
|
---|
| 65 | <listitem>
|
---|
| 66 | <para>This variable specifies the arguments for the
|
---|
| 67 | <command>setfont</command> program. Typically, this includes the font
|
---|
| 68 | name, <quote>-m</quote>, and the name of the application character
|
---|
| 69 | map to load. E.g., in order to load the <quote>lat1-16</quote> font
|
---|
| 70 | together with the <quote>8859-1</quote> application character map
|
---|
| 71 | (as it is appropriate in the USA), <!-- because of the copyright sign -->
|
---|
| 72 | set this variable to <quote>lat1-16 -m 8859-1</quote>.
|
---|
| 73 | If this variable is not set, the bootscript will not run the
|
---|
| 74 | <command>setfont</command> program, and the default VGA font will be
|
---|
| 75 | used together with the default application character map.</para>
|
---|
| 76 | </listitem>
|
---|
| 77 | </varlistentry>
|
---|
| 78 |
|
---|
| 79 | <varlistentry>
|
---|
| 80 | <term>UNICODE</term>
|
---|
| 81 | <listitem>
|
---|
| 82 | <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or
|
---|
| 83 | <quote>true</quote> in order to put the
|
---|
| 84 | console into UTF-8 mode. This is useful in UTF-8 based locales and
|
---|
| 85 | harmful otherwise.</para>
|
---|
| 86 | </listitem>
|
---|
| 87 | </varlistentry>
|
---|
| 88 |
|
---|
| 89 | <varlistentry>
|
---|
| 90 | <term>LEGACY_CHARSET</term>
|
---|
| 91 | <listitem>
|
---|
| 92 | <para>For many keyboard layouts, there is no stock Unicode keymap in
|
---|
| 93 | the Kbd package. The <command>console</command> bootscript will
|
---|
| 94 | convert an available keymap to UTF-8 on the fly if this variable is
|
---|
| 95 | set to the encoding of the available non-UTF-8 keymap. Note, however,
|
---|
| 96 | that dead keys (i.e., keys that don't produce a character by
|
---|
| 97 | themselves, but put an accent onto a character procuced by the next
|
---|
| 98 | key; there are no dead keys on the standard US keyboard) and composing
|
---|
| 99 | (i.e., pressing Ctrl+. A E in order to produce the Æ character)
|
---|
| 100 | will not work in UTF-8 mode without the special kernel patch.
|
---|
| 101 | This variable is useful only in UTF-8 mode.</para>
|
---|
| 102 | </listitem>
|
---|
| 103 | </varlistentry>
|
---|
| 104 |
|
---|
| 105 | <varlistentry>
|
---|
| 106 | <term>BROKEN_COMPOSE</term>
|
---|
| 107 | <listitem>
|
---|
| 108 | <para>Set this to <quote>0</quote> if you are going to apply the kernel patch in
|
---|
| 109 | Chapter 8. Note that you also have to add the character set expected
|
---|
| 110 | by composition rules in your keymap to the FONT variable after the
|
---|
| 111 | <quote>-m</quote> switch. This variable is useful only in UTF-8 mode.</para>
|
---|
| 112 | </listitem>
|
---|
| 113 | </varlistentry>
|
---|
| 114 |
|
---|
| 115 | </variablelist>
|
---|
| 116 |
|
---|
| 117 | <para>Support for compiling the keymap directly into the kernel has been
|
---|
| 118 | removed because there were reports that it leads to incorrect results.</para>
|
---|
| 119 |
|
---|
| 120 | <para>Some examples:</para>
|
---|
| 121 |
|
---|
| 122 | <itemizedlist>
|
---|
| 123 |
|
---|
| 124 | <listitem>
|
---|
| 125 | <para>For a non-Unicode setup, only the KEYMAP and FONT variables are
|
---|
| 126 | generally needed. E.g., for a Polish setup, one would use:</para>
|
---|
| 127 |
|
---|
| 128 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 129 | <literal># Begin /etc/sysconfig/console
|
---|
| 130 |
|
---|
| 131 | KEYMAP="pl2"
|
---|
| 132 | FONT="lat2a-16 -m 8859-2"
|
---|
| 133 |
|
---|
| 134 | # End /etc/sysconfig/console</literal>
|
---|
| 135 | EOF</userinput></screen>
|
---|
| 136 | </listitem>
|
---|
| 137 |
|
---|
| 138 | <listitem>
|
---|
| 139 | <para>As mentioned above, it is sometimes necessary to adjust a
|
---|
| 140 | stock keymap slightly. The following example adds the Euro symbol to the
|
---|
| 141 | German keymap:</para>
|
---|
| 142 |
|
---|
| 143 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 144 | <literal># Begin /etc/sysconfig/console
|
---|
| 145 |
|
---|
| 146 | KEYMAP="de-latin1"
|
---|
| 147 | KEYMAP_CORRECTIONS="euro2"
|
---|
| 148 | FONT="lat0-16 -m 8859-15"
|
---|
| 149 |
|
---|
| 150 | # End /etc/sysconfig/console</literal>
|
---|
| 151 | EOF</userinput></screen>
|
---|
| 152 | </listitem>
|
---|
| 153 |
|
---|
| 154 | <listitem>
|
---|
| 155 | <para>The following is a Unicode-enabled example for Bulgarian, where a stock
|
---|
| 156 | UTF-8 keymap exists and defines no dead keys or composition rules:</para>
|
---|
| 157 |
|
---|
| 158 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 159 | <literal># Begin /etc/sysconfig/console
|
---|
| 160 |
|
---|
| 161 | UNICODE="1"
|
---|
| 162 | KEYMAP="bg_bds-utf8"
|
---|
| 163 | FONT="LatArCyrHeb-16"
|
---|
| 164 |
|
---|
| 165 | # End /etc/sysconfig/console</literal>
|
---|
| 166 | EOF</userinput></screen>
|
---|
| 167 | </listitem>
|
---|
| 168 |
|
---|
| 169 | <listitem>
|
---|
| 170 | <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous
|
---|
| 171 | example, bright colors are no longer available on the Linux console unless
|
---|
| 172 | a framebuffer is used. If one wants to have bright colors without
|
---|
| 173 | framebuffer and can live without characters not belonging to his language,
|
---|
| 174 | it is still possible to use a language-specific 256-glyph font, as
|
---|
| 175 | illustrated below.</para>
|
---|
| 176 |
|
---|
| 177 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 178 | <literal># Begin /etc/sysconfig/console
|
---|
| 179 |
|
---|
| 180 | UNICODE="1"
|
---|
| 181 | KEYMAP="bg_bds-utf8"
|
---|
| 182 | FONT="cyr-sun16"
|
---|
| 183 |
|
---|
| 184 | # End /etc/sysconfig/console</literal>
|
---|
| 185 | EOF</userinput></screen>
|
---|
| 186 | </listitem>
|
---|
| 187 |
|
---|
| 188 | <listitem>
|
---|
| 189 | <para>The following example illustrates keymap autoconversion from
|
---|
| 190 | ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:</para>
|
---|
| 191 |
|
---|
| 192 | <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF"
|
---|
| 193 | <literal># Begin /etc/sysconfig/console
|
---|
| 194 |
|
---|
| 195 | UNICODE="1"
|
---|
| 196 | KEYMAP="de-latin1"
|
---|
| 197 | KEYMAP_CORRECTIONS="euro2"
|
---|
| 198 | LEGACY_CHARSET="iso-8859-15"
|
---|
| 199 | BROKEN_COMPOSE="0"
|
---|
| 200 | FONT="LatArCyrHeb-16 -m 8859-15"
|
---|
| 201 |
|
---|
| 202 | # End /etc/sysconfig/console</literal>
|
---|
| 203 | EOF</userinput></screen>
|
---|
| 204 | </listitem>
|
---|
| 205 |
|
---|
| 206 | <listitem>
|
---|
| 207 | <para>For Chinese, Japanese, Korean and some other languages, the Linux
|
---|
| 208 | console cannot be configured to display the needed characters. Users
|
---|
| 209 | who need such languages should install the X Window System, fonts that
|
---|
| 210 | cover the necessary character ranges, and the proper input method (e.g.,
|
---|
| 211 | SCIM, it supports a wide variety of languages).</para>
|
---|
| 212 | </listitem>
|
---|
| 213 |
|
---|
| 214 | </itemizedlist>
|
---|
| 215 |
|
---|
| 216 | <!-- Added because folks keep posting their console file with X questions
|
---|
| 217 | to blfs-support list -->
|
---|
| 218 | <note>
|
---|
| 219 | <para>The <filename>/etc/sysconfig/console</filename> file only controls the
|
---|
| 220 | Linux text console localization. It has nothing to do with setting the proper
|
---|
| 221 | keyboard layout and terminal fonts in the X Window System, with ssh sessions
|
---|
| 222 | or with a serial console.</para>
|
---|
| 223 | </note>
|
---|
| 224 |
|
---|
| 225 | </sect1>
|
---|