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