tonywhitmore.co.uk  

      blog : gallery : wiki : articles : projects : shell scripts : wallpaper : cv : links :
 Project Homepage

Keyboard configuration (kbd)

Preparation

  1. 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.gz format.
      • At the time of writing the latest version of kdb was version 1.08, so the file downloaded was kbd-1.08.tar.gz.
    • 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.
  2. Burn the file kbd-1.08.tar.gz to a CD. This page assumes that the subdirectory /apps is used for the .tar.gz file. 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.gz in the /apps directory.
    • Burn the CD and verify the data stored on it.

Back to simple version

Booting

  1. Boot your Core Linux PC.
  2. Login as root. You will need to enter the password at the prompt.
    • Wait for the following text to appear:
      localhost login:
    • Type root and press Enter.
    • The screen will display this message:
      Password:
    • Enter the password for root that you set earlier.
    • You will be shown a prompt that looks like this:
      [~]#

Back to simple version

Extract the source

  1. 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
  2. Change to the /apps directory on the CD-R.
    • At the prompt enter:
      cd /mnt/cdrom/apps
    • The prompt will change to:
      [/mnt/cdrom/apps]#
  3. Copy the kbd-1.08.tar.gz file 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.
  4. Change to the /usr/src directory and extract the source from the .tar.gz file.
    • 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.

Back to simple version

Configure and compile

  1. Change to the /usr/src/kbd-1.08 directory.
    • At the prompt enter:
      cd kbd-1.08
    • The prompt will change to:
      [/usr/src/kbd-1.08]#
  2. Run the ./configure script.
    • 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)
  3. Run the make program.
    • 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.
  4. Run the make program with the argument install.
    • 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'

Back to simple version

Choosing and starting a new key map

  1. 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/keymaps and are sorted by system architecture, keyboard type and country.
  2. Create the directory /etc/kbd.
    • At the system prompt enter:
      mkdir /etc/kbd
    • The system will not display a message if everything is OK.
  3. Copy the new key map to the /etc/kbd directory. 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.
  4. 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 ~/.inputrc file 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.
    Thanks to Geir Hauge for contributing this tip. He found out about adding the above lines to his .inputrc from the Danish HOW-TO at The Linux Documentation Project.
  5. Run the program loadkeys with 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
  6. Test your new key associations.

Back to simple version

Automating loadkeys

  1. Insert the following line at the beginning of the /etc/rc.d/rc.mu script:
    loadkeys /etc/kbd/uk.map
    You can also add comments and echoes for your own information.
    • At the prompt enter:
      nano /etc/rc.d/rc.mu
    • The screen will show the contents of /etc/rc.d/rc.mu with 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.
  2. 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.

Back to simple version

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


Valid CSS!     Valid HTML 4.0!     Valid RSS
Original design © For oswd.org by SquireCD