Different keymaps (??) on my ttys

Denys Vlasenko vda.linux at googlemail.com
Tue Nov 13 18:02:28 UTC 2007


On Friday 09 November 2007 03:39, Alexander Griesser wrote:
> When I boot my thinclient (busybox 1.7.3, BTW) I can login normally
> on tty1. The root password contains a '#' symbol, the keyboard layout
> is german.
>
> When I switch to tty2 (ALT-F2), I cannot login because the '#' symbol
> is interpreted as Backspace, so f.ex. entering the password "asdf#" on
> tty1 is "asd" on tty2, because issuing '#' deletes the 'f' as well.
>
> The really strange thing is, that I tried to use the ASCII key code
> trick (activate Numlock, press ALT + 035, the decimal ASCII code for
> '#') and it gets interpreted as Backspace too.

Looks like keymap is messed up on tty2,3,4...

> This problem only occurs on ttys other than tty1. Maybe my de.kmap
> file is outdated but I don't know anymore where I got it from or
> how I created it.

I think you need to spend an hout or two learning
how exactly your startup scripts initialize ttys.
For some strange reason on many distros it is done
in some contrived, non-obvious, easy-to-mess-up ways.

> How do you load console keymaps?

I run gettys on my virtual ttys as follows:

exec \
env - "TERM=$TERM" PATH="$PATH" LOGIN_PRE_SUID_SCRIPT="$PWD/login.sh" \
getty 38400 "$tty" "$TERM"

LOGIN_PRE_SUID_SCRIPT is a busybox thing, it allows me to run custom
script from login, just prior to running user's shell.
I (re)load keymap there. login.sh is:

ttyname=`tty`
ttybase="${ttyname%%[0123456789]*}"     # strip numeric tail

if test "$ttybase" = "/dev/vc/" -o "$ttybase" = "/dev/tty"; then
    echo "* Loading keymap"
    loadkeys /usr/app/kbd-1.12/share/ru_koi8r.keymap || echo "ERROR"
fi

> How can I generate the binary kmap files needed by loadkmap?

I must confess that I am still using non-busyboxed keymap loading
(I use kbd-1.12):

loadkeys /usr/app/kbd-1.12/share/ru_koi8r.keymap
--
vda



More information about the busybox mailing list