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 British pound sign and Euro character) will not be used
|
---|
21 | and the keyboard is a U.S. one, skip this section. Without the configuration
|
---|
22 | file, the <command>console</command> bootscript will do nothing.</para>
|
---|
23 |
|
---|
24 | <para>The <command>console</command> script reads the
|
---|
25 | <filename>/etc/sysconfig/console</filename> file for configuration information.
|
---|
26 | Decide which keymap and screen font will be used. Various language-specific
|
---|
27 | HOWTO's can also help with this (see <ulink
|
---|
28 | url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
|
---|
29 | <filename>/etc/sysconfig/console</filename> file with known settings for several
|
---|
30 | countries was installed with the LFS-Bootscripts package, so the relevant
|
---|
31 | section can be uncommented if the country is supported. If still in doubt, look
|
---|
32 | in the <filename class="directory">/usr/share/kbd</filename> directory for valid
|
---|
33 | keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
|
---|
34 | <filename>setfont(8)</filename> to determine the correct arguments for
|
---|
35 | these programs. Once decided, create the configuration file with the following
|
---|
36 | command:</para>
|
---|
37 |
|
---|
38 | <screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
39 | <literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
|
---|
40 | FONT="<replaceable>[arguments for setfont]</replaceable>"</literal>
|
---|
41 | EOF</userinput></screen>
|
---|
42 |
|
---|
43 | <para>For example, for Spanish users who also want to use the Euro
|
---|
44 | character (accessible by pressing AltGr+E), the following settings are
|
---|
45 | correct:</para>
|
---|
46 |
|
---|
47 | <screen role="nodump"><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
48 | <literal>KEYMAP="es euro2"
|
---|
49 | FONT="lat9-16 -u iso01"</literal>
|
---|
50 | EOF</userinput></screen>
|
---|
51 |
|
---|
52 | <note>
|
---|
53 | <para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
|
---|
54 | character set. If using ISO 8859-1 and, therefore, a pound sign
|
---|
55 | instead of Euro, the correct <envar>FONT</envar> line would be:</para>
|
---|
56 |
|
---|
57 | <screen role="nodump"><userinput>FONT="lat1-16"</userinput></screen>
|
---|
58 | </note>
|
---|
59 |
|
---|
60 | <para>If the <envar>KEYMAP</envar> or <envar>FONT</envar> variable is not set,
|
---|
61 | the <command>console</command> initscript will not run the corresponding
|
---|
62 | program.</para>
|
---|
63 |
|
---|
64 | <para>In some keymaps, the Backspace and Delete keys send characters different
|
---|
65 | from ones in the default keymap built into the kernel. This confuses some
|
---|
66 | applications. For example, Emacs displays its help (instead of erasing the
|
---|
67 | character before the cursor) when Backspace is pressed. To check if the keymap
|
---|
68 | in use is affected (this works only for i386 keymaps):</para>
|
---|
69 |
|
---|
70 | <screen role="nodump"><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
|
---|
71 |
|
---|
72 | <para>If the keycode 14 is Backspace instead of Delete, create the
|
---|
73 | following keymap snippet to fix this issue:</para>
|
---|
74 |
|
---|
75 | <screen role="nodump"><userinput>mkdir -pv /etc/kbd && cat > /etc/kbd/bs-sends-del <<"EOF"
|
---|
76 | <literal> keycode 14 = Delete Delete Delete Delete
|
---|
77 | alt keycode 14 = Meta_Delete
|
---|
78 | altgr alt keycode 14 = Meta_Delete
|
---|
79 | keycode 111 = Remove
|
---|
80 | altgr control keycode 111 = Boot
|
---|
81 | control alt keycode 111 = Boot
|
---|
82 | altgr control alt keycode 111 = Boot</literal>
|
---|
83 | EOF</userinput></screen>
|
---|
84 |
|
---|
85 | <para>Tell the <command>console</command> script to load this
|
---|
86 | snippet after the main keymap:</para>
|
---|
87 |
|
---|
88 | <screen role="nodump"><userinput>cat >>/etc/sysconfig/console <<"EOF"
|
---|
89 | <literal>KEYMAP_CORRECTIONS="/etc/kbd/bs-sends-del"</literal>
|
---|
90 | EOF</userinput></screen>
|
---|
91 |
|
---|
92 | <para>To compile the keymap directly into the kernel instead of
|
---|
93 | setting it every time from the <command>console</command> bootscript,
|
---|
94 | follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
|
---|
95 | Doing this ensures that the keyboard will always work as expected,
|
---|
96 | even when booting into maintenance mode (by passing
|
---|
97 | <parameter>init=/bin/sh</parameter> to the kernel), because the
|
---|
98 | <command>console</command> bootscript will not be run in that
|
---|
99 | situation. Additionally, the kernel will not set the screen font
|
---|
100 | automatically. This should not pose many problems because ASCII characters
|
---|
101 | will be handled correctly, and it is unlikely that a user would need
|
---|
102 | to rely on non-ASCII characters while in maintenance mode.</para>
|
---|
103 |
|
---|
104 | <para>Since the kernel will set up the keymap, it is possible to omit
|
---|
105 | the <envar>KEYMAP</envar> variable from the
|
---|
106 | <filename>/etc/sysconfig/console</filename> configuration file. It can
|
---|
107 | also be left in place, if desired, without consequence. Keeping it
|
---|
108 | could be beneficial if running several different kernels where it is
|
---|
109 | difficult to ensure that the keymap is compiled into every one of
|
---|
110 | them.</para>
|
---|
111 |
|
---|
112 | </sect1>
|
---|