6.51. Kbd-1.15.5

The Kbd package contains key-table files, console fonts, and keyboard utilities.

Approximate build time: 0.1 SBU
Required disk space: 20 MB

6.51.1. Installation of Kbd

The behaviour of the Backspace and Delete keys is not consistent across the keymaps in the Kbd package. The following patch fixes this issue for i386 keymaps:

patch -Np1 -i ../kbd-1.15.5-backspace-1.patch

After patching, the Backspace key generates the character with code 127, and the Delete key generates a well-known escape sequence.

Fix a bug that causes some keymaps not to be loaded correctly:

sed -i -e '326 s/if/while/' src/loadkeys.analyze.l

Remove the redundant resizecons program (it requires the defunct svgalib to provide the video mode files - for normal use setfont sizes the console appropriately) together with its manpage.

sed -i 's/\(RESIZECONS_PROGS=\)yes/\1no/g' configure
sed -i 's/resizecons.8 //' man/man8/Makefile.in

Prepare Kbd for compilation:

./configure --prefix=/usr --datadir=/lib/kbd \

The meaning of the configure options:


This option puts keyboard layout data in a directory that will always be on the root partition instead of the default /usr/share/kbd.


This option prevents the vlock utility from being built, as it requires the PAM library, which isn't available in the chroot environment.

Compile the package:


This package does not come with a test suite.

Install the package:

make install


For some languages (e.g., Belarusian) the Kbd package doesn't provide a useful keymap where the stock “by” keymap assumes the ISO-8859-5 encoding, and the CP1251 keymap is normally used. Users of such languages have to download working keymaps separately.

Some of the scripts in the LFS-Bootscripts package depend on kbd_mode, loadkeys, openvt, and setfont. As /usr may not be available during the early stages of booting, those binaries need to be on the root partition:

mv -v /usr/bin/{kbd_mode,loadkeys,openvt,setfont} /bin

If desired, install the documentation:

mkdir -v /usr/share/doc/kbd-1.15.5
cp -R -v doc/* \

6.51.2. Contents of Kbd

Installed programs: chvt, deallocvt, dumpkeys, fgconsole, getkeycodes, kbdinfo, kbd_mode, kbdrate, loadkeys, loadunimap, mapscrn, openvt, psfaddtable (link to psfxtable), psfgettable (link to psfxtable), psfstriptable (link to psfxtable), psfxtable, setfont, setkeycodes, setleds, setmetamode, showconsolefont, showkey, unicode_start, and unicode_stop
Installed directory: /lib/kbd

Short Descriptions


Changes the foreground virtual terminal


Deallocates unused virtual terminals


Dumps the keyboard translation tables


Prints the number of the active virtual terminal


Prints the kernel scancode-to-keycode mapping table


Obtains information about the status of a console


Reports or sets the keyboard mode


Sets the keyboard repeat and delay rates


Loads the keyboard translation tables


Loads the kernel unicode-to-font mapping table


An obsolete program that used to load a user-defined output character mapping table into the console driver; this is now done by setfont


Starts a program on a new virtual terminal (VT)


A link to psfxtable


A link to psfxtable


A link to psfxtable


Handle Unicode character tables for console fonts


Changes the Enhanced Graphic Adapter (EGA) and Video Graphics Array (VGA) fonts on the console


Loads kernel scancode-to-keycode mapping table entries; this is useful if there are unusual keys on the keyboard


Sets the keyboard flags and Light Emitting Diodes (LEDs)


Defines the keyboard meta-key handling


Shows the current EGA/VGA console screen font


Reports the scancodes, keycodes, and ASCII codes of the keys pressed on the keyboard


Puts the keyboard and console in UNICODE mode. Don't use this program unless your keymap file is in the ISO-8859-1 encoding. For other encodings, this utility produces incorrect results.


Reverts keyboard and console from UNICODE mode