#! /bin/sh #---------------------------------------------------------------------------- # /etc/init.d/console - console key mapping # # Creation : 2003-07-19 fm # Last Update: $Id$ # # Copyright (c) 2001-2013 the eisfair team, team(at)eisfair(dot)org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- . /etc/config.d/base . /etc/config.d/environment . /etc/init.d/functions #set -x case $1 in start) if [ -z "$KEYMAP" ] then KEYMAP='de-latin1' fi unicode='no' # check LC_CTYPE for .utf8|.utf-8 if $(echo "${LC_CTYPE}" | grep -qE '.[Uu][Tt][Ff]-?8') then unicode='yes' fi if [ "${unicode}" = "no" ] then boot_mesg " * Setting console mode to ASCII (default)..." for i in /dev/tty[0-9]* do kbd_mode -a -C ${i} printf "\e%%@" > ${i} /bin/setfont /lib/kbd/consolefonts/lat0-16 -C ${i} done echo 0 > /sys/module/vt/parameters/default_utf8 evaluate_retval else boot_mesg " * Setting console mode to Unicode (UTF-8)..." for i in /dev/tty[0-9]* do kbd_mode -u -C ${i} printf "\e%%G" > ${i} /bin/setfont /lib/kbd/consolefonts/lat0-16 -C ${i} done echo 1 > /sys/module/vt/parameters/default_utf8 evaluate_retval fi /bin/loadkeys -q ${KEYMAP} ;; stop) ;; esac set +x