source: chapter07/console.xml@ 111bb20

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.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 111bb20 was f15f341, checked in by Bruce Dubbs <bdubbs@…>, 11 years ago

Update the location of kemap and consolefont files.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10364 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">/usr/share/keymaps</filename>
32 and <filename class="directory">/usr/share/consolefonts</filename> directories
33 for valid keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
34 <filename>setfont(8)</filename> manual pages to determine the correct
35 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
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
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),
83 <!-- because of the copyright sign -->
84 set this variable to <quote>lat1-16 -m 8859-1</quote>.
85 In UTF-8 mode, the kernel uses the application character map for
86 conversion of composed 8-bit key codes in the keymap to UTF-8, and thus
87 the argument of the "-m" parameter should be set to the encoding of the
88 composed key codes in the keymap.</para>
89
90 </listitem>
91 </varlistentry>
92
93 <varlistentry>
94 <term>UNICODE</term>
95 <listitem>
96 <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or
97 <quote>true</quote> in order to put the
98 console into UTF-8 mode. This is useful in UTF-8 based locales and
99 harmful otherwise.</para>
100 </listitem>
101 </varlistentry>
102
103 <varlistentry>
104 <term>LEGACY_CHARSET</term>
105 <listitem>
106 <para>For many keyboard layouts, there is no stock Unicode keymap in
107 the Kbd package. The <command>console</command> bootscript will
108 convert an available keymap to UTF-8 on the fly if this variable is
109 set to the encoding of the available non-UTF-8 keymap.</para>
110 </listitem>
111 </varlistentry>
112
113 </variablelist>
114
115 <para>Some examples:</para>
116
117 <itemizedlist>
118
119 <listitem>
120 <para>For a non-Unicode setup, only the KEYMAP and FONT variables are
121 generally needed. E.g., for a Polish setup, one would use:</para>
122
123<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
124<literal># Begin /etc/sysconfig/console
125
126KEYMAP="pl2"
127FONT="lat2a-16 -m 8859-2"
128
129# End /etc/sysconfig/console</literal>
130EOF</userinput></screen>
131 </listitem>
132
133 <listitem>
134 <para>As mentioned above, it is sometimes necessary to adjust a
135 stock keymap slightly. The following example adds the Euro symbol to the
136 German keymap:</para>
137
138<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
139<literal># Begin /etc/sysconfig/console
140
141KEYMAP="de-latin1"
142KEYMAP_CORRECTIONS="euro2"
143FONT="lat0-16 -m 8859-15"
144
145# End /etc/sysconfig/console</literal>
146EOF</userinput></screen>
147 </listitem>
148
149 <listitem>
150 <para>The following is a Unicode-enabled example for Bulgarian, where a
151 stock UTF-8 keymap exists:</para>
152
153<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
154<literal># Begin /etc/sysconfig/console
155
156UNICODE="1"
157KEYMAP="bg_bds-utf8"
158FONT="LatArCyrHeb-16"
159
160# End /etc/sysconfig/console</literal>
161EOF</userinput></screen>
162 </listitem>
163
164 <listitem>
165 <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous
166 example, bright colors are no longer available on the Linux console unless
167 a framebuffer is used. If one wants to have bright colors without
168 framebuffer and can live without characters not belonging to his language,
169 it is still possible to use a language-specific 256-glyph font, as
170 illustrated below:</para>
171
172<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
173<literal># Begin /etc/sysconfig/console
174
175UNICODE="1"
176KEYMAP="bg_bds-utf8"
177FONT="cyr-sun16"
178
179# End /etc/sysconfig/console</literal>
180EOF</userinput></screen>
181 </listitem>
182
183 <listitem>
184 <para>The following example illustrates keymap autoconversion from
185 ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:</para>
186
187<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
188<literal># Begin /etc/sysconfig/console
189
190UNICODE="1"
191KEYMAP="de-latin1"
192KEYMAP_CORRECTIONS="euro2"
193LEGACY_CHARSET="iso-8859-15"
194FONT="LatArCyrHeb-16 -m 8859-15"
195
196# End /etc/sysconfig/console</literal>
197EOF</userinput></screen>
198 </listitem>
199
200 <listitem>
201 <para>Some keymaps have dead keys (i.e., keys that don't produce a
202 character by themselves, but put an accent on the character produced
203 by the next key) or define composition rules (such as: <quote>press
204 Ctrl+. A E to get &AElig;</quote> in the default keymap).
205 Linux-&linux-version; interprets dead keys and composition rules in the
206 keymap correctly only when the source characters to be composed together
207 are not multibyte. This deficiency doesn't affect keymaps for European
208 languages, because there accents are added to unaccented ASCII
209 characters, or two ASCII characters are composed together. However, in
210 UTF-8 mode it is a problem, e.g., for the Greek language, where one
211 sometimes needs to put an accent on the letter <quote>alpha</quote>.
212 The solution is either to avoid the use of UTF-8, or to install the
213 X window system that doesn't have this limitation in its input
214 handling.</para>
215 </listitem>
216
217 <listitem>
218 <para>For Chinese, Japanese, Korean and some other languages, the Linux
219 console cannot be configured to display the needed characters. Users
220 who need such languages should install the X Window System, fonts that
221 cover the necessary character ranges, and the proper input method (e.g.,
222 SCIM, it supports a wide variety of languages).</para>
223 </listitem>
224
225 </itemizedlist>
226
227 <!-- Added because folks keep posting their console file with X questions
228 to blfs-support list -->
229 <note>
230 <para>The <filename>/etc/sysconfig/console</filename> file only controls the Linux text console localization. It has nothing to do with setting the
231 proper keyboard layout and terminal fonts in the X Window System, with ssh
232 sessions or with a serial console. In such situations, limitations mentioned
233 in the last two list items above do not apply.</para>
234 </note>
235
236</sect1>
Note: See TracBrowser for help on using the repository browser.