source: chapter07/console.xml@ f874424

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since f874424 was 6d37614, checked in by Matthew Burgess <matthew@…>, 13 years ago

Typo fix

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

  • Property mode set to 100644
File size: 9.1 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 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
28 the configuration file, the <command>console</command> bootscript will do
29 nothing.</para>
30
31 <para>The <command>console</command> and <command>consolelog</command>
32 scripts read the <filename>/etc/sysconfig/console</filename> file for
33 configuration information.
34 Decide which keymap and screen font will be used. Various language-specific
35 HOWTOs can also help with this, see <ulink
36 url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in
37 doubt, look in the <filename class="directory">/lib/kbd</filename>
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
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
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),
88 <!-- because of the copyright sign -->
89 set this variable to <quote>lat1-16 -m 8859-1</quote>.
90 In UTF-8 mode, the kernel uses the application character map for
91 conversion of composed 8-bit key codes in the keymap to UTF-8, and thus
92 the argument of the "-m" parameter should be set to the encoding of the
93 composed key codes in the keymap.</para>
94
95 </listitem>
96 </varlistentry>
97
98 <varlistentry>
99 <term>UNICODE</term>
100 <listitem>
101 <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or
102 <quote>true</quote> in order to put the
103 console into UTF-8 mode. This is useful in UTF-8 based locales and
104 harmful otherwise.</para>
105 </listitem>
106 </varlistentry>
107
108 <varlistentry>
109 <term>LEGACY_CHARSET</term>
110 <listitem>
111 <para>For many keyboard layouts, there is no stock Unicode keymap in
112 the Kbd package. The <command>console</command> bootscript will
113 convert an available keymap to UTF-8 on the fly if this variable is
114 set to the encoding of the available non-UTF-8 keymap.</para>
115 </listitem>
116 </varlistentry>
117
118 </variablelist>
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 &gt; /etc/sysconfig/console &lt;&lt; "EOF"
129<literal># Begin /etc/sysconfig/console
130
131KEYMAP="pl2"
132FONT="lat2a-16 -m 8859-2"
133
134# End /etc/sysconfig/console</literal>
135EOF</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 &gt; /etc/sysconfig/console &lt;&lt; "EOF"
144<literal># Begin /etc/sysconfig/console
145
146KEYMAP="de-latin1"
147KEYMAP_CORRECTIONS="euro2"
148FONT="lat0-16 -m 8859-15"
149
150# End /etc/sysconfig/console</literal>
151EOF</userinput></screen>
152 </listitem>
153
154 <listitem>
155 <para>The following is a Unicode-enabled example for Bulgarian, where a
156 stock UTF-8 keymap exists:</para>
157
158<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
159<literal># Begin /etc/sysconfig/console
160
161UNICODE="1"
162KEYMAP="bg_bds-utf8"
163FONT="LatArCyrHeb-16"
164
165# End /etc/sysconfig/console</literal>
166EOF</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 &gt; /etc/sysconfig/console &lt;&lt; "EOF"
178<literal># Begin /etc/sysconfig/console
179
180UNICODE="1"
181KEYMAP="bg_bds-utf8"
182FONT="cyr-sun16"
183
184# End /etc/sysconfig/console</literal>
185EOF</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 &gt; /etc/sysconfig/console &lt;&lt; "EOF"
193<literal># Begin /etc/sysconfig/console
194
195UNICODE="1"
196KEYMAP="de-latin1"
197KEYMAP_CORRECTIONS="euro2"
198LEGACY_CHARSET="iso-8859-15"
199FONT="LatArCyrHeb-16 -m 8859-15"
200
201# End /etc/sysconfig/console</literal>
202EOF</userinput></screen>
203 </listitem>
204
205 <listitem>
206 <para>Some keymaps have dead keys (i.e., keys that don't produce a
207 character by themselves, but put an accent on the character produced
208 by the next key) or define composition rules (such as: <quote>press
209 Ctrl+. A E to get &AElig;</quote> in the default keymap).
210 Linux-&linux-version; interprets dead keys and composition rules in the
211 keymap correctly only when the source characters to be composed together
212 are not multibyte. This deficiency doesn't affect keymaps for European
213 languages, because there accents are added to unaccented ASCII
214 characters, or two ASCII characters are composed together. However, in
215 UTF-8 mode it is a problem, e.g., for the Greek language, where one
216 sometimes needs to put an accent on the letter <quote>alpha</quote>.
217 The solution is either to avoid the use of UTF-8, or to install the
218 X window system that doesn't have this limitation in its input
219 handling.</para>
220 </listitem>
221
222 <listitem>
223 <para>For Chinese, Japanese, Korean and some other languages, the Linux
224 console cannot be configured to display the needed characters. Users
225 who need such languages should install the X Window System, fonts that
226 cover the necessary character ranges, and the proper input method (e.g.,
227 SCIM, it supports a wide variety of languages).</para>
228 </listitem>
229
230 </itemizedlist>
231
232 <!-- Added because folks keep posting their console file with X questions
233 to blfs-support list -->
234 <note>
235 <para>The <filename>/etc/sysconfig/console</filename> file only controls the Linux text console localization. It has nothing to do with setting the
236 proper keyboard layout and terminal fonts in the X Window System, with ssh
237 sessions or with a serial console. In such situations, limitations mentioned
238 in the last two list items above do not apply.</para>
239 </note>
240
241</sect1>
Note: See TracBrowser for help on using the repository browser.