source: chapter07/console.xml@ d22a5031

Last change on this file since d22a5031 was c909f28, checked in by Jeremy Huntwork <jhuntwork@…>, 17 years ago

Merge r8256, r8260, r8262, r8263, r8264, r8266, r8267, r8269 and r8272 to x86_64 branch.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/x86_64/BOOK@8274 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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