source: chapter07/console.xml@ d1538c0

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 d1538c0 was 9a07261, checked in by Dan Nichilson <dnicholson@…>, 18 years ago

Fixed kbd datadir on console configuration page

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

  • Property mode set to 100644
File size: 8.3 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">/lib/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.</para>
96 </listitem>
97 </varlistentry>
98
99 </variablelist>
100
101 <para>Some examples:</para>
102
103 <itemizedlist>
104
105 <listitem>
106 <para>For a non-Unicode setup, only the KEYMAP and FONT variables are
107 generally needed. E.g., for a Polish setup, one would use:</para>
108
109<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
110<literal># Begin /etc/sysconfig/console
111
112KEYMAP="pl2"
113FONT="lat2a-16 -m 8859-2"
114
115# End /etc/sysconfig/console</literal>
116EOF</userinput></screen>
117 </listitem>
118
119 <listitem>
120 <para>As mentioned above, it is sometimes necessary to adjust a
121 stock keymap slightly. The following example adds the Euro symbol to the
122 German keymap:</para>
123
124<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
125<literal># Begin /etc/sysconfig/console
126
127KEYMAP="de-latin1"
128KEYMAP_CORRECTIONS="euro2"
129FONT="lat0-16 -m 8859-15"
130
131# End /etc/sysconfig/console</literal>
132EOF</userinput></screen>
133 </listitem>
134
135 <listitem>
136 <para>The following is a Unicode-enabled example for Bulgarian, where a
137 stock UTF-8 keymap exists:</para>
138
139<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
140<literal># Begin /etc/sysconfig/console
141
142UNICODE="1"
143KEYMAP="bg_bds-utf8"
144FONT="LatArCyrHeb-16"
145
146# End /etc/sysconfig/console</literal>
147EOF</userinput></screen>
148 </listitem>
149
150 <listitem>
151 <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous
152 example, bright colors are no longer available on the Linux console unless
153 a framebuffer is used. If one wants to have bright colors without
154 framebuffer and can live without characters not belonging to his language,
155 it is still possible to use a language-specific 256-glyph font, as
156 illustrated below.</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="cyr-sun16"
164
165# End /etc/sysconfig/console</literal>
166EOF</userinput></screen>
167 </listitem>
168
169 <listitem>
170 <para>There is no pre-made UTF-8 Russian keyamp, therefore it has to be
171 produced by converting the existing KOI8-R keymap as illustrated
172 below:</para>
173
174<screen role="nodump"><userinput>cat &gt; /etc/sysconfig/console &lt;&lt; "EOF"
175<literal># Begin /etc/sysconfig/console
176
177UNICODE="1"
178KEYMAP="ru_ms"
179LEGACY_CHARSET="koi8-r"
180FONT="LatArCyrHeb-16"
181
182# End /etc/sysconfig/console</literal>
183EOF</userinput></screen>
184 </listitem>
185
186 <listitem>
187 <para>Some keymaps have dead keys (i.e., keys that don't produce a
188 character by themselves, but put an accent on the character produced
189 by the next key) or define composition rules (such as: <quote>press
190 Ctrl+. A E to get &AElig;</quote> in the default keymap).
191 Linux-&linux-version; in UTF-8 keyboard mode assumes that accented
192 characters produced via dead keys or composing are in the Latin-1 range
193 of Unicode, and it is impossible to change this assumption. Thus,
194 accented characters needed for, e.g., the Czech language, can't be typed
195 on Linux console in UTF-8 mode (but files containing these characters can
196 be displayed correctly). The solution is either to avoid the use of
197 UTF-8, or to install the X window system that doesn't have this
198 limitation in its input handling.</para>
199 </listitem>
200
201 <listitem>
202 <para>For Chinese, Japanese, Korean and some other languages, the Linux
203 console cannot be configured to display the needed characters. Users
204 who need such languages should install the X Window System, fonts that
205 cover the necessary character ranges, and the proper input method (e.g.,
206 SCIM, it supports a wide variety of languages).</para>
207 </listitem>
208
209 </itemizedlist>
210
211 <!-- Added because folks keep posting their console file with X questions
212 to blfs-support list -->
213 <note>
214 <para>The <filename>/etc/sysconfig/console</filename> file only controls the Linux text console localization. It has nothing to do with setting the
215 proper keyboard layout and terminal fonts in the X Window System, with ssh
216 sessions or with a serial console. In such situations, limitations mentioned
217 in the last two list items above do not apply.</para>
218 </note>
219
220</sect1>
Note: See TracBrowser for help on using the repository browser.