source: chapter07/console.xml@ 2ca8941

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.3 7.4 7.5 7.6 7.7 7.8 7.9 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 2ca8941 was 2ca8941, checked in by Matthew Burgess <matthew@…>, 11 years ago

Remove trailing whitespace from all files.

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

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