[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Keymap fix (was: Success with HPT366 enhanced 2.2.1 disks)



Previously I wrote on debian-testing:
[testing selfmade 2.2.1 boot disks]
> 1. The finnish keymap was not loaded, even though I chose it 
> during the installation. I had to copy
> /usr/share/keymaps/i386/qwerty/fi-latin1.kmap.gz to /etc/kbd/
> default.map.gz

After I got home and had something to eat, I took a better look at 
this keymap problem. Here's what I found out:

utilities/dbootstrap/kbdconfig.c does this in configure_keyboard()
  kbdconf=fopen("/tmp/kbdconf","w");
  fprintf(kbdconf,"%s/%s",prefix,choices[rs].tag);
  fclose(kbdconf);

It looks like the string in /tmp/kbdconf will be something like 
"i386/qwerty/fi-latin1" (without the quotes).  This string will 
later be copied to /target/root/kbdconf which is processed after 
the first reboot like this:

if [ -s /root/kbdconf ]; then
        # non empty file -> do automatic configuration
        MAP=/usr/share/keymaps/`cat /root/kbdconf`.map.gz
        loadkeys ${MAP} ; dumpkeys > /etc/kbd/default.map
        gzip -9fv /etc/kbd/default.map
        rm /root/kbdconf

The problem is that the files in /usr/share/keymaps/blah/ end with 
.kmap.gz. Here's an example:
    /usr/share/keymaps/i386/qwerty/fi-latin1.kmap.gz

Since loadkeys does not require full pathname, I suggest a fix 
like this. Apply in scripts/basedisks/new_root_home/

--- .bash_profile.orig  Sat Oct 16 17:04:40 1999
+++ .bash_profile       Wed Oct 20 21:55:58 1999
@@ -28,7 +28,7 @@
 
 if [ -s /root/kbdconf ]; then
        # non empty file -> do automatic configuration
-       MAP=/usr/share/keymaps/`cat /root/kbdconf`.map.gz
+       MAP=`cat /root/kbdconf`
        loadkeys ${MAP} ; dumpkeys > /etc/kbd/default.map
        gzip -9fv /etc/kbd/default.map
        rm /root/kbdconf

Warning: I have not tried this with the actual boot disks but it 
seems to work.

# cat kbdconf
i386/qwerty/fi-latin1
# loadkeys `cat kbdconf`
Loading /usr/share/keymaps/i386/qwerty/fi-latin1.kmap.gz
# dpkg -S loadkeys
kbd: /usr/share/man/man1/loadkeys.1.gz
kbd: /bin/loadkeys
# dpkg -s kbd|grep '^Version:'
Version: 0.99-5


// Heikki
-- 
Heikki Vatiainen                  * hessu@cs.tut.fi
Tampere University of Technology  * Tampere, Finland



--  
To UNSUBSCRIBE, email to debian-testing-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: