source: chapter07/console.xml@ 4b51ca76

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 6.3 6.4 6.5 6.6 6.7 6.8 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 4b51ca76 was fa21b3d, checked in by Jeremy Huntwork <jhuntwork@…>, 18 years ago

Initial support of UTF-8. Thanks Alexander Patrakov.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7245 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.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 &AElig; 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 &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 stock
156 UTF-8 keymap exists and defines no dead keys or composition rules:</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"
199BROKEN_COMPOSE="0"
200FONT="LatArCyrHeb-16 -m 8859-15"
201
202# End /etc/sysconfig/console</literal>
203EOF</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>
Note: See TracBrowser for help on using the repository browser.