source: chapter07/console.xml@ b568bbaf

6.1 6.1.1
Last change on this file since b568bbaf was b568bbaf, checked in by Archaic <archaic@…>, 19 years ago

Several minor wording changes in chapter 8. (merge from trunk r6318)

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

  • Property mode set to 100644
File size: 5.1 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-scripts-console">
7<title>Configuring the Linux Console</title>
8<?dbhtml filename="console.html"?>
9
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 <command>console</command>
15bootscript that sets up the keyboard map and the console font. If non-ASCII
16characters (British pound and Euro character are examples of non-ASCII
17characters) will not be used and the keyboard is a U.S. one, skip this section.
18Without the configuration file, the <command>console</command> bootscript will
19do nothing.</para>
20
21<para>The <command>console</command> script reads the
22<filename>/etc/sysconfig/console</filename> file for configuration information.
23Decide which keymap and screen font will be used. Various language-specific
24HOWTO's can also help with this (see <ulink
25url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
26<filename>/etc/sysconfig/console</filename> file with known settings for several
27countries was installed with the LFS-Bootscripts package, so the relevant
28section can be uncommented if the country is supported. If still in doubt, look
29in the <filename class="directory">/usr/share/kbd</filename> directory for valid
30keymaps and screen fonts. Read the <command>loadkeys</command> and
31<command>setfont</command> manual pages and determine the correct arguments for
32these programs. Once decided, create the configuration file with the following
33command:</para>
34
35<screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"
36<literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
37FONT="<replaceable>[arguments for setfont]</replaceable>"</literal>
38EOF</userinput></screen>
39
40<para>For example, for Spanish users who also want to use the Euro
41character (accessible by pressing AltGr+E), the following settings are
42correct:</para>
43
44<screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"
45<literal>KEYMAP="es euro2"
46FONT="lat9-16 -u iso01"</literal>
47EOF</userinput></screen>
48
49<note><para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
50character set. If using ISO 8859-1 and, therefore, a pound sign
51instead 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
57program.</para>
58
59<para>In some keymaps, the Backspace and Delete keys send characters different
60from ones in the default keymap built into the kernel. This confuses some
61applications. For example, Emacs displays its help (instead of erasing the
62character before the cursor) when Backspace is pressed. To check if the keymap
63in use is affected (this works only for i386 keymaps):</para>
64
65<screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
66
67<beginpage/>
68
69<para>If the keycode 14 is Backspace instead of Delete, create the
70following keymap snippet to fix this issue:</para>
71
72<screen><userinput>mkdir -p /etc/kbd &amp;&amp; cat &gt; /etc/kbd/bs-sends-del &lt;&lt;"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
79altgr control alt keycode 111 = Boot</literal>
80EOF</userinput></screen>
81
82<para>Tell the <command>console</command> script to load this
83snippet after the main keymap:</para>
84
85<screen><userinput>cat &gt;&gt;/etc/sysconfig/console &lt;&lt;"EOF"
86<literal>KEYMAP_CORRECTIONS="/etc/kbd/bs-sends-del"</literal>
87EOF</userinput></screen>
88
89<para>To compile the keymap directly into the kernel instead of
90setting it every time from the <command>console</command> bootscript,
91follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
92Doing this ensures that the keyboard will always work as expected,
93even 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
96situation. Additionally, the kernel will not set the screen font
97automatically. This should not pose many problems because ASCII characters
98will be handled correctly, and it is unlikely that a user would need
99to 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
102the <envar>KEYMAP</envar> variable from the
103<filename>/etc/sysconfig/console</filename> configuration file. It can
104also be left in place, if desired, without consequence. Keeping it
105could be beneficial if running several different kernels where it is
106difficult to ensure that the keymap is compiled into every one of
107them.</para>
108
109</sect1>
110
Note: See TracBrowser for help on using the repository browser.