#!/bin/sh # Copyright 1993, 1999 Patrick Volkerding, Moorhead, MN. # Use and redistribution covered by the same terms as the "setup" script. # # Write /etc/rc.d/rc.keymap too, so it can be used by the next configuator # TMP=/var/log/setup/tmp if [ ! -d $TMP ]; then mkdir -p $TMP fi RDIR=/dev/tty7 mk_rc_keymap() { KEYMAP=${MAPNAME%*.map} cat < $TMP/SeTkeymap if [ ! $? = 0 ]; then rm -f $TMP/SeTkeymap exit fi MAPNAME="`cat $TMP/SeTkeymap`" gzip -dc /usr/share/keymaps/${MAPNAME}.gz | loadkmap 1> $RDIR 2> $RDIR while [ 0 ]; do dialog --title "KEYBOARD TEST" --inputbox \ "OK, the new map is now installed. You may now test it by typing \ anything you want. To quit testing the keyboard, enter 1 on a \ line by itself to accept the map and go on, or 2 on a line by \ itself to reject the current keyboard map and select a new one." \ 11 70 2> $TMP/keytest if [ $? = 1 ]; then REPLY="n" break; fi REPLY="`cat $TMP/keytest`" rm -f $TMP/keytest if [ "$REPLY" = "1" -o "$REPLY" = "2" ]; then break; fi done if [ "$REPLY" = "1" ]; then break; else rm -f $TMP/SeTkeymap gzip -dc /usr/share/keymaps/us.map.gz | loadkmap 1> $RDIR 2> $RDIR continue; fi done #### write the setting mk_rc_keymap > /tmp/rc.keymap chmod +x /tmp/rc.keymap