Keyboard configuration (kbd)
Preparation
- Perform this stage using your functioning PC.
- Download the kdb source code from www.kernel.org.
- Visit http://www.kernel.org/pub/linux/utils/kbd/.
- Click on the link for the source code of the latest version of kdb. You will need the source code in
.tar.gzformat.- At the time of writing the latest version of kdb was version 1.08, so the file downloaded was
kbd-1.08.tar.gz.
- At the time of writing the latest version of kdb was version 1.08, so the file downloaded was
- You will be asked to where you wish to save the file. Chose a safe place and make a note of it.
- The download is about 800kb and will take about a minute over a modem, but a lot less over a broadband connection.
- If you are using a download accelerator program, it will save the file to your default download directory.
- Burn the file
kbd-1.08.tar.gzto a CD. This page assumes that the subdirectory/appsis used for the.tar.gzfile. The CD-ROM can be a multi-session disk.- Use your CD burning software to create an ISO9660 disc image with the file
kbd-1.08.tar.gzin the/appsdirectory. - Burn the CD and verify the data stored on it.
- Use your CD burning software to create an ISO9660 disc image with the file
Booting
- Perform this stage and subsequent stages, unless otherwise stated, using your Core Linux PC.
- Boot your Core Linux PC.
- Login as
root. You will need to enter the password at the prompt.- Wait for the following text to appear:
localhost login: - Type
rootand press Enter. - The screen will display this message:
Password: - Enter the password for
rootthat you set earlier. - You will be shown a prompt that looks like this:
[~]#
- Wait for the following text to appear:
Extract the source
- Place the CD-R in the CD-ROM drive. Mount the CD-ROM drive under
/mnt/cdrom.- At the prompt enter:
mount /dev/hdb /mnt/cdrom - You will see the following line appear:
mount: block device /dev/hdb is write-protected, mounting read-only
- At the prompt enter:
- Change to the
/appsdirectory on the CD-R.- At the prompt enter:
cd /mnt/cdrom/apps - The prompt will change to:
[/mnt/cdrom/apps]#
- At the prompt enter:
- Copy the
kbd-1.08.tar.gzfile to the directory/usr/src.- At the prompt enter:
cp kbd-1.08.tar.gz /usr/src - The system will not display a message if everything is OK.
- At the prompt enter:
- Change to the
/usr/srcdirectory and extract the source from the.tar.gzfile.- At the prompt enter:
cd /usr/src - The prompt will change to:
[/usr/src]# - At the prompt enter:
tar -zxvf kbd-1.08.tar.gz - A long stream of unzipping files and directories should scroll up the screen for a few seconds.
- At the prompt enter:
Configure and compile
- Change to the
/usr/src/kbd-1.08directory.- At the prompt enter:
cd kbd-1.08 - The prompt will change to:
[/usr/src/kbd-1.08]#
- At the prompt enter:
- Run the
./configurescript.- At the prompt enter:
./configure - A few lines of code should should scroll up the screen for a second or two.
- The script finishes with the line:
(Otherwise, edit defines.h and delete the line with ENABLE_NLS)
- At the prompt enter:
- Run the
makeprogram.- At the prompt enter:
make - A long stream of processes should scroll up the screen for thirty seconds.
- The program finishes with the line:
Done. You can now do make install.
- At the prompt enter:
- Run the
makeprogram with the argumentinstall.- At the prompt enter:
make install - A long stream of processes should scroll up the screen for five seconds.
- The program finishes with the line:
make[1]: Leaving directory '/usr/src/kdb-1.08/man'
- At the prompt enter:
Choosing and starting a new key map
- Select the new key map which you want to use. This example uses the UK key map, settings for which are held in the file
uk.map. Other keymaps are held in the directory/usr/src/kdb-1.08/data/keymapsand are sorted by system architecture, keyboard type and country. - Create the directory
/etc/kbd.- At the system prompt enter:
mkdir /etc/kbd - The system will not display a message if everything is OK.
- At the system prompt enter:
- Copy the new key map to the
/etc/kbddirectory. The key map used in this example is/usr/src/kbd-1.08/data/keymaps/i386/qwerty/uk.map- At the system prompt enter:
cp /usr/src/kbd-1.08/data/keymaps/i386/qwerty/uk.map /etc/kbd - The system will not display a message if everything is OK.
- At the system prompt enter:
- It may be necessary to add some lines to your .inputrc file. For example, the extra keys on a Danish keyboard require the following lines to be added to .inputrc:
set meta-flag on
set convert-meta off
set output-meta on- At the system prompt enter:
nano ~/.inputrc - The screen will show the blank
~/.inputrcfile with information about the file at the top and bottom of the screen. - Add the following lines to the file:
set meta-flag on
set convert-meta off
set output-meta on - Save the file and exit the text editor.
- Press Ctrl+x on the keyboard.
- The contents of the white line at the bottom of the screen will change to read:
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? - Type
y. - For the example of the root user, the contents of the white line at the bottom of the screen will change to read:
File Name to write: /root/.inputrc - Press Enter.
- You will be returned to the system prompt.
.inputrcfrom the Danish HOW-TO at The Linux Documentation Project. - At the system prompt enter:
- Run the program
loadkeyswith the argument/etc/kbd/uk.map.- At the prompt enter:
loadkeys /etc/kbd/uk.map - The system will display the following message:
Loading /etc/kbd/uk.map
- At the prompt enter:
- Test your new key associations.
Automating loadkeys
- This section details how to change the key mapping automatically when the computer boots. The means that you do not have to manually reconfigure the keyboard mappings after each reboot.
- Insert the following line at the beginning of the
/etc/rc.d/rc.muscript:You can also add comments and echoes for your own information.loadkeys /etc/kbd/uk.map- At the prompt enter:
nano /etc/rc.d/rc.mu - The screen will show the contents of
/etc/rc.d/rc.muwith information about the file at the top and bottom of the screen. - Add the following text to the beginning of the file:
# Change keyboard settings
loadkeys /etc/kbd/uk.map
echo UK keyboard settings activated - Save the file and exit the text editor.
- Press Ctrl+x on the keyboard.
- The contents of the white line at the bottom of the screen will change to read:
Save modified buffer (ANSWERING "No" WILL DESTROY CHANGES) ? - Type
y. - The contents of the white line at the bottom of the screen will change to read:
File Name to write: /etc/rc.d/rc.mu - Press Enter.
- You will be returned to the system prompt.
- At the prompt enter:
- Reboot the system and check that the keyboard mapping is correct.
- At the system prompt enter:
shutdown -r now - Wait for the system to reboot.
- As the system reboots, watch for any error messages.
- Once the system has rebooted, test your key associations.
- At the system prompt enter:

The text of this page is licensed under a Creative Commons License.
