source: chapter07/console.xml@ a811dff0

Last change on this file since a811dff0 was a811dff0, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • (chapter07/*.xml) RELAX NG validation fixes

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/LFS-RNG/BOOK@4351 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

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