[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[1770019] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[673b0d8] | 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
[7d096f3] | 6 | <sect1 id="ch-scripts-console">
|
---|
[bce08ef] | 7 | <title>Configuring the Linux Console</title>
|
---|
[7d096f3] | 8 | <?dbhtml filename="console.html"?>
|
---|
[1050066] | 9 |
|
---|
[81fd230] | 10 | <indexterm zone="ch-scripts-console">
|
---|
| 11 | <primary sortas="d-console">console</primary>
|
---|
| 12 | <secondary>configuring</secondary></indexterm>
|
---|
| 13 |
|
---|
| 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
|
---|
| 18 | the keyboard is a U.S. one, skip this section. Without the
|
---|
| 19 | configuration file, the console initscript will do nothing.</para>
|
---|
| 20 |
|
---|
| 21 | <para>The <command>console</command> script uses the
|
---|
| 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
|
---|
[4ccba55] | 30 | keymaps and screen fonts. Read the <command>loadkeys</command> and
|
---|
| 31 | <command>setfont</command> manual pages
|
---|
[81fd230] | 32 | and determine the correct arguments for these programs. Once decided,
|
---|
| 33 | create the configuration file with the following command:</para>
|
---|
[673b0d8] | 34 |
|
---|
[f67f5cf] | 35 | <screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
[d72e04a] | 36 | <literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
|
---|
| 37 | FONT="<replaceable>[arguments for setfont]</replaceable>"</literal>
|
---|
[f67f5cf] | 38 | EOF</userinput></screen>
|
---|
[b32e803] | 39 |
|
---|
[81fd230] | 40 | <para>For example, for Spanish users who also want to use the Euro
|
---|
| 41 | character (accessible by pressing AltGr+E), the following settings are
|
---|
| 42 | correct:</para>
|
---|
| 43 |
|
---|
| 44 | <screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
| 45 | <literal>KEYMAP="es euro2"
|
---|
| 46 | FONT="lat9-16 -u iso01"</literal>
|
---|
| 47 | EOF</userinput></screen>
|
---|
| 48 |
|
---|
| 49 | <note><para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
|
---|
| 50 | character set. If using ISO 8859-1 and, therefore, a pound sign
|
---|
| 51 | instead of Euro, the correct <envar>FONT</envar> line would be:</para>
|
---|
| 52 |
|
---|
| 53 | <screen><userinput>FONT="lat1-16"</userinput></screen></note>
|
---|
| 54 |
|
---|
| 55 | <para>If the <envar>KEYMAP</envar> or <envar>FONT</envar> variable is not set, the
|
---|
| 56 | <command>console</command> initscript will not run the corresponding
|
---|
| 57 | program.</para>
|
---|
| 58 |
|
---|
[c5ec23b] | 59 | <para>In some keymaps, the Backspace and Delete keys send characters different
|
---|
| 60 | from ones in the default keymap built into the kernel. This confuses some
|
---|
| 61 | applications. For example, Emacs displays its help (instead of erasing the
|
---|
| 62 | character before the cursor) when Backspace is pressed. To check if the keymap
|
---|
| 63 | in use is affected (this works only for i386 keymaps):</para>
|
---|
[81fd230] | 64 |
|
---|
| 65 | <screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
|
---|
| 66 |
|
---|
[19d6aec] | 67 | <beginpage/>
|
---|
| 68 |
|
---|
[81fd230] | 69 | <para>If the keycode 14 is Backspace instead of Delete, create the
|
---|
| 70 | following keymap snippet to fix this issue:</para>
|
---|
[b32e803] | 71 |
|
---|
[d72e04a] | 72 | <screen><userinput>mkdir -p /etc/kbd && cat > /etc/kbd/bs-sends-del <<"EOF"
|
---|
| 73 | <literal> keycode 14 = Delete Delete Delete Delete
|
---|
| 74 | alt keycode 14 = Meta_Delete
|
---|
| 75 | altgr alt keycode 14 = Meta_Delete
|
---|
| 76 | keycode 111 = Remove
|
---|
| 77 | altgr control keycode 111 = Boot
|
---|
| 78 | control alt keycode 111 = Boot
|
---|
| 79 | altgr control alt keycode 111 = Boot</literal>
|
---|
[f67f5cf] | 80 | EOF</userinput></screen>
|
---|
[b32e803] | 81 |
|
---|
[81fd230] | 82 | <para>Tell the <command>console</command> script to load this
|
---|
| 83 | snippet after the main keymap:</para>
|
---|
[b32e803] | 84 |
|
---|
[f67f5cf] | 85 | <screen><userinput>cat >>/etc/sysconfig/console <<"EOF"
|
---|
[42af263] | 86 | <literal>KEYMAP_CORRECTIONS="/etc/kbd/bs-sends-del"</literal>
|
---|
[f67f5cf] | 87 | EOF</userinput></screen>
|
---|
[b32e803] | 88 |
|
---|
[81fd230] | 89 | <para>To compile the keymap directly into the kernel instead of
|
---|
| 90 | setting it every time from the <command>console</command> bootscript,
|
---|
| 91 | follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
|
---|
| 92 | Doing this ensures that the keyboard will always work as expected,
|
---|
| 93 | even when booting into maintenance mode (by passing
|
---|
| 94 | <parameter>init=/bin/sh</parameter> to the kernel), because the
|
---|
| 95 | <command>console</command> bootscript will not be run in that
|
---|
| 96 | situation. Additionally, the kernel will not set the screen font
|
---|
| 97 | automatically. This should not pose many problems because ASCII characters
|
---|
| 98 | will be handled correctly, and it is unlikely that a user would need
|
---|
| 99 | to rely on non-ASCII characters while in maintenance mode.</para>
|
---|
| 100 |
|
---|
| 101 | <para>Since the kernel will set up the keymap, it is possible to omit
|
---|
| 102 | the <envar>KEYMAP</envar> variable from the
|
---|
| 103 | <filename>/etc/sysconfig/console</filename> configuration file. It can
|
---|
| 104 | also be left in place, if desired, without consequence. Keeping it
|
---|
| 105 | could be beneficial if running several different kernels where it is
|
---|
| 106 | difficult to ensure that the keymap is compiled into every one of
|
---|
| 107 | them.</para>
|
---|
| 108 |
|
---|
[1050066] | 109 | </sect1>
|
---|
[b32e803] | 110 |
|
---|