1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 | <sect1 id="ch-scripts-console">
|
---|
7 | <title>Configuring the Linux console</title>
|
---|
8 | <?dbhtml filename="console.html"?>
|
---|
9 |
|
---|
10 | <indexterm zone="ch-scripts-console">
|
---|
11 | <primary sortas="d-console">console</primary>
|
---|
12 | <secondary>configuring</secondary></indexterm>
|
---|
13 |
|
---|
14 | <para>In this section we will configure the <command>console</command>
|
---|
15 | initscript that sets up the keyboard
|
---|
16 | map and the console font. If you
|
---|
17 | don't need to use any non-ASCII characters
|
---|
18 | (British pound and Euro character are not ASCII),
|
---|
19 | and your keyboard is a US one, you can skip this section.
|
---|
20 | Without the configuration file,
|
---|
21 | the <command>console</command> initscript will do nothing.</para>
|
---|
22 |
|
---|
23 | <para>The <command>console</command> script uses the
|
---|
24 | <filename>/etc/sysconfig/console</filename>
|
---|
25 | as a configuration file. You need to decide which keymap and screen font you
|
---|
26 | will use. The language-specific HOWTO can help you.
|
---|
27 | A pre-made
|
---|
28 | <filename>/etc/sysconfig/console</filename> file with known
|
---|
29 | good settings for several countries was installed with the LFS-Bootscripts
|
---|
30 | package, and you just have to uncomment
|
---|
31 | the relevant section if your country is supported (but read the rest
|
---|
32 | of this section anyway).
|
---|
33 | If still in doubt,
|
---|
34 | look into <filename class="directory">/usr/share/kbd</filename>
|
---|
35 | for valid keymaps and screen fonts. Then read the <command>loadkeys</command>
|
---|
36 | and <command>setfont</command> manual pages and figure out the correct
|
---|
37 | arguments for these programs.
|
---|
38 | Once you decided, create the
|
---|
39 | configuration file with the following command:</para>
|
---|
40 |
|
---|
41 | <screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
42 | KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
|
---|
43 | FONT="<replaceable>[arguments for setfont]</replaceable>"
|
---|
44 | EOF</userinput></screen>
|
---|
45 |
|
---|
46 | <para>E.g., for Spanish users who also want to use the Euro character
|
---|
47 | (accessible by pressing Alt+E),
|
---|
48 | the following settings are correct:</para>
|
---|
49 |
|
---|
50 | <screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
51 | KEYMAP="es euro"
|
---|
52 | FONT="lat9-16 -u iso01"
|
---|
53 | EOF</userinput></screen>
|
---|
54 |
|
---|
55 | <note><para>The FONT line above is correct only for the ISO-8859-15
|
---|
56 | character set. If you prefer ISO-8859-1 and therefore use a pound sign
|
---|
57 | instead of Euro, the correct FONT line is:</para>
|
---|
58 |
|
---|
59 | <screen><userinput>FONT="lat1-16"</userinput></screen></note>
|
---|
60 |
|
---|
61 | <para>If the KEYMAP or FONT variable is not set, the
|
---|
62 | <command>console</command> initscript will not run the corresponding
|
---|
63 | program.</para>
|
---|
64 |
|
---|
65 | <para>In some keymaps, the Backspace and Delete keys send characters
|
---|
66 | different form ones in the default keymap built into the kernel.
|
---|
67 | This confuses some applications, e.g., <application>Emacs</application>
|
---|
68 | displays its help (instead of erasing the character before the cursor)
|
---|
69 | when you press Backspace. To check if your keymap is affected (this works
|
---|
70 | only for i386 keymaps):</para>
|
---|
71 |
|
---|
72 | <screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
|
---|
73 |
|
---|
74 | <para>If you see that keycode 14 is Backspace and not Delete,
|
---|
75 | create the following keymap snippet to fix this issue:</para>
|
---|
76 |
|
---|
77 | <screen><userinput>mkdir -p /etc/kbd & & cat >/etc/kbd/bs-sends-del <<"EOF"
|
---|
78 | keycode 14 = Delete Delete Delete Delete
|
---|
79 | alt keycode 14 = Meta_Delete
|
---|
80 | altgr alt keycode 14 = Meta_Delete
|
---|
81 | keycode 111 = Remove
|
---|
82 | altgr control keycode 111 = Boot
|
---|
83 | control alt keycode 111 = Boot
|
---|
84 | altgr control alt keycode 111 = Boot
|
---|
85 | EOF</userinput></screen>
|
---|
86 |
|
---|
87 | <para>Then tell the <command>console</command> script to load this snippet
|
---|
88 | after the main keymap:</para>
|
---|
89 |
|
---|
90 | <screen><userinput>cat >>/etc/sysconfig/console <<"EOF"
|
---|
91 | KEYMAP_CORRECTION="/etc/kbd/bs-sends-del"
|
---|
92 | EOF</userinput></screen>
|
---|
93 |
|
---|
94 | <para>If you decided to
|
---|
95 | compile your keymap directly into the kernel later on in <xref
|
---|
96 | linkend="chapter-bootable"/> instead of setting it every time from the
|
---|
97 | <command>console</command> bootscript, then you don't need to run the
|
---|
98 | <command>loadkeys</command> program. Since the kernel will set up the keymap,
|
---|
99 | you can omit the KEYMAP variable from the
|
---|
100 | <filename>/etc/sysconfig/console</filename>
|
---|
101 | configuration file. If you wish,
|
---|
102 | you can still have it, this isn't going to hurt you. Keeping it could even
|
---|
103 | be beneficial, in case you run a lot of different kernels and can't be sure
|
---|
104 | that the keymap is compiled into every one of them.</para>
|
---|
105 |
|
---|
106 | </sect1>
|
---|
107 |
|
---|