source: chapter07/console.xml@ 5998892

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 5998892 was 5998892, checked in by Matthew Burgess <matthew@…>, 19 years ago

Add -v to commands that accept it

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

  • Property mode set to 100644
File size: 5.0 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 (e.g., the British pound sign and Euro character) will not be used
17and the keyboard is a U.S. one, skip this section. Without the configuration
18file, the <command>console</command> bootscript will do nothing.</para>
19
20<para>The <command>console</command> script reads the
21<filename>/etc/sysconfig/console</filename> file for configuration information.
22Decide which keymap and screen font will be used. Various language-specific
23HOWTO's can also help with this (see <ulink
24url="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
26countries was installed with the LFS-Bootscripts package, so the relevant
27section can be uncommented if the country is supported. If still in doubt, look
28in the <filename class="directory">/usr/share/kbd</filename> directory for valid
29keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
30<filename>setfont(8)</filename> to determine the correct arguments for
31these programs. Once decided, create the configuration file with the following
32command:</para>
33
34<screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"
35<literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
36FONT="<replaceable>[arguments for setfont]</replaceable>"</literal>
37EOF</userinput></screen>
38
39<para>For example, for Spanish users who also want to use the Euro
40character (accessible by pressing AltGr+E), the following settings are
41correct:</para>
42
43<screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"
44<literal>KEYMAP="es euro2"
45FONT="lat9-16 -u iso01"</literal>
46EOF</userinput></screen>
47
48<note><para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
49character set. If using ISO 8859-1 and, therefore, a pound sign
50instead 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
56program.</para>
57
58<para>In some keymaps, the Backspace and Delete keys send characters different
59from ones in the default keymap built into the kernel. This confuses some
60applications. For example, Emacs displays its help (instead of erasing the
61character before the cursor) when Backspace is pressed. To check if the keymap
62in use is affected (this works only for i386 keymaps):</para>
63
64<screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
65
66<para>If the keycode 14 is Backspace instead of Delete, create the
67following keymap snippet to fix this issue:</para>
68
69<screen><userinput>mkdir -pv /etc/kbd &amp;&amp; cat &gt; /etc/kbd/bs-sends-del &lt;&lt;"EOF"
70<literal> keycode 14 = Delete Delete Delete Delete
71 alt keycode 14 = Meta_Delete
72 altgr alt keycode 14 = Meta_Delete
73 keycode 111 = Remove
74 altgr control keycode 111 = Boot
75 control alt keycode 111 = Boot
76altgr control alt keycode 111 = Boot</literal>
77EOF</userinput></screen>
78
79<para>Tell the <command>console</command> script to load this
80snippet after the main keymap:</para>
81
82<screen><userinput>cat &gt;&gt;/etc/sysconfig/console &lt;&lt;"EOF"
83<literal>KEYMAP_CORRECTIONS="/etc/kbd/bs-sends-del"</literal>
84EOF</userinput></screen>
85
86<para>To compile the keymap directly into the kernel instead of
87setting it every time from the <command>console</command> bootscript,
88follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
89Doing this ensures that the keyboard will always work as expected,
90even when booting into maintenance mode (by passing
91<parameter>init=/bin/sh</parameter> to the kernel), because the
92<command>console</command> bootscript will not be run in that
93situation. Additionally, the kernel will not set the screen font
94automatically. This should not pose many problems because ASCII characters
95will be handled correctly, and it is unlikely that a user would need
96to rely on non-ASCII characters while in maintenance mode.</para>
97
98<para>Since the kernel will set up the keymap, it is possible to omit
99the <envar>KEYMAP</envar> variable from the
100<filename>/etc/sysconfig/console</filename> configuration file. It can
101also be left in place, if desired, without consequence. Keeping it
102could be beneficial if running several different kernels where it is
103difficult to ensure that the keymap is compiled into every one of
104them.</para>
105
106</sect1>
107
Note: See TracBrowser for help on using the repository browser.