| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 | <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [  <!ENTITY % general-entities SYSTEM "../general.ent">  %general-entities;]><sect1 id="ch-scripts-console"><title>Configuring the Linux console</title><?dbhtml filename="console.html"?><indexterm zone="ch-scripts-console"><primary sortas="d-console">console</primary><secondary>configuring</secondary></indexterm><para>In this section we will configure the <command>console</command>initscript that sets up the keyboardmap and the console font. If youdon't need to use any non-ASCII characters(British pound and Euro character are not ASCII),and your keyboard is a US one, you can skip this section.Without the configuration file,the <command>console</command> initscript will do nothing.</para><para>The <command>console</command> script uses the<filename>/etc/sysconfig/console</filename>as a configuration file. You need to decide which keymap and screen font youwill use. The language-specific HOWTO can help you.A pre-made<filename>/etc/sysconfig/console</filename> file with knowngood settings for several countries was installed with the LFS-Bootscriptspackage, and you just have to uncommentthe relevant section if your country is supported (but read the restof this section anyway).If still in doubt,look into <filename class="directory">/usr/share/kbd</filename>for valid keymaps and screen fonts. Then read the <command>loadkeys</command>and <command>setfont</command> manual pages and figure out the correctarguments for these programs.Once you decided, create theconfiguration file with the following command:</para><screen><userinput>cat >/etc/sysconfig/console <<"EOF"KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"FONT="<replaceable>[arguments for setfont]</replaceable>"EOF</userinput></screen><para>E.g., for Spanish users who also want to use the Euro character(accessible by pressing Alt+E),the following settings are correct:</para><screen><userinput>cat >/etc/sysconfig/console <<"EOF"KEYMAP="es euro"FONT="lat9-16 -u iso01"EOF</userinput></screen><note><para>The FONT line above is correct only for the ISO-8859-15character set. If you prefer ISO-8859-1 and therefore use a pound signinstead of Euro, the correct FONT line is:</para><screen><userinput>FONT="lat1-16"</userinput></screen></note><para>If the KEYMAP or FONT variable is not set, the<command>console</command> initscript will not run the correspondingprogram.</para><para>In some keymaps, the Backspace and Delete keys send charactersdifferent form ones in the default keymap built into the kernel.This confuses some applications, e.g., <application>Emacs</application>displays its help (instead of erasing the character before the cursor)when you press Backspace. To check if your keymap is affected (this worksonly for i386 keymaps):</para><screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen><para>If you see that keycode 14 is Backspace and not Delete,create the following keymap snippet to fix this issue:</para><screen><userinput>mkdir -p /etc/kbd && cat >/etc/kbd/bs-sends-del <<"EOF"                keycode 14 =    Delete  Delete          Delete  Delete        alt     keycode 14 =    Meta_Deletealtgr   alt     keycode 14 =    Meta_Delete                keycode 111 =   Removealtgr   control keycode 111 =   Bootcontrol alt     keycode 111 =   Bootaltgr   control alt keycode 111 = BootEOF</userinput></screen><para>Then tell the <command>console</command> script to load this snippetafter the main keymap:</para><screen><userinput>cat >>/etc/sysconfig/console <<"EOF"KEYMAP_CORRECTION="/etc/kbd/bs-sends-del"EOF</userinput></screen><para>If you want to compile your keymap directly into the kernel instead ofsetting it every time from the <command>console</command> bootscript, theninstructions are given in <xref linkend="ch-bootable-kernel"/>.  Doing thisensures that your keyboard will always work as expected, even when you boot intomaintenance mode (by passing <parameter>init=/bin/sh</parameter> to the kernel),as in that situation, the <command>console</command> bootscript won't be run.Additionally, the kernel will not set the screen font automatically.  Again,this shouldn't pose too many problems as ASCII characters will still be handledcorrectly, and it is unlikely that you would need to rely on non-ASCIIcharacters whilst in maintenance mode.</para><para>Since the kernel will set up the keymap, you can omit the KEYMAP variablefrom the <filename>/etc/sysconfig/console</filename> configuration file. If youwish, you can still have it, this isn't going to hurt you. Keeping it could evenbe beneficial, in case you run a lot of different kernels and can't be sure thatthe keymap is compiled into every one of them.</para></sect1>
 |