2009-10-12 18:46:43 +02:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
PREREQ=""
|
|
|
|
DESCRIPTION="Setting up system keymap"
|
|
|
|
|
2011-03-11 08:05:59 +01:00
|
|
|
[ -r /scripts/functions ] && . /scripts/functions
|
2009-10-12 18:46:43 +02:00
|
|
|
|
|
|
|
prereqs()
|
|
|
|
{
|
|
|
|
echo "$PREREQ"
|
|
|
|
}
|
|
|
|
|
|
|
|
case $1 in
|
|
|
|
# get pre-requisites
|
|
|
|
prereqs)
|
|
|
|
prereqs
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
log_begin_msg "$DESCRIPTION"
|
|
|
|
|
|
|
|
# commandline
|
|
|
|
for x in $(cat /proc/cmdline); do
|
|
|
|
case $x in
|
|
|
|
keymap=*)
|
|
|
|
keymap=${x#keymap=}
|
|
|
|
set_keymap="true"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "${set_keymap}" ]; then
|
2011-11-08 12:38:40 +01:00
|
|
|
sed -i -e "s|\(KEYMAP=\).*|\1${keymap}|" ${rootmnt}/etc/vconsole.conf
|
2009-10-12 18:46:43 +02:00
|
|
|
fi
|
|
|
|
|
2011-04-12 17:20:34 +02:00
|
|
|
# Setup keymap for X.org evdev.
|
|
|
|
if [ -r "${rootmnt}/etc/udev/rules.d/75-x11-input.rules" ]; then
|
|
|
|
sed -i -e "s|\(ENV{xkblayout}\=\)\"us\"|\1\"${keymap}\"|" \
|
|
|
|
${rootmnt}/etc/udev/rules.d/75-x11-input.rules
|
|
|
|
fi
|
|
|
|
|
2011-02-16 19:23:10 +01:00
|
|
|
# Setup keymap for lightdm.
|
|
|
|
if [ -r "${rootmnt}/etc/lightdm.conf" ]; then
|
|
|
|
sed -i -e "s|^\#\(layout=\).*|\1${keymap}|" ${rootmnt}/etc/lightdm.conf
|
2009-10-12 18:46:43 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
log_end_msg
|