[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 |
|
---|
[b568bbaf] | 14 | <para>This section discusses how to configure the <command>console</command>
|
---|
| 15 | bootscript that sets up the keyboard map and the console font. If non-ASCII
|
---|
[b8a3fb2] | 16 | characters (e.g., the British pound sign and Euro character) will not be used
|
---|
| 17 | and the keyboard is a U.S. one, skip this section. Without the configuration
|
---|
| 18 | file, the <command>console</command> bootscript will do nothing.</para>
|
---|
[81fd230] | 19 |
|
---|
[b568bbaf] | 20 | <para>The <command>console</command> script reads the
|
---|
| 21 | <filename>/etc/sysconfig/console</filename> file for configuration information.
|
---|
| 22 | Decide which keymap and screen font will be used. Various language-specific
|
---|
| 23 | HOWTO's can also help with this (see <ulink
|
---|
| 24 | url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
|
---|
| 25 | <filename>/etc/sysconfig/console</filename> file with known settings for several
|
---|
| 26 | countries was installed with the LFS-Bootscripts package, so the relevant
|
---|
| 27 | section can be uncommented if the country is supported. If still in doubt, look
|
---|
| 28 | in the <filename class="directory">/usr/share/kbd</filename> directory for valid
|
---|
[37428334] | 29 | keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
|
---|
| 30 | <filename>setfont(8)</filename> to determine the correct arguments for
|
---|
[b568bbaf] | 31 | these programs. Once decided, create the configuration file with the following
|
---|
| 32 | command:</para>
|
---|
[673b0d8] | 33 |
|
---|
[f67f5cf] | 34 | <screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
[d72e04a] | 35 | <literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
|
---|
| 36 | FONT="<replaceable>[arguments for setfont]</replaceable>"</literal>
|
---|
[f67f5cf] | 37 | EOF</userinput></screen>
|
---|
[b32e803] | 38 |
|
---|
[81fd230] | 39 | <para>For example, for Spanish users who also want to use the Euro
|
---|
| 40 | character (accessible by pressing AltGr+E), the following settings are
|
---|
| 41 | correct:</para>
|
---|
| 42 |
|
---|
| 43 | <screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
| 44 | <literal>KEYMAP="es euro2"
|
---|
| 45 | FONT="lat9-16 -u iso01"</literal>
|
---|
| 46 | EOF</userinput></screen>
|
---|
| 47 |
|
---|
| 48 | <note><para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
|
---|
| 49 | character set. If using ISO 8859-1 and, therefore, a pound sign
|
---|
| 50 | instead of Euro, the correct <envar>FONT</envar> line would be:</para>
|
---|
| 51 |
|
---|
| 52 | <screen><userinput>FONT="lat1-16"</userinput></screen></note>
|
---|
| 53 |
|
---|
| 54 | <para>If the <envar>KEYMAP</envar> or <envar>FONT</envar> variable is not set, the
|
---|
| 55 | <command>console</command> initscript will not run the corresponding
|
---|
| 56 | program.</para>
|
---|
| 57 |
|
---|
[c5ec23b] | 58 | <para>In some keymaps, the Backspace and Delete keys send characters different
|
---|
| 59 | from ones in the default keymap built into the kernel. This confuses some
|
---|
| 60 | applications. For example, Emacs displays its help (instead of erasing the
|
---|
| 61 | character before the cursor) when Backspace is pressed. To check if the keymap
|
---|
| 62 | in use is affected (this works only for i386 keymaps):</para>
|
---|
[81fd230] | 63 |
|
---|
| 64 | <screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
|
---|
| 65 |
|
---|
[19d6aec] | 66 | <beginpage/>
|
---|
| 67 |
|
---|
[81fd230] | 68 | <para>If the keycode 14 is Backspace instead of Delete, create the
|
---|
| 69 | following keymap snippet to fix this issue:</para>
|
---|
[b32e803] | 70 |
|
---|
[d72e04a] | 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 |
|
---|
[81fd230] | 81 | <para>Tell the <command>console</command> script to load this
|
---|
| 82 | snippet after the main keymap:</para>
|
---|
[b32e803] | 83 |
|
---|
[f67f5cf] | 84 | <screen><userinput>cat >>/etc/sysconfig/console <<"EOF"
|
---|
[42af263] | 85 | <literal>KEYMAP_CORRECTIONS="/etc/kbd/bs-sends-del"</literal>
|
---|
[f67f5cf] | 86 | EOF</userinput></screen>
|
---|
[b32e803] | 87 |
|
---|
[81fd230] | 88 | <para>To compile the keymap directly into the kernel instead of
|
---|
| 89 | setting it every time from the <command>console</command> bootscript,
|
---|
| 90 | follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
|
---|
| 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
|
---|
| 96 | automatically. This should not pose many problems because ASCII characters
|
---|
| 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
|
---|
| 101 | the <envar>KEYMAP</envar> variable from the
|
---|
| 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>
|
---|
| 107 |
|
---|
[1050066] | 108 | </sect1>
|
---|
[b32e803] | 109 |
|
---|