[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">
|
---|
[b32e803] | 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 |
|
---|
[b32e803] | 14 | <para>In this section we will configure the <command>console</command>
|
---|
| 15 | initscript that sets up the keyboard
|
---|
[b3aee6e] | 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,
|
---|
[b32e803] | 21 | the <command>console</command> initscript will do nothing.</para>
|
---|
[1050066] | 22 |
|
---|
[b32e803] | 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.
|
---|
[a56c4bb] | 27 | A pre-made
|
---|
[b32e803] | 28 | <filename>/etc/sysconfig/console</filename> file with known
|
---|
[a56c4bb] | 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).
|
---|
[b32e803] | 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 |
|
---|
[f67f5cf] | 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>
|
---|
[b32e803] | 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 |
|
---|
[f67f5cf] | 50 | <screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
---|
[b32e803] | 51 | KEYMAP="es euro"
|
---|
| 52 | FONT="lat9-16 -u iso01"
|
---|
[f67f5cf] | 53 | EOF</userinput></screen>
|
---|
[b32e803] | 54 |
|
---|
[b3aee6e] | 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>
|
---|
[f67f5cf] | 58 |
|
---|
[b3aee6e] | 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>
|
---|
[b32e803] | 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.
|
---|
[f67f5cf] | 67 | This confuses some applications, e.g., <application>Emacs</application>
|
---|
[b32e803] | 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 |
|
---|
[f67f5cf] | 72 | <screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
|
---|
[b32e803] | 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 |
|
---|
[f67f5cf] | 77 | <screen><userinput>mkdir -p /etc/kbd & & cat >/etc/kbd/bs-sends-del <<"EOF"
|
---|
[b32e803] | 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
|
---|
[f67f5cf] | 85 | EOF</userinput></screen>
|
---|
[b32e803] | 86 |
|
---|
| 87 | <para>Then tell the <command>console</command> script to load this snippet
|
---|
| 88 | after the main keymap:</para>
|
---|
| 89 |
|
---|
[f67f5cf] | 90 | <screen><userinput>cat >>/etc/sysconfig/console <<"EOF"
|
---|
[b32e803] | 91 | KEYMAP_CORRECTION="/etc/kbd/bs-sends-del"
|
---|
[f67f5cf] | 92 | EOF</userinput></screen>
|
---|
[b32e803] | 93 |
|
---|
[89d204ea] | 94 | <para>If you want to compile your keymap directly into the kernel instead of
|
---|
| 95 | setting it every time from the <command>console</command> bootscript, then
|
---|
| 96 | instructions are given in <xref linkend="ch-bootable-kernel"/>. Doing this
|
---|
| 97 | ensures that your keyboard will always work as expected, even when you boot into
|
---|
[19afc4e] | 98 | maintenance mode (by passing <parameter>init=/bin/sh</parameter> to the kernel),
|
---|
| 99 | as in that situation, the <command>console</command> bootscript won't be run.
|
---|
| 100 | Additionally, the kernel will not set the screen font automatically. Again,
|
---|
| 101 | this shouldn't pose too many problems as ASCII characters will still be handled
|
---|
| 102 | correctly, and it is unlikely that you would need to rely on non-ASCII
|
---|
| 103 | characters whilst in maintenance mode.</para>
|
---|
[89d204ea] | 104 |
|
---|
| 105 | <para>Since the kernel will set up the keymap, you can omit the KEYMAP variable
|
---|
| 106 | from the <filename>/etc/sysconfig/console</filename> configuration file. If you
|
---|
| 107 | wish, you can still have it, this isn't going to hurt you. Keeping it could even
|
---|
| 108 | be beneficial, in case you run a lot of different kernels and can't be sure that
|
---|
| 109 | the keymap is compiled into every one of them.</para>
|
---|
[1050066] | 110 |
|
---|
| 111 | </sect1>
|
---|
[b32e803] | 112 |
|
---|