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